class QKeyEvent;
+class ModuleBase_IWorkshop;
+
/**\class XGUI_OperationMgr
* \ingroup GUI
* \brief Operation manager. Servers to manipulate to the workshop operations. Contains a stack
public:
/// Constructor
/// \param theParent the parent
- XGUI_OperationMgr(QObject* theParent);
+ XGUI_OperationMgr(QObject* theParent, ModuleBase_IWorkshop* theWorkshop);
/// Destructor
virtual ~XGUI_OperationMgr();
+ void setWorkshop(ModuleBase_IWorkshop* theWorkshop)
+ { myWorkshop = theWorkshop; };
+
/// Returns the current operation or NULL
/// \return the current operation
ModuleBase_Operation* currentOperation() const;
/// Blocking/unblocking enabling of Ok button in property panel.
/// It is used when operation can not be validated even all attributes are valid
- void setLockValidating(bool toLock) { myIsValidationLock = toLock; }
+ void setLockValidating(bool toLock);
/// Returns state of validation locking
bool isValidationLocked() const { return myIsValidationLock; }
- /// Sets apply state to the value and emit signal about this state is changed
- /// \param theEnabled the state value
- void setApplyEnabled(const bool theEnabled);
-
/// Returns enable apply state
/// \return theEnabled a boolean value
bool isApplyEnabled() const;
- public slots:
+ /// Returns valid state of the parent operation. If the current operation is the last one
+ /// it returns the valid state of the operation
+ /// \return boolean value
+ bool isParentOperationValid() const;
+
+public slots:
/// Slot that commits the current operation.
void onCommitOperation();
/// Slot that aborts the current operation.
/// Signal is emitted after the key released click.
void keyEnterReleased();
-
protected:
+ /// Sets apply state to the value and emit signal about this state is changed
+ /// \param theEnabled the state value
+ void setApplyEnabled(const bool theEnabled);
+
/// Commits the current operatin if it is valid
bool commitOperation();
/// Slot called on operation resume
void onOperationResumed();
+ /// Slot called on operation triggered
+ void onOperationTriggered(bool theState);
+
private:
typedef QList<ModuleBase_Operation*> Operations; ///< definition for a list of operations
Operations myOperations; ///< a stack of started operations. The active operation is on top,
// others are suspended and started by the active is finished
+ /// Current workshop
+ ModuleBase_IWorkshop* myWorkshop;
+
+
/// Lock/Unlock access to Ok button in property panel
bool myIsValidationLock;
/// Lock/Unlock access to Ok button in property panel