Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[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/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef SALOMEAPP_STUDY_H
20 #define SALOMEAPP_STUDY_H
21
22 #include "SalomeApp.h"
23
24 #include <LightApp_Study.h>
25 #include <string>
26
27 #ifdef WIN32
28 #pragma warning( disable:4251 )
29 #endif
30
31 #include "SALOMEDSClient.hxx"
32
33 class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
34 {
35   Q_OBJECT
36
37 public:
38   SalomeApp_Study( SUIT_Application* );
39   virtual ~SalomeApp_Study();
40
41   virtual int         id() const;
42
43   virtual void        createDocument();
44   virtual bool        openDocument( const QString& );
45   virtual bool        loadDocument( const QString& );
46
47   virtual bool        saveDocument();
48   virtual bool        saveDocumentAs( const QString& );
49
50   virtual void        closeDocument(bool permanently = true);
51
52   virtual bool        isSaved()  const;
53   virtual bool        isModified() const;
54
55   virtual void        addComponent   ( const CAM_DataModel* dm);
56
57   _PTR(Study)         studyDS() const;
58
59   virtual std::string GetTmpDir      ( const char* theURL, const bool  isMultiFile);
60
61   // to delete all references to object, whose have the same component
62   void                deleteReferencesTo( _PTR( SObject ) );
63
64   virtual QString     componentDataType( const QString& ) const;
65   virtual QString     referencedToEntry( const QString& ) const;
66   virtual bool        isComponent( const QString& ) const;
67   virtual void        children( const QString&, QStringList& ) const;
68   virtual void        components( QStringList& ) const;
69
70   std::vector<int>    getSavePoints();
71   void                removeSavePoint(int savePoint);
72   QString             getNameOfSavePoint(int savePoint);
73   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
74   virtual std::string getVisualComponentName();
75
76 protected:
77   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
78   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
79   virtual bool        saveStudyData  (  const QString& theFileName );
80   virtual bool        openStudyData  ( const QString& theFileName );
81
82   virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
83   virtual void        SetListOfFiles ( const char* theModuleName,
84                                        const std::vector<std::string> theListOfFiles);
85   virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
86
87 protected:
88   virtual void        dataModelInserted( const CAM_DataModel* );
89   virtual bool        openDataModel( const QString&, CAM_DataModel* );
90   void                setStudyDS(const _PTR(Study)& s );
91
92 protected slots:
93   virtual void        updateModelRoot( const CAM_DataModel* );
94
95 private:
96   QString             newStudyName() const;
97
98 private:
99   _PTR(Study)         myStudyDS;
100 };
101
102 #ifdef WIN32
103 #pragma warning( default:4251 )
104 #endif
105
106 #endif