1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
29 #include <QListIterator>
31 class SUIT_DataObject;
32 class SUIT_Application;
36 #pragma warning( disable:4251 )
39 class SUIT_EXPORT SUIT_Study : public QObject
44 SUIT_Study( SUIT_Application* );
45 virtual ~SUIT_Study();
47 virtual int id() const;
49 SUIT_DataObject* root() const;
50 QString studyName() const;
51 SUIT_Application* application() const;
53 virtual bool isSaved() const;
54 virtual bool isModified() const;
55 virtual void Modified();
57 virtual void closeDocument( bool = true );
58 virtual bool openDocument( const QString& );
59 virtual bool createDocument( const QString& );
62 virtual bool saveDocumentAs( const QString& );
64 virtual void update();
66 virtual void sendChangesNotification();
68 // Operation management
69 SUIT_Operation* activeOperation() const;
70 virtual void abortAllOperations();
71 const QList<SUIT_Operation*>& operations() const;
73 virtual SUIT_Operation* blockingOperation( SUIT_Operation* ) const;
75 bool start( SUIT_Operation*, const bool check = true );
76 bool abort( SUIT_Operation* );
77 bool commit( SUIT_Operation* );
78 bool suspend( SUIT_Operation* );
79 bool resume( SUIT_Operation* );
81 virtual void restoreState(int savePoint);
84 void studyModified( SUIT_Study* );
87 virtual void setIsSaved( const bool );
88 virtual void setIsModified( const bool );
89 virtual void setRoot( SUIT_DataObject* );
90 virtual void setStudyName( const QString& );
92 virtual void operationStarted( SUIT_Operation* );
93 virtual void operationAborted( SUIT_Operation* );
94 virtual void operationStopped( SUIT_Operation* );
95 virtual void operationCommited( SUIT_Operation* );
97 virtual bool openTransaction();
98 virtual bool abortTransaction();
99 virtual bool hasTransaction() const;
100 virtual bool commitTransaction( const QString& = QString() );
103 typedef QList<SUIT_Operation*> Operations;
104 void stop( SUIT_Operation* );
108 SUIT_Application* myApp;
109 SUIT_DataObject* myRoot;
113 Operations myOperations;
114 bool myBlockChangeState;
116 friend class SUIT_Operation;
120 #pragma warning( default:4251 )