]> Shamusworld >> Repos - architektonas/blob - src/mainapp/commands.h
05d84c96ebad66772e9d46db73df339fee561d59
[architektonas] / src / mainapp / commands.h
1 #ifndef __COMMANDS_H__
2 #define __COMMANDS_H__
3
4 #include <QtCore>
5 #include "enums.h"
6
7 #define COMMANDS Commands::instance()
8
9 /**
10  * Class which holds all commands for the command line. This
11  * is separated in this module to alow the use of different
12  * languages for the gui and the command interface.
13  * Implemented as singleton.
14  *
15  * @author Andrew Mustun
16  */
17 class Commands: public QObject
18 {
19         public:
20                 QStringList complete(const QString & cmd);
21                 RS2::ActionType cmdToAction(const QString & cmd);
22                 RS2::ActionType keycodeToAction(const QString & code);
23
24                 // Class methods
25                 static Commands * instance();
26                 static QString command(const QString & cmd);
27                 static bool checkCommand(const QString & cmd, const QString & str,
28                         RS2::ActionType action = RS2::ActionNone);
29                 static QString msgAvailableCommands();
30
31         protected:
32                 // Class variable
33                 static Commands * uniqueInstance;
34
35         private:
36                 Commands();
37                 ~Commands();
38 //              Q3Dict<RS2::ActionType> mainCommands;
39 //              Q3Dict<RS2::ActionType> shortCommands;
40                 QMultiHash<QString, RS2::ActionType *> mainCommands;
41                 QMultiHash<QString, RS2::ActionType *> shortCommands;
42 };
43
44 #endif  // __COMMANDS_H__