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
22 #ifndef SALOMEAPP_STUDY_H
23 #define SALOMEAPP_STUDY_H
25 #include "SalomeApp.h"
27 #include <LightApp_Study.h>
30 #pragma warning( disable:4251 )
33 #include "SALOMEDSClient.hxx"
35 class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
40 SalomeApp_Study( SUIT_Application* );
41 virtual ~SalomeApp_Study();
43 virtual int id() const;
45 virtual bool createDocument( const QString& );
46 virtual bool openDocument( const QString& );
47 virtual bool loadDocument( const QString& );
49 virtual bool saveDocument();
50 virtual bool saveDocumentAs( const QString& );
52 virtual void closeDocument(bool permanently = true);
54 virtual bool isSaved() const;
55 virtual bool isModified() const;
56 virtual void Modified();
58 virtual void addComponent ( const CAM_DataModel* dm);
60 _PTR(Study) studyDS() const;
62 virtual std::string GetTmpDir ( const char* theURL, const bool isMultiFile);
64 // to delete all references to object, whose have the same component
65 void deleteReferencesTo( _PTR( SObject ) );
67 virtual QString componentDataType( const QString& ) const;
68 virtual QString referencedToEntry( const QString& ) const;
69 virtual bool isComponent( const QString& ) const;
70 virtual void children( const QString&, QStringList& ) const;
71 virtual void components( QStringList& ) const;
73 std::vector<int> getSavePoints();
74 void removeSavePoint(int savePoint);
75 QString getNameOfSavePoint(int savePoint);
76 void setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
77 virtual std::string getVisualComponentName();
79 virtual void restoreState(int savePoint);
80 void markAsSavedIn(QString theFileName);
83 virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles );
84 virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles );
85 virtual bool saveStudyData ( const QString& theFileName );
86 virtual bool openStudyData ( const QString& theFileName );
88 virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
89 virtual void SetListOfFiles ( const char* theModuleName,
90 const std::vector<std::string> theListOfFiles);
91 virtual void RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
94 virtual void dataModelInserted( const CAM_DataModel* );
95 virtual bool openDataModel( const QString&, CAM_DataModel* );
96 void setStudyDS(const _PTR(Study)& s );
99 virtual void updateModelRoot( const CAM_DataModel* );
102 QString newStudyName() const;
105 _PTR(Study) myStudyDS;
109 #pragma warning( default:4251 )