Split user list from Channel into ChannelUserList
[clinton/bobotpp.git] / source / User.H
1 // User.H -*- C++ -*-
2 // Copyright (c) 1997, 1998 Etienne BERNARD
3 // Copyright (C) 2009 Clinton Ebadi
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 // 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 #ifndef USER_H
20 #define USER_H
21
22 #include "UserList.H"
23
24 class Bot;
25 class Channel;
26 class Commands;
27 class Parser;
28 class UserCommands;
29 class UserListItem;
30
31 class User {
32
33 int mode;
34 int floodNum;
35 UserListItem * userListItem;
36 String nick;
37 String userhost;
38 String userkey;
39
40 public:
41 enum {
42 OP_MODE = 1,
43 VOICE_MODE = 2,
44 AWAY_MODE = 4,
45 IRCOP_MODE = 8
46 };
47
48 enum {
49 NONE = 0,
50 USER = 1,
51 TRUSTED_USER = 2,
52 FRIEND = 3,
53 MASTER = 4
54 };
55
56 enum {
57 NO_PROT = 0,
58 NO_BAN = 1,
59 NO_KICK = 2,
60 NO_DEOP = 3
61 };
62
63 User(String, String, String, int, UserListItem *);
64 User(String, int);
65
66 int getLevel() const;
67 int getProt() const;
68 bool getAop() const;
69
70 bool operator< (const User &) const;
71 bool operator== (const User &) const;
72
73 friend class Bot;
74 friend class Parser;
75 friend class ChannelUserList;
76 friend class Commands;
77 friend class UserCommands;
78 };
79
80 #endif