[4838] | 1 | /*! |
---|
[5639] | 2 | * @file shell_command_class.h |
---|
[5068] | 3 | * Definition of a on-screen-shell |
---|
[5391] | 4 | */ |
---|
[1853] | 5 | |
---|
[5639] | 6 | #ifndef _SHELL_COMMAND_CLASS_H |
---|
| 7 | #define _SHELL_COMMAND_CLASS_H |
---|
[1853] | 8 | |
---|
[5129] | 9 | #include "base_object.h" |
---|
[5779] | 10 | #include <list> |
---|
[1853] | 11 | |
---|
[5068] | 12 | |
---|
[4838] | 13 | // FORWARD DECLARATION |
---|
[3543] | 14 | |
---|
[5161] | 15 | //////////////// |
---|
| 16 | // BASE CLASS // |
---|
| 17 | //////////////// |
---|
[5636] | 18 | class ShellCommand; |
---|
[5190] | 19 | class ShellCommandAlias; |
---|
[5170] | 20 | |
---|
| 21 | //! A class to hold all Classes that have (once) registered Commands. |
---|
| 22 | class ShellCommandClass : public BaseObject |
---|
| 23 | { |
---|
[5636] | 24 | friend class ShellCommand; |
---|
[5170] | 25 | |
---|
| 26 | public: |
---|
[5197] | 27 | /** @returns the CommandClassList */ |
---|
[5779] | 28 | static const std::list<ShellCommandClass*>* getCommandClassList() { return ShellCommandClass::commandClassList; }; |
---|
[7221] | 29 | static bool getCommandListOfClass(const std::string& className, std::list<std::string>* stringList); |
---|
| 30 | static bool getCommandListOfAlias(std::list<std::string>* aliasList); |
---|
[5190] | 31 | |
---|
[7221] | 32 | static ShellCommandClass* getCommandClass(const std::string& className); |
---|
[5171] | 33 | static void unregisterAllCommands(); |
---|
[5170] | 34 | |
---|
[7221] | 35 | static void help (const std::string& className); |
---|
[5204] | 36 | |
---|
[5170] | 37 | private: |
---|
[7221] | 38 | ShellCommandClass(const std::string& className); |
---|
[6981] | 39 | virtual ~ShellCommandClass(); |
---|
[5170] | 40 | |
---|
[7221] | 41 | static const ShellCommandClass* isRegistered(const std::string& className); |
---|
[5170] | 42 | static void initCommandClassList(); |
---|
| 43 | |
---|
| 44 | private: |
---|
[7221] | 45 | const std::string className; //!< The Name of the Class. This should match the ClassName of the Commands Class. |
---|
[5779] | 46 | long classID; //!< The classID of this Class |
---|
| 47 | std::list<ShellCommand*> commandList; //!< A list of Commands from this Class |
---|
| 48 | static std::list<ShellCommandClass*>* commandClassList; //!< A list of Classes |
---|
| 49 | static std::list<ShellCommandAlias*>* aliasList; //!< An Alias to A Command. (only for classes with one Instance) |
---|
[5170] | 50 | }; |
---|
| 51 | |
---|
[5129] | 52 | #endif /* _SHELL_COMMAND_H */ |
---|