Diffstat (limited to 'noncore/net/opieirc/ircoutput.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircoutput.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircoutput.h b/noncore/net/opieirc/ircoutput.h index 72361d4..e8cc524 100644 --- a/noncore/net/opieirc/ircoutput.h +++ b/noncore/net/opieirc/ircoutput.h | |||
@@ -1,72 +1,74 @@ | |||
1 | /* | 1 | /* |
2 | OpieIRC - An embedded IRC client | 2 | OpieIRC - An embedded IRC client |
3 | Copyright (C) 2002 Wenzel Jakob | 3 | Copyright (C) 2002 Wenzel Jakob |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | 18 | ||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef __IRCOUTPUT_H | 21 | #ifndef __IRCOUTPUT_H |
22 | #define __IRCOUTPUT_H | 22 | #define __IRCOUTPUT_H |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qlist.h> | 25 | #include <qlist.h> |
26 | #include "ircchannel.h" | 26 | #include "ircchannel.h" |
27 | 27 | ||
28 | /* Types of possible IRC output */ | 28 | /* Types of possible IRC output */ |
29 | enum IRCOutputType { | 29 | enum IRCOutputType { |
30 | OUTPUT_ERROR = -1, /* parameters : none */ | 30 | OUTPUT_ERROR = -1, /* parameters : none */ |
31 | OUTPUT_SERVERMESSAGE = 0, /* parameters : none */ | 31 | OUTPUT_SERVERMESSAGE = 0, /* parameters : none */ |
32 | OUTPUT_CLIENTMESSAGE = 1, /* parameters : none */ | 32 | OUTPUT_CLIENTMESSAGE = 1, /* parameters : none */ |
33 | OUTPUT_CHANPRIVMSG = 2, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ | 33 | OUTPUT_CHANPRIVMSG = 2, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ |
34 | OUTPUT_QUERYPRIVMSG = 3, /* parameters : person (IRCPerson) */ | 34 | OUTPUT_QUERYPRIVMSG = 3, /* parameters : person (IRCPerson) */ |
35 | OUTPUT_NICKCHANGE = 4, /* parameters : person (IRCPerson) */ | 35 | OUTPUT_NICKCHANGE = 4, /* parameters : person (IRCPerson) */ |
36 | OUTPUT_SELFJOIN = 5, /* parameters : channel (IRCChannel) */ | 36 | OUTPUT_SELFJOIN = 5, /* parameters : channel (IRCChannel) */ |
37 | OUTPUT_OTHERJOIN = 6, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ | 37 | OUTPUT_OTHERJOIN = 6, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ |
38 | OUTPUT_SELFPART = 7, /* parameters : channel (IRCChannel) */ | 38 | OUTPUT_SELFPART = 7, /* parameters : channel (IRCChannel) */ |
39 | OUTPUT_OTHERPART = 8, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ | 39 | OUTPUT_OTHERPART = 8, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ |
40 | OUTPUT_QUIT = 9, /* parameters : person (IRCPerson) */ | 40 | OUTPUT_QUIT = 9, /* parameters : person (IRCPerson) */ |
41 | OUTPUT_CONNCLOSE = 10, /* parameters : none */ | 41 | OUTPUT_CONNCLOSE = 10, /* parameters : none */ |
42 | OUTPUT_CTCP = 11, /* parameters : none */ | 42 | OUTPUT_CTCP = 11, /* parameters : none */ |
43 | OUTPUT_SELFKICK = 12, /* parameters : channel (IRCChannel) */ | 43 | OUTPUT_SELFKICK = 12, /* parameters : channel (IRCChannel) */ |
44 | OUTPUT_OTHERKICK = 13, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ | 44 | OUTPUT_OTHERKICK = 13, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ |
45 | OUTPUT_CHANACTION = 14, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ | 45 | OUTPUT_CHANACTION = 14, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ |
46 | OUTPUT_QUERYACTION = 15, /* parameters : person (IRCPerson) */ | 46 | OUTPUT_QUERYACTION = 15, /* parameters : person (IRCPerson) */ |
47 | OUTPUT_CHANPERSONMODE = 16 /* parameters : channel (IRCCHannel) person (IRCChannelPerson) */ | 47 | OUTPUT_CHANPERSONMODE = 16 /* parameters : channel (IRCCHannel) person (IRCChannelPerson) */ |
48 | }; | 48 | }; |
49 | 49 | ||
50 | /* The IRCOutput class is used as a kind of message which is sent by the | 50 | /* The IRCOutput class is used as a kind of message which is sent by the |
51 | IRC parser to inform the GUI of changes. This could for example be a | 51 | IRC parser to inform the GUI of changes. This could for example be a |
52 | channel message or a nickname change */ | 52 | channel message or a nickname change */ |
53 | 53 | ||
54 | class IRCOutput { | 54 | class IRCOutput { |
55 | public: | 55 | public: |
56 | IRCOutput(IRCOutputType type, QString message); | 56 | IRCOutput(IRCOutputType type, QString message); |
57 | /* Used to add a parameter to this IRCOutput. Parameters are dependent | 57 | /* Used to add a parameter to this IRCOutput. Parameters are dependent |
58 | on which IRCOutputType we are using (see above) */ | 58 | on which IRCOutputType we are using (see above) */ |
59 | void addParam(void *data); | 59 | void addParam(void *data); |
60 | 60 | ||
61 | IRCOutputType type(); | 61 | IRCOutputType type(); |
62 | QString message(); | 62 | QString message(); |
63 | /* Return the message with all HTML code escaped (for example < instead of '<') */ | 63 | /* Return the message with all HTML code escaped (for example < instead of '<') */ |
64 | QString htmlMessage(); | 64 | QString htmlMessage(); |
65 | |||
66 | static QString toHTML(QString message); | ||
65 | void *getParam(int index); | 67 | void *getParam(int index); |
66 | protected: | 68 | protected: |
67 | IRCOutputType m_type; | 69 | IRCOutputType m_type; |
68 | QString m_message; | 70 | QString m_message; |
69 | QList<void> m_parameters; | 71 | QList<void> m_parameters; |
70 | }; | 72 | }; |
71 | 73 | ||
72 | #endif | 74 | #endif |