]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_OperationMgr.h
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_OperationMgr.h
1 #ifndef XGUI_OperationMgr_H
2 #define XGUI_OperationMgr_H
3
4 #include "XGUI.h"
5
6 #include <ModuleBase_Operation.h>
7
8 #include <QList>
9 #include <QObject>
10
11 /**\class XGUI_OperationMgr
12  * \ingroup GUI
13  * \brief Operation manager. Servers to manupulate to the workshop operations. Contains a stack
14  *   of started operations and uses the upper one as a current.
15  */
16 class XGUI_EXPORT XGUI_OperationMgr : public QObject
17 {
18   Q_OBJECT
19 public:
20   XGUI_OperationMgr(QObject* theParent);
21   virtual ~XGUI_OperationMgr();
22
23   ModuleBase_Operation* currentOperation() const;
24   bool startOperation(ModuleBase_Operation* theOperation);
25
26   void commitCurrentOperation();
27
28 signals:
29   void beforeOperationStart();
30   void afterOperationStart();
31
32 protected:
33   bool canStartOperation(ModuleBase_Operation* theOperation);
34
35 protected slots:
36   void onOperationStopped();
37
38 private:
39   typedef QList<ModuleBase_Operation*> Operations;
40   Operations myOperations;
41 };
42
43 #endif