1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
24 #include "SUIT_Operation.h"
29 class SUIT_DataObject;
30 class SUIT_Application;
34 #pragma warning( disable:4251 )
37 class SUIT_EXPORT SUIT_Study : public QObject
42 SUIT_Study( SUIT_Application* );
43 virtual ~SUIT_Study();
45 virtual int id() const;
47 SUIT_DataObject* root() const;
48 QString studyName() const;
49 SUIT_Application* application() const;
51 virtual bool isSaved() const;
52 virtual bool isModified() const;
54 virtual void createDocument();
55 virtual void closeDocument( bool = true );
56 virtual bool openDocument( const QString& );
59 virtual bool saveDocumentAs( const QString& );
61 virtual void update();
63 virtual void sendChangesNotification();
65 // Operation management
66 SUIT_Operation* activeOperation() const;
67 virtual void abortAllOperations();
68 const QPtrList<SUIT_Operation>& operations() const;
70 virtual SUIT_Operation* blockingOperation( SUIT_Operation* ) const;
72 bool start( SUIT_Operation*, const bool check = true );
73 bool abort( SUIT_Operation* );
74 bool commit( SUIT_Operation* );
75 bool suspend( SUIT_Operation* );
76 bool resume( SUIT_Operation* );
79 void studyModified( SUIT_Study* );
82 virtual void setIsSaved( const bool );
83 virtual void setIsModified( const bool );
84 virtual void setRoot( SUIT_DataObject* );
85 virtual void setStudyName( const QString& );
87 virtual void operationStarted( SUIT_Operation* );
88 virtual void operationAborted( SUIT_Operation* );
89 virtual void operationStopped( SUIT_Operation* );
90 virtual void operationCommited( SUIT_Operation* );
92 virtual bool openTransaction();
93 virtual bool abortTransaction();
94 virtual bool hasTransaction() const;
95 virtual bool commitTransaction( const QString& = QString::null );
98 typedef QPtrList<SUIT_Operation> Operations;
99 void stop( SUIT_Operation* );
103 SUIT_Application* myApp;
104 SUIT_DataObject* myRoot;
108 Operations myOperations;
109 bool myBlockChangeState;
111 friend class SUIT_Operation;
115 #pragma warning( default:4251 )