Salome HOME
Copyrights update
[modules/gui.git] / src / SalomeApp / SalomeApp_Study.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
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.
7 // 
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/
18 //
19 #ifndef SALOMEAPP_STUDY_H
20 #define SALOMEAPP_STUDY_H
21
22 #include "SalomeApp.h"
23
24 #include <LightApp_Study.h>
25
26 #ifdef WIN32
27 #pragma warning( disable:4251 )
28 #endif
29
30 #include "SALOMEDSClient.hxx"
31
32 class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
33 {
34   Q_OBJECT
35
36 public:
37   SalomeApp_Study( SUIT_Application* );
38   virtual ~SalomeApp_Study();
39
40   virtual int         id() const;
41
42   virtual void        createDocument();
43   virtual bool        openDocument( const QString& );
44   virtual bool        loadDocument( const QString& );
45
46   virtual bool        saveDocument();
47   virtual bool        saveDocumentAs( const QString& );
48
49   virtual void        closeDocument(bool permanently = true);
50
51   virtual bool        isSaved()  const;
52   virtual bool        isModified() const;
53
54   virtual void        addComponent   ( const CAM_DataModel* dm);
55
56   _PTR(Study)         studyDS() const;
57
58   virtual std::string GetTmpDir      ( const char* theURL, const bool  isMultiFile);
59
60   // to delete all references to object, whose have the same component
61   void                deleteReferencesTo( _PTR( SObject ) );
62
63   virtual QString     componentDataType( const QString& ) const;
64   virtual QString     referencedToEntry( const QString& ) const;
65   virtual bool        isComponent( const QString& ) const;
66   virtual void        children( const QString&, QStringList& ) const;
67   virtual void        components( QStringList& ) const;
68
69 protected:
70   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
71   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
72   virtual bool        saveStudyData  (  const QString& theFileName );
73   virtual bool        openStudyData  ( const QString& theFileName );
74
75   virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
76   virtual void        SetListOfFiles ( const char* theModuleName,
77                                        const std::vector<std::string> theListOfFiles);
78   virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
79
80 protected:
81   virtual void        dataModelInserted( const CAM_DataModel* );
82   virtual bool        openDataModel( const QString&, CAM_DataModel* );
83   void                setStudyDS(const _PTR(Study)& s );
84
85 private:
86   QString             newStudyName() const;
87
88 private:
89   _PTR(Study)         myStudyDS;
90 };
91
92 #ifdef WIN32
93 #pragma warning( default:4251 )
94 #endif
95
96 #endif