]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/builtinmodes.h
Migrate u_listmode.h into the core, change +b to use it
[user/henk/code/inspircd.git] / include / builtinmodes.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
5  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
6  *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
7  *
8  * This file is part of InspIRCd.  InspIRCd is free software: you can
9  * redistribute it and/or modify it under the terms of the GNU General Public
10  * License as published by the Free Software Foundation, version 2.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #pragma once
22
23 #include "mode.h"
24 #include "channels.h"
25 #include "listmode.h"
26
27 /** Channel mode +b
28  */
29 class ModeChannelBan : public ListModeBase
30 {
31  public:
32         ModeChannelBan()
33                 : ListModeBase(NULL, "ban", 'b', "End of channel ban list", 367, 368, true, "maxbans")
34         {
35         }
36 };
37
38 /** Channel mode +i
39  */
40 class ModeChannelInviteOnly : public SimpleChannelModeHandler
41 {
42  public:
43         ModeChannelInviteOnly() : SimpleChannelModeHandler(NULL, "inviteonly", 'i')
44         {
45         }
46 };
47
48 /** Channel mode +k
49  */
50 class ModeChannelKey : public ModeHandler
51 {
52  public:
53         ModeChannelKey();
54         ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
55         void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
56         void RemoveMode(User* user, irc::modestacker* stack = NULL);
57 };
58
59
60 /** Channel mode +l
61  */
62 class ModeChannelLimit : public ParamChannelModeHandler
63 {
64  public:
65         ModeChannelLimit();
66         bool ParamValidate(std::string& parameter);
67         bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);
68 };
69
70 /** Channel mode +m
71  */
72 class ModeChannelModerated : public SimpleChannelModeHandler
73 {
74  public:
75         ModeChannelModerated() : SimpleChannelModeHandler(NULL, "moderated", 'm')
76         {
77         }
78 };
79
80 /** Channel mode +n
81  */
82 class ModeChannelNoExternal : public SimpleChannelModeHandler
83 {
84  public:
85         ModeChannelNoExternal() : SimpleChannelModeHandler(NULL, "noextmsg", 'n')
86         {
87         }
88 };
89
90 /** Channel mode +o
91  */
92 class ModeChannelOp : public ModeHandler
93 {
94  private:
95  public:
96         ModeChannelOp();
97         ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
98         unsigned int GetPrefixRank();
99         void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
100         void RemoveMode(User* user, irc::modestacker* stack = NULL);
101 };
102
103 /** Channel mode +p
104  */
105 class ModeChannelPrivate : public SimpleChannelModeHandler
106 {
107  public:
108         ModeChannelPrivate() : SimpleChannelModeHandler(NULL, "private", 'p')
109         {
110         }
111 };
112
113 /** Channel mode +s
114  */
115 class ModeChannelSecret : public SimpleChannelModeHandler
116 {
117  public:
118         ModeChannelSecret() : SimpleChannelModeHandler(NULL, "secret", 's')
119         {
120         }
121 };
122
123 /** Channel mode +t
124  */
125 class ModeChannelTopicOps : public SimpleChannelModeHandler
126 {
127  public:
128         ModeChannelTopicOps() : SimpleChannelModeHandler(NULL, "topiclock", 't')
129         {
130         }
131 };
132
133 /** Channel mode +v
134  */
135 class ModeChannelVoice : public ModeHandler
136 {
137  private:
138  public:
139         ModeChannelVoice();
140         ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
141         unsigned int GetPrefixRank();
142         void RemoveMode(User* user, irc::modestacker* stack = NULL);
143         void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
144 };
145
146 /** User mode +i
147  */
148 class ModeUserInvisible : public SimpleUserModeHandler
149 {
150  public:
151         ModeUserInvisible() : SimpleUserModeHandler(NULL, "invisible", 'i')
152         {
153         }
154 };
155
156 /** User mode +n
157  */
158 class ModeUserServerNoticeMask : public ModeHandler
159 {
160  public:
161         ModeUserServerNoticeMask();
162         ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
163         void OnParameterMissing(User* user, User* dest, Channel* channel);
164         std::string GetUserParameter(User* user);
165 };
166
167 /** User mode +o
168  */
169 class ModeUserOperator : public ModeHandler
170 {
171  public:
172         ModeUserOperator();
173         ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
174 };
175
176 /** User mode +w
177  */
178 class ModeUserWallops : public SimpleUserModeHandler
179 {
180  public:
181         ModeUserWallops() : SimpleUserModeHandler(NULL, "wallops", 'w')
182         {
183         }
184 };