Diffstat (limited to 'noncore/net/opieirc/ircchannel.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchannel.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircchannel.h b/noncore/net/opieirc/ircchannel.h new file mode 100644 index 0000000..c800b99 --- a/dev/null +++ b/noncore/net/opieirc/ircchannel.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 __IRCCHANNEL_H | ||
22 | #define __IRCCHANNEL_H | ||
23 | |||
24 | #include <qobject.h> | ||
25 | #include <qlist.h> | ||
26 | #include <qstring.h> | ||
27 | #include "ircperson.h" | ||
28 | |||
29 | /* Flags which a person can have inside a channel */ | ||
30 | enum IRCChannelPersonFlag { | ||
31 | PERSON_FLAG_OP = 0x01, | ||
32 | PERSON_FLAG_VOICE = 0x02, | ||
33 | PERSON_FLAG_HALFOP = 0x04 | ||
34 | }; | ||
35 | |||
36 | /* This struct encapsulates a IRCPerson and adds | ||
37 | channel specific information */ | ||
38 | typedef struct IRCChannelPerson { | ||
39 | IRCPerson *person; | ||
40 | unsigned int flags; | ||
41 | }; | ||
42 | |||
43 | /* IRCChannel is the object-oriented representation | ||
44 | of an IRC channel. It basically acts as a container | ||
45 | for IRCChannelPersons */ | ||
46 | class IRCChannel : public QObject { | ||
47 | Q_OBJECT | ||
48 | public: | ||
49 | IRCChannel(QString channelname); | ||
50 | |||
51 | void addPerson(IRCChannelPerson *person); | ||
52 | void removePerson(IRCChannelPerson *person); | ||
53 | IRCChannelPerson *getPerson(QString nickname); | ||
54 | QListIterator<IRCChannelPerson> people(); | ||
55 | |||
56 | /* hasPeople identifies whether the irc channel is | ||
57 | done synchronizing with the current state - | ||
58 | this is only relevant when joining a channel */ | ||
59 | void setHasPeople(bool hasPeople); | ||
60 | QString channelname(); | ||
61 | bool hasPeople(); | ||
62 | protected: | ||
63 | QList<IRCChannelPerson> m_people; | ||
64 | QString m_channelname; | ||
65 | bool m_hasPeople; | ||
66 | }; | ||
67 | |||
68 | #endif /* __IRCCHANNEL_H */ | ||