]> Shamusworld >> Repos - architektonas/blob - src/mainapp/commands.h
Fixed problem with MDI activation.
[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 is separated in
11  * this module to alow the use of different languages for the GUI and the
12  * command interface. Implemented as singleton.
13  *
14  * @author Andrew Mustun
15  */
16 class Commands: public QObject
17 {
18         public:
19                 QStringList complete(const QString & cmd);
20                 RS2::ActionType cmdToAction(const QString & cmd);
21                 RS2::ActionType keycodeToAction(const QString & code);
22
23                 // Class methods
24                 static Commands * instance();
25                 static QString command(const QString & cmd);
26                 static bool checkCommand(const QString & cmd, const QString & str,
27                         RS2::ActionType action = RS2::ActionNone);
28                 static QString msgAvailableCommands();
29
30         protected:
31                 // Class variable
32                 static Commands * uniqueInstance;
33
34         private:
35                 Commands();
36                 ~Commands();
37                 QMultiHash<QString, RS2::ActionType *> mainCommands;
38                 QMultiHash<QString, RS2::ActionType *> shortCommands;
39 };
40
41 #endif  // __COMMANDS_H__