FreeCAD C++
|
#include <Gui/Command.h>
The CommandManager class This class manage all available commands in FreeCAD. All Commands will registered here, also commands from Application modules. Also activation / deactivation, Icons Tooltips and so on are handles here. Further the Building of Toolbars and (Context) menus (connecting to a QAction) is done here.
Public Member Functions | |
CommandManager () | |
Construction. | |
~CommandManager () | |
Destruction. | |
void | addCommand (Command *pCom) |
Insert a new command into the manager. | |
void | removeCommand (Command *pCom) |
Remove a command from the manager. | |
bool | addTo (const char *Name, QWidget *pcWidget) |
Adds the given command to a given widget. | |
std::vector< Command * > | getModuleCommands (const char *sModName) const |
std::vector< Command * > | getAllCommands (void) const |
std::vector< Command * > | getGroupCommands (const char *sGrpName) const |
Command * | getCommandByName (const char *sName) const |
void | runCommandByName (const char *sName) const |
const std::map< std::string, Command * > & | getCommands () const |
method is OBSOLETE use GetModuleCommands() or GetAllCommands() | |
void | testActive (void) |
get frequently called by the AppWnd to check the commands are active. | |
std::vector<Command*> Gui::CommandManager::getAllCommands | ( | void | ) | const |
Returns all commands registered in the manager delivers a vector of all commands. If you intereted in commands of of a special app module use GetModuleCommands()
Command* Gui::CommandManager::getCommandByName | ( | const char * | sName | ) | const |
Returns the command registered in the manager with the name sName If nothing is found it returns a null pointer
std::vector<Command*> Gui::CommandManager::getGroupCommands | ( | const char * | sGrpName | ) | const |
Returns all commands of a group delivers a vector of all commands in the given group.
std::vector<Command*> Gui::CommandManager::getModuleCommands | ( | const char * | sModName | ) | const |
Returns all commands of a special App Module delivers a vector of all commands in the given application module. When no name is given the standard commands (build in ) are returned.
void Gui::CommandManager::runCommandByName | ( | const char * | sName | ) | const |
Runs the command