#include <SUIT_Study.h>
Signals | |
void | studyModified (SUIT_Study *) |
Public Member Functions | |
SUIT_Study (SUIT_Application *) | |
virtual | ~SUIT_Study () |
virtual int | id () const |
SUIT_DataObject * | root () const |
virtual QString | studyName () const |
SUIT_Application * | application () const |
virtual bool | isSaved () const |
virtual bool | isModified () const |
virtual void | Modified () |
virtual void | closeDocument (bool=true) |
virtual bool | openDocument (const QString &) |
virtual bool | createDocument (const QString &) |
bool | saveDocument () |
virtual bool | saveDocumentAs (const QString &) |
virtual void | update () |
virtual void | sendChangesNotification () |
SUIT_Operation * | activeOperation () const |
virtual void | abortAllOperations () |
const QList< SUIT_Operation * > & | operations () const |
Get all started operations. More... | |
virtual SUIT_Operation * | blockingOperation (SUIT_Operation *) const |
Verifies whether operation can be activated above already started ones. More... | |
bool | start (SUIT_Operation *, const bool check=true) |
Starts operation. More... | |
bool | abort (SUIT_Operation *) |
Aborts operation. More... | |
bool | commit (SUIT_Operation *) |
Commits operation. More... | |
bool | suspend (SUIT_Operation *) |
Commits operation. More... | |
bool | resume (SUIT_Operation *) |
Resumes operation. More... | |
virtual void | restoreState (int savePoint) |
Restores the study state. More... | |
Protected Member Functions | |
virtual void | setIsSaved (const bool) |
virtual void | setIsModified (const bool) |
virtual void | setRoot (SUIT_DataObject *) |
virtual void | setStudyName (const QString &) |
virtual void | operationStarted (SUIT_Operation *) |
Perform some actions when operation starting. More... | |
virtual void | operationAborted (SUIT_Operation *) |
Perform some actions when operation aborted. More... | |
virtual void | operationStopped (SUIT_Operation *) |
Perform some actions when operation stopped. More... | |
virtual void | operationCommited (SUIT_Operation *) |
Perform some actions when operation commited. More... | |
virtual bool | openTransaction () |
Opens transaction for data modifications. More... | |
virtual bool | abortTransaction () |
Aborts transaction and all performed data modifications. More... | |
virtual bool | hasTransaction () const |
Returns true if transaction is opened. More... | |
virtual bool | commitTransaction (const QString &=QString()) |
Commits transaction and all performed data modifications. More... | |
Private Types | |
typedef QList< SUIT_Operation * > | Operations |
Private Member Functions | |
void | stop (SUIT_Operation *) |
Stops operation. More... | |
Private Attributes | |
int | myId |
SUIT_Application * | myApp |
SUIT_DataObject * | myRoot |
QString | myName |
bool | myIsSaved |
bool | myIsModified |
Operations | myOperations |
bool | myBlockChangeState |
Friends | |
class | SUIT_Operation |
Support study management. Object management. Operation management.
|
private |
SUIT_Study::SUIT_Study | ( | SUIT_Application * | app | ) |
|
virtual |
Destructor.
References myRoot.
bool SUIT_Study::abort | ( | SUIT_Operation * | theOp | ) |
theOp | - operation to be aborted |
true
if operation is aborted successfullyVerifies whether operation already started and aborts it in this case (sets execution status to Rejected and stops operation)
References SUIT_Operation::aborted(), SUIT_Operation::abortOperation(), myOperations, operationAborted(), SUIT_Operation::Rejected, SUIT_Operation::setExecStatus(), and stop().
|
virtual |
*Abort all operations.
References myBlockChangeState, and myOperations.
|
protectedvirtual |
Reimplemented in CAF_Study.
SUIT_Operation * SUIT_Study::activeOperation | ( | ) | const |
active | operation. |
References myOperations.
SUIT_Application * SUIT_Study::application | ( | ) | const |
Application. |
References myApp.
|
virtual |
theOp | - operation to be checked |
Verifies whether operation can be activated above already started ones. This method is called from SUIT_Study::start() and SUIT_Study::resume() methods.
References SUIT_Operation::isGranted(), SUIT_Operation::isValid(), and myOperations.
|
virtual |
*Close document. NOT IMPLEMENTED.
Reimplemented in LightApp_Study, SalomeApp_Study, CAF_Study, and CAM_Study.
bool SUIT_Study::commit | ( | SUIT_Operation * | theOp | ) |
theOp | - operation to be committed |
true
if operation is committed successfullyVerifies whether operation already started and commits it in this case (sets execution status to Accepted and stops operation)
References SUIT_Operation::Accepted, SUIT_Operation::commitOperation(), SUIT_Operation::committed(), myOperations, operationCommited(), SUIT_Operation::setExecStatus(), stop(), and studyModified().
|
protectedvirtual |
Reimplemented in CAF_Study.
|
virtual |
Custom document initialization to be performed
within onNewDoc() handler can be put here
Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.
|
protectedvirtual |
Reimplemented in CAF_Study.
|
virtual |
|
virtual |
\c | true - if study modified, else false . |
Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.
References myIsModified.
|
virtual |
\c | true - if study saved, else false . |
Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.
References myIsSaved.
|
virtual |
Set study modified to on.
Reimplemented in SalomeApp_Study.
References sendChangesNotification(), and setIsModified().
|
virtual |
Open document. Sets file name. return true
.
Reimplemented in LightApp_Study, CAF_Study, and SalomeApp_Study.
References myIsModified, myIsSaved, and myName.
|
protectedvirtual |
Reimplemented in CAF_Study.
|
protectedvirtual |
|
protectedvirtual |
const QList< SUIT_Operation * > & SUIT_Study::operations | ( | ) | const |
References myOperations.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Reimplemented in SalomeApp_Study.
bool SUIT_Study::resume | ( | SUIT_Operation * | theOp | ) |
theOp | - operation to be resumed |
true
if operation is aborted successfullyVerifies whether operation already started but suspended and resumesit in this case.
References blockingOperation(), myOperations, SUIT_Operation::resumed(), SUIT_Operation::resumeOperation(), SUIT_Operation::Running, SUIT_Operation::setState(), SUIT_Operation::state(), and suspend().
SUIT_DataObject * SUIT_Study::root | ( | ) | const |
root | data object. |
References myRoot.
bool SUIT_Study::saveDocument | ( | ) |
\c | true - if document saved successful, else false . |
References myName, and saveDocumentAs().
|
virtual |
Save document as fileName. Set file name.
Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.
References myIsModified, myIsSaved, and myName.
|
virtual |
Emit study modified.
References studyModified().
|
protectedvirtual |
Set study modified to on.
References myIsModified.
|
protectedvirtual |
Set study saved to on.
References myIsSaved.
|
protectedvirtual |
Set root object.
References myRoot, obj, and SUIT_DataObject::reparentChildren().
|
protectedvirtual |
Set study name.
References myName.
bool SUIT_Study::start | ( | SUIT_Operation * | theOp, |
const bool | toCheck = true |
||
) |
theOp | - operation to be started |
toCheck | - if parameters is equal true then checking performed whether all already started operations allow to start this operation above them (default value is true |
true
if operation is started, false
otherwiseVerifies whether theOp operation can be started above already started ones (if toCheck parameter is equal true
) and starts it
References activeOperation(), application(), blockingOperation(), SUIT_Operation::isReadyToStart(), myOperations, operationStarted(), SUIT_MessageBox::question(), SUIT_Operation::Rejected, SUIT_Operation::Running, SUIT_Operation::setExecStatus(), SUIT_Operation::setState(), SUIT_Operation::setStudy(), SUIT_Operation::started(), SUIT_Operation::startOperation(), SUIT_Operation::Suspended, and SUIT_Operation::suspendOperation().
|
private |
theOp | - operation to be stopped |
Stops operation. This private method is called from abort() and commit() ones to perform common actions when operation is stopped
References blockingOperation(), myOperations, operationStopped(), resume(), SUIT_Operation::setState(), SUIT_Operation::stopOperation(), SUIT_Operation::stopped(), and SUIT_Operation::Waiting.
|
signal |
|
virtual |
bool SUIT_Study::suspend | ( | SUIT_Operation * | theOp | ) |
theOp | - operation to be committed |
true
if operation is suspended successfullyVerifies whether operation already started and suspends it in this case. Operations ususlly are suspended to start other one above them.
References myOperations, SUIT_Operation::setState(), SUIT_Operation::state(), SUIT_Operation::Suspended, SUIT_Operation::suspended(), and SUIT_Operation::suspendOperation().
|
virtual |
Update study. NOT IMPLEMENTED HERE.
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |