1 #include "SUIT_Operation.h"
3 #include "SUIT_Study.h"
4 #include "SUIT_Application.h"
6 /*! Constructor. Initialize myApp, myStudy, myState.*/
7 SUIT_Operation::SUIT_Operation( SUIT_Application* app )
16 SUIT_Operation::~SUIT_Operation()
20 /*! \retval Return myStudy.*/
21 SUIT_Study* SUIT_Operation::study() const
26 /*! \retval Return myApp*/
27 SUIT_Application* SUIT_Operation::application() const
32 /*! \retval Return myState*/
33 SUIT_Operation::OperationState SUIT_Operation::state() const
38 /*! Set started operation status*/
39 void SUIT_Operation::start()
41 myStudy = myApp->activeStudy();
44 if ( myStudy->canStartOperation( this ) )
46 if ( !isReadyToStart() )
48 myStudy->stopOperation();
59 /*! Set aborted operation status*/
60 void SUIT_Operation::abort()
63 myStudy->stopOperation();
69 /*! Set commited operation status*/
70 void SUIT_Operation::commit()
73 myStudy->stopOperation();
76 emit commited( this );
78 myStudy->sendChangesNotification();
81 /*! Set resumed operation status*/
82 void SUIT_Operation::resume()
90 /*! Set suspended operation status*/
91 void SUIT_Operation::suspend()
96 emit suspended( this );
99 /*! \retval Return true*/
100 bool SUIT_Operation::isReadyToStart()
105 /*! start operation.\n
106 * emitting callSlot() signal \n
107 * calling commit() function.
109 void SUIT_Operation::startOperation()
117 void SUIT_Operation::abortOperation()
122 void SUIT_Operation::resumeOperation()
127 void SUIT_Operation::suspendOperation()
132 void SUIT_Operation::commitOperation()
137 bool SUIT_Operation::setSlot( const QObject* theReceiver, const char* theSlot )
139 return connect( this, SIGNAL( callSlot() ), theReceiver, theSlot );
142 /*! \retval Return false*/
143 bool SUIT_Operation::isValid( SUIT_Operation* ) const
148 /*! \retval Return false*/
149 bool SUIT_Operation::isGranted() const
155 void SUIT_Operation::setStudy( SUIT_Study* s )
160 /*! Setting application.*/
161 void SUIT_Operation::setApplication( SUIT_Application* app )