Gui::CommandManager Class Reference

The CommandManager class This class manage all available commands in FreeCAD. More...

#include <Command.h>

List of all members.

Public Member Functions

void addCommand (Command *pCom)
 Insert a new command into the manager.
bool addTo (const char *Name, QWidget *pcWidget)
 Adds the given command to a given widget.
 CommandManager ()
 Construction.
std::vector< Command * > getAllCommands (void) const
 Returns all commands registered in the manager delivers a vector of all comands.
CommandgetCommandByName (const char *sName) const
 Returns the command registered in the manager with the name sName If nothing is found it returns a null pointer.
const std::map< std::string,
Command * > & 
getCommands () const
 method is OBSOLET use GetModuleCommands() or GetAllCommands()
std::vector< Command * > getGroupCommands (const char *sGrpName) const
 Returns all commands of a group delivers a vector of all comands in the given group.
std::vector< Command * > getModuleCommands (const char *sModName) const
 Returns all commands of a special App Module delivers a vector of all comands in the given application module.
void removeCommand (Command *pCom)
 Remove a command from the manager.
void runCommandByName (const char *sName) const
 Runs the command.
void testActive (void)
 get frequently called by the AppWnd to check the commands are active.
 ~CommandManager ()
 Destruction.

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

Definition at line 412 of file Command.h.


Constructor & Destructor Documentation

CommandManager::CommandManager (  ) 

Construction.

Definition at line 844 of file Gui/Command.cpp.

CommandManager::~CommandManager (  ) 

Destruction.

Definition at line 848 of file Gui/Command.cpp.


Member Function Documentation

void CommandManager::addCommand ( Command pCom  ) 
bool CommandManager::addTo ( const char *  Name,
QWidget *  pcWidget 
)

Adds the given command to a given widget.

Definition at line 874 of file Gui/Command.cpp.

References Gui::Command::addTo(), and Base::Console().

Referenced by Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::ToolBoxManager::setup(), and Gui::ToolBarManager::setup().

std::vector< Command * > CommandManager::getAllCommands ( void   )  const

Returns all commands registered in the manager delivers a vector of all comands.

If you intereted in commands of of a special app module use GetModuleCommands()

See also:
Command

Definition at line 904 of file Gui/Command.cpp.

Referenced by Gui::MainWindow::changeEvent(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonResetAll_clicked(), and Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged().

Command * CommandManager::getCommandByName ( const char *  sName  )  const
const std::map<std::string, Command*>& Gui::CommandManager::getCommands (  )  const [inline]
std::vector< Command * > CommandManager::getGroupCommands ( const char *  sGrpName  )  const
std::vector< Command * > CommandManager::getModuleCommands ( const char *  sModName  )  const

Returns all commands of a special App Module delivers a vector of all comands in the given application module.

When no name is given the standard commands (build in ) are returned.

See also:
Command

Definition at line 892 of file Gui/Command.cpp.

void CommandManager::removeCommand ( Command pCom  ) 

Remove a command from the manager.

Definition at line 858 of file Gui/Command.cpp.

References Gui::Command::getName().

Referenced by Gui::Dialog::DlgCustomActionsImp::on_buttonRemoveAction_clicked().

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

Runs the command.

Definition at line 933 of file Gui/Command.cpp.

References getCommandByName(), and Gui::Command::invoke().

Referenced by Gui::MainWindow::event().

void CommandManager::testActive ( void   ) 

get frequently called by the AppWnd to check the commands are active.

Definition at line 941 of file Gui/Command.cpp.


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:59 2011 for FreeCAD by  doxygen 1.6.1