-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmenu_system.hpp
279 lines (224 loc) · 6.4 KB
/
menu_system.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#ifndef MENU_SYSTEM_HPP
#define MENU_SYSTEM_HPP
#include "state_base.hpp"
#include "menu_base.hpp"
#include "model-sys/struct_compat.hpp"
#include "model-sys/menu.hpp"
#include <iostream>
#include <memory>
#include <stdint.h>
#include <string>
#include <vector>
#include <map>
#include <functional>
class Logging;
class Session;
typedef std::shared_ptr<Session> session_ptr;
/**
* @class MenuSystem
* @author Michael Griffin
* @date 10/11/2016
* @file menu_system.hpp
* @brief Main Menu System State Handles Core Loop
*/
class MenuSystem
: public StateBase
, public MenuBase
{
public:
explicit MenuSystem(session_ptr session_data);
virtual ~MenuSystem() override;
virtual void update(const std::string &character_buffer, const bool &is_utf8) override;
virtual bool onEnter() override;
virtual bool onExit() override;
virtual std::string getStateID() const override
{
return m_stateID;
}
Logging &m_log;
static const std::string m_stateID;
std::vector<std::string> m_system_fallback;
// handle to form interface.
//form_manager_ptr m_form_manager;
// Dynamic Map of all Menu Option Command functions
typedef std::function< bool(const MenuOption & option)> CommandFuncType;
typedef std::map<char, CommandFuncType> MappedCommandFunctions;
// Holds map of Menu Option Commands for quick lookup and execution
MappedCommandFunctions m_menu_command_functions;
/**
* @brief Control Commands
* @param option
*/
bool menuOptionsControlCommands(const MenuOption &option);
/**
* @brief MultiNode Commands
* @param option
*/
bool menuOptionsMultiNodeCommands(const MenuOption &option);
/**
* @brief Matrix Commands
* @param option
*/
bool menuOptionsMatrixCommands(const MenuOption &option);
/**
* @brief Global New Scan Commands
* @param option
*/
bool menuOptionsGlobalNewScanCommands(const MenuOption &option);
/**
* @brief Main Menu Commands
* @param option
*/
bool menuOptionsMainMenuCommands(const MenuOption &option);
/**
* @brief Door Commands
* @param option
*/
bool menuOptionsDoorCommands(const MenuOption &option);
/**
* @brief Sysop Commands
* @param option
*/
bool menuOptionsSysopCommands(const MenuOption &option);
/**
* @brief New User Voting Commands
* @param option
*/
bool menuOptionsNewUserVotingCommands(const MenuOption &option);
/**
* @brief Conference Editor Commands
* @param option
*/
bool menuOptionsConferenceEditorCommands(const MenuOption &option);
/**
* @brief Data Area Commands
* @param option
*/
bool menuOptionsDataAreaCommands(const MenuOption &option);
/**
* @brief Email Commands
* @param option
*/
bool menuOptionsEmailCommands(const MenuOption &option);
/**
* @brief File Commands
* @param option
*/
bool menuOptionsFileCommands(const MenuOption &option);
/**
* @brief Message Commands
* @param option
*/
bool menuOptionsMessageCommands(const MenuOption &option);
/**
* @brief Join Conference Commands
* @param option
*/
bool menuOptionsJoinConference(const MenuOption &option);
/**
* @brief QWK Mail Commands
* @param option
*/
bool menuOptionsQWKMailCommands(const MenuOption &option);
/**
* @brief Top 10 Listing Commands
* @param option
*/
bool menuOptionsTopTenListingCommands(const MenuOption &option);
/**
* @brief Message Base Sponsor Commands
* @param option
*/
bool menuOptionsMessageBaseSponsorCommands(const MenuOption &option);
/**
* @brief File Base Sponsor Commands
* @param option
*/
bool menuOptionsFileBaseSponsorCommands(const MenuOption &option);
/**
* @brief Voting Commands
* @param option
*/
bool menuOptionsVotingCommands(const MenuOption &option);
/**
* @brief Color Setting Commands
* @param option
*/
bool menuOptionsColorSettingCommands(const MenuOption &option);
/**
* @brief Process Command Keys passed from menu selection (Callback)
* @param option
*/
bool menuOptionsCallback(const MenuOption &option);
/**
* @brief Resets the Menu Input Method in the Function Array
* @param index
*/
void resetMenuInputIndex(int index);
/**
* @brief Startup External (Door / Script Process)
* @param cmdline
*/
void startupExternalProcess(const std::string &cmdline);
// Each system will have it's own module that is allocated and pushed to the
// m_module container to easily push and pop from the stack.
/**
* @brief Clears All Modules
*/
void clearAllModules();
/**
* @brief Exists and Shuts down the current module
*/
void shutdownModule();
/**
* @brief Exists and Shuts down the current module
*/
void startupModule(const module_ptr &module);
/**
* @brief Starts up Logon Module
*/
void startupModulePreLogon();
/**
* @brief Starts up Logon Module
*/
void startupModuleLogon();
/**
* @brief Starts up Signup Module
*/
void startupModuleSignup();
/**
* @brief Starts up Menu Editor
*/
void startupModuleMenuEditor();
/**
* @brief Startup the User Editor Module
*/
void startupModuleUserEditor();
/**
* @brief Startup the Level Editor Module
*/
void startupModuleLevelEditor();
/**
* @brief Startup the Full Screen Message Editor Module
*/
void startupModuleMessageEditor();
/**
* @brief Handles Input for Login and PreLogin Sequences.
* @param character_buffer
* @param is_utf8
*/
void handleLoginInputSystem(const std::string &character_buffer, const bool &is_utf8);
/**
* @brief Handles parsing input for PreLogon current module.
*/
void modulePreLogonInput(const std::string &character_buffer, const bool &is_utf8);
/**
* @brief Handles parsing input for Logon current module.
*/
void moduleLogonInput(const std::string &character_buffer, const bool &is_utf8);
/**
* @brief Handles parsing input for current module.
*/
void moduleInput(const std::string &character_buffer, const bool &is_utf8);
};
#endif // MENU_SYSTEM_HPP