]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_ActionsMgr.h
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / XGUI / XGUI_ActionsMgr.h
1 /*
2  * XGUI_ActionsMgr.h
3  */
4
5 #ifndef XGUI_ACTIONSMGR_H_
6 #define XGUI_ACTIONSMGR_H_
7
8 #include "XGUI.h"
9
10 #include <QObject>
11 #include <QMap>
12 #include <QStringList>
13
14 class XGUI_Command;
15 class XGUI_Workshop;
16 class QAction;
17
18 class XGUI_EXPORT XGUI_ActionsMgr: public QObject
19 {
20   Q_OBJECT
21
22 public:
23   XGUI_ActionsMgr(XGUI_Workshop* theParent);
24   virtual ~XGUI_ActionsMgr();
25
26
27   void addCommand(XGUI_Command* theCmd);
28
29   /// Register a command in SALOME mode
30   /// \param theId - string ID of the command
31   /// \param theCmd - command object
32   void addCommand(QString theId, QAction* theCmd);
33
34   void saveCommandsState();
35   void restoreCommandState();
36
37   void updateAction(const QString&);
38   void setNestedActionsEnabled(bool);
39
40 public slots:
41   void setActionsDisabled(bool isEnabled);
42
43 private:
44   QStringList myNestedActions;
45   QMap<QString, QAction*> myActions;
46   QMap<QString, bool> myActionsState;
47
48   XGUI_Workshop* myWorkshop;
49 };
50
51 #endif /* XGUI_ACTIONSMGR_H_ */