FreeCAD C++
Public Member Functions | List of all members
Gui::CommandManager Class Reference

#include <Gui/Command.h>

Detailed Description

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.

See also
Command
Author
Jürgen Riegel

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
 
CommandgetCommandByName (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.
 

Member Function Documentation

◆ getAllCommands()

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()

See also
Command

◆ getCommandByName()

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

See also
Command

◆ getGroupCommands()

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.

◆ getModuleCommands()

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.

See also
Command

◆ runCommandByName()

void Gui::CommandManager::runCommandByName ( const char *  sName) const

Runs the command