[project @ 2005-07-05 18:48:49 by unknown_lamer]
[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
17 // 02110-1301, USA.
18
19 #ifndef SERVERQUEUEITEM_H
20 #define SERVERQUEUEITEM_H
21
22 class ServerQueueItem {
23 public:
24 int priority, penalty, type;
25
26 enum {
27 CHANNELMODE, USERMODE, INVITE, JOIN, KICK,
28 NICK, NOTICE, PART, PASS, PING, PONG, PRIVMSG,
29 QUIT, TOPIC, USER, USERHOST, WHO, WHOIS, OTHER
30 };
31
32 ServerQueueItem(int, int, int);
33 virtual ~ServerQueueItem() { }
34
35 virtual bool merge(ServerQueueItem *) { return false; }
36 virtual String getLine() = 0;
37
38 friend class ServerQueue;
39
40 private:
41 ServerQueueItem(const ServerQueueItem &);
42 };
43
44
45 class ServerQueueOtherItem : public ServerQueueItem {
46 public:
47 String line;
48
49 ServerQueueOtherItem(String, int, int, int);
50 String getLine();
51 };
52
53 class ServerQueueChannelModeItem : public ServerQueueItem {
54 public:
55 String channel;
56 String mode;
57 String parameters;
58 int paramcount;
59
60 ServerQueueChannelModeItem(String, String, String);
61 bool merge(ServerQueueItem *);
62 String getLine();
63 };
64
65 class ServerQueueKickItem : public ServerQueueItem {
66 public:
67 String channel;
68 String who;
69 String reason;
70 int count;
71
72 ServerQueueKickItem(String, String, String);
73 bool merge(ServerQueueItem *);
74 String getLine();
75 };
76
77 class ServerQueueNoticeItem : public ServerQueueItem {
78 public:
79 String dest;
80 String message;
81 int count;
82
83 ServerQueueNoticeItem(String, String);
84 bool merge(ServerQueueItem *);
85 String getLine();
86 };
87
88 #endif