summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircmessage.h
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircmessage.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmessage.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircmessage.h b/noncore/net/opieirc/ircmessage.h
new file mode 100644
index 0000000..0c5c879
--- a/dev/null
+++ b/noncore/net/opieirc/ircmessage.h
@@ -0,0 +1,68 @@
1/*
2 OpieIRC - An embedded IRC client
3 Copyright (C) 2002 Wenzel Jakob
4
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
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
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
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20
21#ifndef __IRCMESSAGE_H
22#define __IRCMESSAGE_H
23
24#include <qstring.h>
25#include <qstringlist.h>
26
27/* IRCMessage objects are used to encapsulate information
28 which the IRC server sent to us. */
29
30class IRCMessage {
31public:
32 /* Parse an IRC message and create the IRCMessage object */
33 IRCMessage(QString line);
34
35 /* Return the IRC message prefix (usually sender etc) */
36 QString prefix();
37 /* Check if this IRCMessage's command is literal or numerical */
38 bool isNumerical();
39 /* CHeck if this IRCMessage is a CTCP message */
40 bool isCTCP();
41 /* Return the IRC command (literal commands) */
42 QString command();
43 /* Return the CTCP command */
44 QString ctcpCommand();
45 /* Return the CTCP destination if applicable (channel/person) */
46 QString ctcpDestination();
47 /* Return the IRC command (numerical commands) */
48 unsigned short commandNumber();
49 /* Return the trailing parameter string */
50 QString trailing();
51 /* Return the complete parameter string */
52 QString allParameters();
53 /* Return one parameter */
54 QString param(int param);
55protected:
56 QString m_prefix;
57 QString m_command;
58 QString m_ctcpCommand;
59 QString m_ctcpDestination;
60 unsigned short m_commandNumber;
61 QString m_allParameters;
62 QString m_trailing;
63 QStringList m_parameters;
64 bool m_isNumerical;
65 bool m_ctcp;
66};
67
68#endif