5 #ifndef XGUI_ACTIONSMGR_H_
6 #define XGUI_ACTIONSMGR_H_
12 #include <QStringList>
16 class XGUI_OperationMgr;
19 class XGUI_EXPORT XGUI_ActionsMgr: public QObject
24 XGUI_ActionsMgr(XGUI_Workshop* theWorkshop);
25 virtual ~XGUI_ActionsMgr();
27 //! Add a command in the manager.
28 //! Please note that nested commands in the Salome mode (No XGUI_Command, pure QActions)
29 //! won't be extracted and should be added manually using the addNestedCommands method.
30 void addCommand(QAction* theCmd);
31 //! Sets relation between the command (with given Id) and it's nested actions.
32 void addNestedCommands(const QString& theId, const QStringList& theCommands);
35 //! Update workbench actions according to OperationMgr state:
36 //! No active operations: all actions but nested are available
37 //! There is active operation: current operation + it's nested
38 //! are enabled, all the rest is disabled. All active commands is checked.
40 //! Sets all commands checked if it's operation is active.
41 void updateCheckState();
44 //! Sets all actions to isEnabled state.
45 void setAllEnabled(bool isEnabled);
46 //! Sets all nested actions to isEnabled state for the command with given ID.
47 //! If ID is empty - all nested actions will be affected.
48 void setNestedCommandsEnabled(bool isEnabled, const QString& theParent = QString());
49 //! Sets the action with theId to theChecked state.
50 void setActionChecked(const QString& theId, const bool theChecked);
51 //! Sets the action with theId to theEnabled state.
52 void setActionEnabled(const QString& theId, const bool theEnabled);
55 QMap<QString, QAction*> myActions;
56 QMap<QString, QStringList> myNestedActions;
58 XGUI_OperationMgr* myOperationMgr;
61 #endif /* XGUI_ACTIONSMGR_H_ */