Base class for all operations Base class for all operations (see SUIT_Operation for more description)
#include <LightApp_Operation.h>

Public Types | |
| enum | OperationState { Waiting, Running, Suspended } |
| enum | ExecStatus { Rejected, Accepted } |
| enum | Flags { None = 0x00, Transaction = 0x01 } |
Public Slots | |
| void | start () |
| Starts operation. | |
| void | abort () |
| Aborts operation. | |
| void | commit () |
| Commits operation. | |
| void | resume () |
| Resumes operation. | |
| void | suspend () |
| Suspend operation. | |
Signals | |
| void | started (SUIT_Operation *) |
| void | aborted (SUIT_Operation *) |
| void | committed (SUIT_Operation *) |
| void | stopped (SUIT_Operation *) |
| void | resumed (SUIT_Operation *) |
| void | suspended (SUIT_Operation *) |
| void | callSlot () |
Public Member Functions | |
| LightApp_Operation () | |
| Constructor. | |
| virtual | ~LightApp_Operation () |
| Destructor. | |
| virtual void | setModule (LightApp_Module *) |
| Sets module of operation. | |
| LightApp_Module * | module () const |
| Gets module of operation. | |
| bool | isAutoResumed () const |
| Gets autoresume property. | |
| virtual LightApp_Dialog * | dlg () const |
| Gets dialog. | |
| OperationState | state () const |
| Gets state of operation. | |
| bool | isActive () const |
| Verifies whether operation is an active for study. | |
| bool | isRunning () const |
| Verifies whether operation is an runned one (state()==Running) | |
| SUIT_Study * | study () const |
| Returns operation study. | |
| virtual void | setStudy (SUIT_Study *theStudy) |
| Sets operation study. | |
| SUIT_Application * | application () const |
| Gets application. | |
| virtual void | setApplication (SUIT_Application *theApp) |
| Sets application. | |
| virtual bool | isValid (SUIT_Operation *theOtherOp) const |
| Verifies whether given operator is valid for this one. | |
| virtual bool | isGranted () const |
| Verifies whether this operator can be always started above any already runnig one. | |
| bool | setSlot (const QObject *theReceiver, const char *theSlot) |
| Sets slot which is called when operation is started. | |
| void | setFlags (const int) |
| Sets the flags of operation. | |
| void | clearFlags (const int) |
| Clears the flags of operation. | |
| bool | testFlags (const int) const |
| Test the flags of operation. | |
| virtual QString | operationName () const |
| Name of the operation. | |
| int | execStatus () const |
| Gets execution status. | |
Protected Member Functions | |
| virtual void | startOperation () |
| Performs actions needed for starting operation. | |
| virtual void | suspendOperation () |
| Performs actions needed for suspending operation. | |
| virtual void | resumeOperation () |
| Enable dialog of operation. | |
| virtual void | abortOperation () |
| Performs actions needed for aborting operation. | |
| virtual void | commitOperation () |
| Performs actions needed for committing operation. | |
| virtual void | setDialogActive (const bool) |
| Activate/Deactivate dialog of operation. | |
| virtual void | activateSelection () |
| Activates selection. | |
| virtual void | selectionDone () |
| Virtual method called when selection is changed. | |
| SUIT_Desktop * | desktop () const |
| Gets desktop of operation. | |
| SUIT_Operation * | activeOperation () const |
| Gets active operation. | |
| LightApp_SelectionMgr * | selectionMgr () const |
| Gets selection manager. | |
| void | update (const int) |
| Update object browser or/and viewer etc. | |
| void | setAutoResumed (const bool) |
| Sets autoresume property. | |
| void | start (SUIT_Operation *, const bool=false) |
| Starts operator above this one. | |
| virtual bool | isReadyToStart () const |
| Verifies whether operator is ready to start. | |
| virtual void | stopOperation () |
| Virtual method called when operation is started. | |
| virtual bool | openTransaction () |
| Opens transaction for data modifications. | |
| virtual bool | abortTransaction () |
| Aborts transaction and all performed data modifications. | |
| virtual bool | hasTransaction () const |
| Returns TRUE if transaction is opened. | |
| virtual bool | commitTransaction (const QString &=QString()) |
| Commits transaction and all performed data modifications. | |
| void | setExecStatus (const int) |
| Sets execution status. | |
| void | setState (const OperationState) |
| Sets state of operation. | |
Private Slots | |
| virtual void | onSelectionDone () |
| Call selectionDone() method. | |
Private Attributes | |
| LightApp_Module * | myModule |
| bool | myIsAutoResumed |
enum SUIT_Operation::OperationState [inherited] |
enum SUIT_Operation::ExecStatus [inherited] |
Enum describes execution status of operation. Execution status often used after ending work of operation which was started from this one. In this case this operation can ask previously started operation whether it finished successfully.
enum SUIT_Operation::Flags [inherited] |
| LightApp_Operation::LightApp_Operation | ( | ) |
Constructor sets myModule in NULL and myIsAutoResumed in TRUE
| LightApp_Operation::~LightApp_Operation | ( | ) | [virtual] |
Destructor does nothing
| void LightApp_Operation::setModule | ( | LightApp_Module * | theModule | ) | [virtual] |
| theModule | - module to be set |
Sets pointer to the module. It is strongly recomended to set valid pointer on the module before start of operation
References SUIT_Operation.application(), CAM_Module.application(), myModule, SUIT_Operation.setApplication(), and SUIT_Operation.setStudy().
| LightApp_Module * LightApp_Operation::module | ( | ) | const |
Gets pointer to the module or NULL if module was not set. It is strongly recomended to set valid pointer on the module before start of operation
References myModule.
| bool LightApp_Operation::isAutoResumed | ( | ) | const |
Autoresume property is used during automatic resuming operation. If operation is suspended and cursor is moved above dialog of the operation then operation is resumed automatically (if possible). It can be resumed only program call otherwise (see LightApp_SwitchOp for more description). This property is TRUE by default and may be changed with setAutoResumed() method call.
References myIsAutoResumed.
| LightApp_Dialog * LightApp_Operation::dlg | ( | ) | const [virtual] |
This method should be redefined in derived classes if they use dialogs. If this function returns pointer to dialog then dialog will be correctly
| void LightApp_Operation::startOperation | ( | ) | [protected, virtual] |
Virtual method redefined from the base class. Connect signal of selection manager to onSelectionDone() slot
Reimplemented from SUIT_Operation.
Reimplemented in LightApp_ShowHideOp.
References onSelectionDone(), selectionMgr(), and setDialogActive().
| void LightApp_Operation::suspendOperation | ( | ) | [protected, virtual] |
Virtual method redefined from the base class. This implementation calls corresponding method of base class and cals setDialogActive( false )
Reimplemented from SUIT_Operation.
References setDialogActive().
| void LightApp_Operation::resumeOperation | ( | ) | [protected, virtual] |
Virtual method redefined from the base class. Enable dialog if it was desabled (in suspend method) and activate selection
Reimplemented from SUIT_Operation.
References setDialogActive().
| void LightApp_Operation::abortOperation | ( | ) | [protected, virtual] |
Virtual method redefined from the base class calls corresponding method of base class and hides dialog box (if it is exists), disconnect slots from selection manager
Reimplemented from SUIT_Operation.
References dlg(), onSelectionDone(), selectionMgr(), and setDialogActive().
| void LightApp_Operation::commitOperation | ( | ) | [protected, virtual] |
Virtual method redefined from the base class calls corresponding method of base class and hides dialog box (if it is exists), disconnect slots from selection manager
Reimplemented from SUIT_Operation.
References dlg(), onSelectionDone(), selectionMgr(), and setDialogActive().
| void LightApp_Operation::setDialogActive | ( | const bool | active | ) | [protected, virtual] |
| active | - State of the dialog to be set |
Activate/Deactivate dialog of operation. This method called from startOperation(), suspendOperation() ones and so on
References activateSelection(), and dlg().
| void LightApp_Operation::activateSelection | ( | ) | [protected, virtual] |
Virtual method should be redefined in derived classes if they use own selection modes (different from default)
| void LightApp_Operation::selectionDone | ( | ) | [protected, virtual] |
Virtual method should be redefined in derived classes if they works with selection to provide reaction on the change of selection
| SUIT_Desktop * LightApp_Operation::desktop | ( | ) | const [protected] |
Gets pointer to the desktop or NULL if application was not set. It is strongly recomended to set valid pointer on the application before start of operation
References SUIT_Operation.application(), and SUIT_Application.desktop().
| SUIT_Operation * LightApp_Operation::activeOperation | ( | ) | const [protected] |
This method provided for convinience calls SUIT_Study.activeOperation() one
References SUIT_Study.activeOperation(), and SUIT_Operation.study().
| LightApp_SelectionMgr * LightApp_Operation::selectionMgr | ( | ) | const [protected] |
This method provided for convinience calls LightApp_Application.selectionMgr() one
References SUIT_Operation.application().
| void LightApp_Operation::update | ( | const int | flags | ) | [protected] |
| flags | - update flags |
This method provided for convinience calls LightApp_Module.update() one (see LightApp_Module.update() for more description)
References myModule, and LightApp_Module.update().
| void LightApp_Operation::setAutoResumed | ( | const bool | on | ) | [protected] |
| on | - Value to be set |
Sets autoresume property (see isAutoResumed() for more description)
References myIsAutoResumed.
| void LightApp_Operation::onSelectionDone | ( | ) | [private, virtual, slot] |
Call selectionDone() method if operator is an active one (see selectionDone() for more description )
References SUIT_Operation.isActive(), and selectionDone().
| SUIT_Operation::OperationState SUIT_Operation::state | ( | ) | const [inherited] |
Gets state of operation (see OperationState enumeration)
References SUIT_Operation.myState.
| bool SUIT_Operation::isActive | ( | ) | const [inherited] |
Verifies whether operation is an active on. Returns TRUE if this operator is active for study
References SUIT_Study.activeOperation(), and SUIT_Operation.study().
| bool SUIT_Operation::isRunning | ( | ) | const [inherited] |
Verifies whether operation is an running. Returns TRUE if state of operator is Running
References SUIT_Operation.Running, and SUIT_Operation.state().
| SUIT_Study * SUIT_Operation::study | ( | ) | const [inherited] |
Get study corresponding to this operation i.e. study which starts this operation.
References SUIT_Operation.myStudy.
| void SUIT_Operation::setStudy | ( | SUIT_Study * | theStudy | ) | [virtual, inherited] |
| theStudy | - study corresponding to this operation |
Sets study corresponding to this operation i.e. study which starts this operation.
References SUIT_Operation.myStudy.
| SUIT_Application * SUIT_Operation::application | ( | ) | const [inherited] |
| void SUIT_Operation::setApplication | ( | SUIT_Application * | theApp | ) | [virtual, inherited] |
| theApp | - application for this operation |
Gets application for this operation
References SUIT_Operation.myApp.
| bool SUIT_Operation::isValid | ( | SUIT_Operation * | theOtherOp | ) | const [virtual, inherited] |
| theOtherOp | - other operation |
Verifies whether given operator is valid for this one (i.e. can be started "above" this operator)
| bool SUIT_Operation::isGranted | ( | ) | const [virtual, inherited] |
This method must be redefined in derived operation if operation of derived class must be always can start above any launched one. Default implementation returns FALSE, so it is being checked for IsValid, but some operations may overload IsGranted() In this case they will always start, no matter what operation is running.
| bool SUIT_Operation::setSlot | ( | const QObject * | theReceiver, |
| const char * | theSlot | ||
| ) | [inherited] |
| theReceiver | - object containing slot |
| theSlot | - slot of theReceiver object |
Sets slot which is called when operation is started. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method
References SUIT_Operation.callSlot().
| void SUIT_Operation::setFlags | ( | const int | f | ) | [inherited] |
| f | - flags of operation to be set |
Sets flags of operation (see Flags enumeration)
References SUIT_Operation.myFlags.
| void SUIT_Operation::clearFlags | ( | const int | f | ) | [inherited] |
| f | - flags of operation to be cleared |
Clears flags of operation (see Flags enumeration)
References SUIT_Operation.myFlags.
| bool SUIT_Operation::testFlags | ( | const int | f | ) | const [inherited] |
| f | - flags of operation to be tested |
Returns TRUE if the specified flags setted in the operation (see Flags enumeration)
References SUIT_Operation.myFlags.
| QString SUIT_Operation::operationName | ( | ) | const [virtual, inherited] |
Returns string name of the operation. This name will be used for automatically commited transaction.
| int SUIT_Operation::execStatus | ( | ) | const [inherited] |
| void SUIT_Operation.started | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.aborted | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.committed | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.stopped | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.resumed | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.suspended | ( | SUIT_Operation * | ) | [signal, inherited] |
| void SUIT_Operation.callSlot | ( | ) | [signal, inherited] |
| void SUIT_Operation::start | ( | ) | [slot, inherited] |
Public slot. Verifies whether operation can be started and starts operation. This slot is not virtual and cannot be redefined. Redefine startOperation method to change behavior of operation. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method instead.
References SUIT_Study.start(), SUIT_Operation.started(), SUIT_Operation.startOperation(), and SUIT_Operation.study().
| void SUIT_Operation::start | ( | SUIT_Operation * | op, |
| const bool | check = false |
||
| ) | [protected, inherited] |
| theOp | - operation to be started |
Start operator above this one. Use this method if you want to call other operator from this one
References SUIT_Operation.abort(), SUIT_Operation.start(), SUIT_Study.start(), SUIT_Operation.stopped(), and SUIT_Operation.study().
| void SUIT_Operation::abort | ( | ) | [slot, inherited] |
Public slot. Aborts operation. This slot is not virtual and cannot be redefined. Redefine abortOperation method to change behavior of operation instead
References SUIT_Study.abort(), SUIT_Operation.aborted(), SUIT_Operation.abortOperation(), SUIT_Operation.myState, SUIT_Operation.stopOperation(), SUIT_Operation.stopped(), SUIT_Operation.study(), and SUIT_Operation.Waiting.
| void SUIT_Operation::commit | ( | ) | [slot, inherited] |
Public slot. Commits operation. This slot is not virtual and cannot be redefined. Redefine commitOperation method to change behavior of operation instead
References SUIT_Study.commit(), SUIT_Operation.commitOperation(), SUIT_Operation.committed(), SUIT_Operation.myState, SUIT_Operation.stopOperation(), SUIT_Operation.stopped(), SUIT_Operation.study(), and SUIT_Operation.Waiting.
| void SUIT_Operation::resume | ( | ) | [slot, inherited] |
Public slot. Resumes operation. This slot is called when operation is resumed after previous suspending. This slot is not virtual and cannot be redefined. Redefine resumeOperation method to change behavior of operation instead
References SUIT_Operation.myState, SUIT_Study.resume(), SUIT_Operation.resumed(), SUIT_Operation.resumeOperation(), SUIT_Operation.Running, and SUIT_Operation.study().
| void SUIT_Operation::suspend | ( | ) | [slot, inherited] |
Public slot. Suspend operation. This slot is called when operation is suspended (for starting other one, for example) This slot is not virtual and cannot be redefined. Redefine suspendOperation method to change behavior of operation instead
References SUIT_Operation.myState, SUIT_Operation.study(), SUIT_Study.suspend(), SUIT_Operation.suspended(), SUIT_Operation.Suspended, and SUIT_Operation.suspendOperation().
| bool SUIT_Operation::isReadyToStart | ( | ) | const [protected, virtual, inherited] |
Default implementation returns TRUE. Redefine this method to add own verifications
| void SUIT_Operation::stopOperation | ( | ) | [protected, virtual, inherited] |
Virtual method called when operation stopped - comitted or aborted.
| bool SUIT_Operation::openTransaction | ( | ) | [protected, virtual, inherited] |
References SUIT_Study.openTransaction(), and SUIT_Operation.study().
| bool SUIT_Operation::abortTransaction | ( | ) | [protected, virtual, inherited] |
References SUIT_Study.abortTransaction(), and SUIT_Operation.study().
| bool SUIT_Operation::hasTransaction | ( | ) | const [protected, virtual, inherited] |
References SUIT_Study.hasTransaction(), and SUIT_Operation.study().
| bool SUIT_Operation::commitTransaction | ( | const QString & | name = QString() | ) | [protected, virtual, inherited] |
References SUIT_Study.commitTransaction(), and SUIT_Operation.study().
| void SUIT_Operation::setExecStatus | ( | const int | theVal | ) | [protected, inherited] |
| theStatus | - execution status |
Sets myExecStatus to the given value
References SUIT_Operation.myExecStatus.
| void SUIT_Operation::setState | ( | const OperationState | theState | ) | [protected, inherited] |
| theState | - state of operation to be set |
Sets state of operation (see OperationState enumeration)
References SUIT_Operation.myState.
LightApp_Module* LightApp_Operation.myModule [private] |
bool LightApp_Operation.myIsAutoResumed [private] |