Version: 9.16.0
SUIT_Study.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef SUIT_STUDY_H
24#define SUIT_STUDY_H
25
26#include "SUIT.h"
27
28#include <QList>
29#include <QObject>
30#include <QListIterator>
31
32class SUIT_DataObject;
34class SUIT_Operation;
35
36#ifdef WIN32
37#pragma warning( disable:4251 )
38#endif
39
41{
42 Q_OBJECT
43
44public:
46 virtual ~SUIT_Study();
47
48 virtual int id() const;
49
50 SUIT_DataObject* root() const;
51 virtual QString studyName() const;
52 SUIT_Application* application() const;
53
54 virtual bool isSaved() const;
55 virtual bool isModified() const;
56 virtual void Modified();
57
58 virtual void closeDocument( bool = true );
59 virtual bool openDocument( const QString& );
60 virtual bool createDocument( const QString& );
61
62 bool saveDocument();
63 virtual bool saveDocumentAs( const QString& );
64
65 virtual void update();
66
67 virtual void sendChangesNotification();
68
69 // Autosave management
70 void setIsAutoSaving(const bool on = true);
71 bool isAutoSaving() const;
72
73 // Operation management
74 SUIT_Operation* activeOperation() const;
75 virtual void abortAllOperations();
76 const QList<SUIT_Operation*>& operations() const;
77
78 virtual SUIT_Operation* blockingOperation( SUIT_Operation* ) const;
79
80 bool start( SUIT_Operation*, const bool check = true );
81 bool abort( SUIT_Operation* );
82 bool commit( SUIT_Operation* );
83 bool suspend( SUIT_Operation* );
84 bool resume( SUIT_Operation* );
85
86 virtual void restoreState(int savePoint);
87
88signals:
90
91protected:
92 virtual void setIsSaved( const bool );
93 virtual void setIsModified( const bool );
94 virtual void setRoot( SUIT_DataObject* );
95 virtual void setStudyName( const QString& );
96
97 virtual void operationStarted( SUIT_Operation* );
98 virtual void operationAborted( SUIT_Operation* );
99 virtual void operationStopped( SUIT_Operation* );
100 virtual void operationCommited( SUIT_Operation* );
101
102 virtual bool openTransaction();
103 virtual bool abortTransaction();
104 virtual bool hasTransaction() const;
105 virtual bool commitTransaction( const QString& = QString() );
106
107private:
109 void stop( SUIT_Operation* );
110
111private:
112 int myId;
115 QString myName;
120 bool myIsAutoSaving; // whether the current study is being saved automatically
121
122 friend class SUIT_Operation;
123};
124
125//******************************************************
126
127#ifdef WIN32
128#pragma warning( default:4251 )
129#endif
130
131#endif
#define SUIT_EXPORT
Definition: SUIT.h:36
For more information see QT documentation.
Definition: SUIT_Application.h:61
Data object representing the data instance in the tree-like hierarchy.
Definition: SUIT_DataObject.h:49
Base class for all operations.
Definition: SUIT_Operation.h:56
Definition: SUIT_Study.h:41
bool myIsSaved
Definition: SUIT_Study.h:116
QString myName
Definition: SUIT_Study.h:115
bool myBlockChangeState
Definition: SUIT_Study.h:119
Operations myOperations
Definition: SUIT_Study.h:118
bool myIsAutoSaving
Definition: SUIT_Study.h:120
int myId
Definition: SUIT_Study.h:112
SUIT_DataObject * myRoot
Definition: SUIT_Study.h:114
bool myIsModified
Definition: SUIT_Study.h:117
QList< SUIT_Operation * > Operations
Definition: SUIT_Study.h:108
SUIT_Application * myApp
Definition: SUIT_Study.h:113
void studyModified(SUIT_Study *)