1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
30 #include <QListIterator>
32 class SUIT_DataObject;
33 class SUIT_Application;
37 #pragma warning( disable:4251 )
40 class SUIT_EXPORT SUIT_Study : public QObject
45 SUIT_Study( SUIT_Application* );
46 virtual ~SUIT_Study();
48 virtual int id() const;
50 SUIT_DataObject* root() const;
51 virtual QString studyName() const;
52 SUIT_Application* application() const;
54 virtual bool isSaved() const;
55 virtual bool isModified() const;
56 virtual void Modified();
58 virtual void closeDocument( bool = true );
59 virtual bool openDocument( const QString& );
60 virtual bool createDocument( const QString& );
63 virtual bool saveDocumentAs( const QString& );
65 virtual void update();
67 virtual void sendChangesNotification();
69 // Operation management
70 SUIT_Operation* activeOperation() const;
71 virtual void abortAllOperations();
72 const QList<SUIT_Operation*>& operations() const;
74 virtual SUIT_Operation* blockingOperation( SUIT_Operation* ) const;
76 bool start( SUIT_Operation*, const bool check = true );
77 bool abort( SUIT_Operation* );
78 bool commit( SUIT_Operation* );
79 bool suspend( SUIT_Operation* );
80 bool resume( SUIT_Operation* );
82 virtual void restoreState(int savePoint);
85 void studyModified( SUIT_Study* );
88 virtual void setIsSaved( const bool );
89 virtual void setIsModified( const bool );
90 virtual void setRoot( SUIT_DataObject* );
91 virtual void setStudyName( const QString& );
93 virtual void operationStarted( SUIT_Operation* );
94 virtual void operationAborted( SUIT_Operation* );
95 virtual void operationStopped( SUIT_Operation* );
96 virtual void operationCommited( SUIT_Operation* );
98 virtual bool openTransaction();
99 virtual bool abortTransaction();
100 virtual bool hasTransaction() const;
101 virtual bool commitTransaction( const QString& = QString() );
104 typedef QList<SUIT_Operation*> Operations;
105 void stop( SUIT_Operation* );
109 SUIT_Application* myApp;
110 SUIT_DataObject* myRoot;
114 Operations myOperations;
115 bool myBlockChangeState;
117 friend class SUIT_Operation;
121 #pragma warning( default:4251 )