]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_info/core_info.h
core_info Add class ServerTargetCommand
[user/henk/code/inspircd.git] / src / coremods / core_info / core_info.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5  *
6  * This file is part of InspIRCd.  InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #pragma once
21
22 #include "inspircd.h"
23
24 /** These commands require no parameters, but if there is a parameter it is a server name where the command will be routed to.
25  */
26 class ServerTargetCommand : public Command
27 {
28  public:
29         ServerTargetCommand(Module* mod, const std::string& Name)
30                 : Command(mod, Name)
31         {
32         }
33
34         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
35 };
36
37 /** Handle /ADMIN.
38  */
39 class CommandAdmin : public Command
40 {
41  public:
42         /** Holds the admin's name, for output in
43          * the /ADMIN command.
44          */
45         std::string AdminName;
46
47         /** Holds the email address of the admin,
48          * for output in the /ADMIN command.
49          */
50         std::string AdminEmail;
51
52         /** Holds the admin's nickname, for output
53          * in the /ADMIN command
54          */
55         std::string AdminNick;
56
57         /** Constructor for admin.
58          */
59         CommandAdmin(Module* parent);
60
61         /** Handle command.
62          * @param parameters The parameters to the command
63          * @param user The user issuing the command
64          * @return A value from CmdResult to indicate command success or failure.
65          */
66         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
67         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
68 };
69
70 /** Handle /COMMANDS.
71  */
72 class CommandCommands : public Command
73 {
74  public:
75         /** Constructor for commands.
76          */
77         CommandCommands(Module* parent);
78
79         /** Handle command.
80          * @param parameters The parameters to the command
81          * @param user The user issuing the command
82          * @return A value from CmdResult to indicate command success or failure.
83          */
84         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
85 };
86
87 /** Handle /INFO.
88  */
89 class CommandInfo : public Command
90 {
91  public:
92         /** Constructor for info.
93          */
94         CommandInfo(Module* parent);
95
96         /** Handle command.
97          * @param parameters The parameters to the command
98          * @param user The user issuing the command
99          * @return A value from CmdResult to indicate command success or failure.
100          */
101         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
102         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
103 };
104
105 /** Handle /MODULES.
106  */
107 class CommandModules : public Command
108 {
109  public:
110         /** Constructor for modules.
111          */
112         CommandModules(Module* parent);
113
114         /** Handle command.
115          * @param parameters The parameters to the command
116          * @param user The user issuing the command
117          * @return A value from CmdResult to indicate command success or failure.
118          */
119         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
120         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
121 };
122
123 /** Handle /MOTD.
124  */
125 class CommandMotd : public Command
126 {
127  public:
128         /** Constructor for motd.
129          */
130         CommandMotd(Module* parent);
131
132         /** Handle command.
133          * @param parameters The parameters to the command
134          * @param user The user issuing the command
135          * @return A value from CmdResult to indicate command success or failure.
136          */
137         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
138         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
139 };
140
141 /** Handle /TIME.
142  */
143 class CommandTime : public Command
144 {
145  public:
146         /** Constructor for time.
147          */
148         CommandTime(Module* parent);
149
150         /** Handle command.
151          * @param parameters The parameters to the command
152          * @param user The user issuing the command
153          * @return A value from CmdResult to indicate command success or failure.
154          */
155         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
156         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
157 };
158
159 /** Handle /VERSION.
160  */
161 class CommandVersion : public Command
162 {
163  public:
164         /** Constructor for version.
165          */
166         CommandVersion(Module* parent);
167
168         /** Handle command.
169          * @param parameters The parameters to the command
170          * @param user The user issuing the command
171          * @return A value from CmdResult to indicate command success or failure.
172          */
173         CmdResult Handle(const std::vector<std::string>& parameters, User* user);
174 };