ee3d472fcf0ce33afb7128c248537b503a735830
[clinton/bobotpp.git] / source / ServerQueueItem.H
1 // ServerQueueItem.H -*- C++ -*-
2 // Copyright (c) 1998 Etienne BERNARD
3
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // any later version.
8
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 #ifndef SERVERQUEUEITEM_H
19 #define SERVERQUEUEITEM_H
20
21 class ServerQueueItem {
22 public:
23 int priority, penalty, type;
24
25 enum {
26 CHANNELMODE, USERMODE, INVITE, JOIN, KICK,
27 NICK, NOTICE, PART, PASS, PING, PONG, PRIVMSG,
28 QUIT, TOPIC, USER, USERHOST, WHO, WHOIS, OTHER
29 };
30
31 ServerQueueItem(int, int, int);
32 virtual ~ServerQueueItem() { }
33
34 virtual bool merge(ServerQueueItem *) { return false; }
35 virtual String getLine() = 0;
36
37 friend class ServerQueue;
38
39 private:
40 ServerQueueItem(const ServerQueueItem &);
41 };
42
43
44 class ServerQueueOtherItem : public ServerQueueItem {
45 public:
46 String line;
47
48 ServerQueueOtherItem(String, int, int, int);
49 String getLine();
50 };
51
52 class ServerQueueChannelModeItem : public ServerQueueItem {
53 public:
54 String channel;
55 String mode;
56 String parameters;
57 int paramcount;
58
59 ServerQueueChannelModeItem(String, String, String);
60 bool merge(ServerQueueItem *);
61 String getLine();
62 };
63
64 class ServerQueueKickItem : public ServerQueueItem {
65 public:
66 String channel;
67 String who;
68 String reason;
69 int count;
70
71 ServerQueueKickItem(String, String, String);
72 bool merge(ServerQueueItem *);
73 String getLine();
74 };
75
76 class ServerQueueNoticeItem : public ServerQueueItem {
77 public:
78 String dest;
79 String message;
80 int count;
81
82 ServerQueueNoticeItem(String, String);
83 bool merge(ServerQueueItem *);
84 String getLine();
85 };
86
87 #endif