1 #ifndef XGUI_OperationMgr_H
2 #define XGUI_OperationMgr_H
6 #include <ModuleBase_Operation.h>
11 /**\class XGUI_OperationMgr
13 * \brief Operation manager. Servers to manupulate to the workshop operations. Contains a stack
14 * of started operations. In simple case, if only one operration is started, the stack contains
15 * one operation. It is possible for some kind of operations to start them above already
16 * started one. In that case, the previous active operation becames suspended, a new one - active.
17 * The new operation is added to the top of the stack. Then it is finished, it is removed from
18 * the stack and the previous operation is activated.
20 class XGUI_EXPORT XGUI_OperationMgr : public QObject
25 /// \param theParent the parent
26 XGUI_OperationMgr(QObject* theParent);
28 virtual ~XGUI_OperationMgr();
30 /// Returns the current operation or NULL
31 /// \return the current operation
32 ModuleBase_Operation* currentOperation() const;
33 /// Sets the current operation or NULL
34 /// \return the current operation
35 bool startOperation(ModuleBase_Operation* theOperation);
37 void commitCurrentOperation();
40 void operationStarted();
41 void operationStopped(ModuleBase_Operation* theOperation);
44 bool canStartOperation(ModuleBase_Operation* theOperation);
47 void onOperationStopped();
50 typedef QList<ModuleBase_Operation*> Operations; ///< definition for a list of operations
51 Operations myOperations; ///< a stack of started operations. The active operation is on top,
52 // others are suspended and started by the active is finished