Salome HOME
2e0ac32260b04ab779b93fc8e28833fd673b62fe
[modules/gui.git] / src / LightApp / LightApp_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 LIGHTAPP_STUDY_H
20 #define LIGHTAPP_STUDY_H
21
22 #include <LightApp.h>
23 #include <LightApp_Driver.h>
24
25 #include <CAM_Study.h>
26 #include <CAM_DataModel.h>
27 #include <SUIT_Study.h>
28
29 #include "string"
30 #include "vector"
31
32 class SUIT_Application;
33 class CAM_DataModel;
34
35 class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study
36 {
37   Q_OBJECT
38
39 public:
40   LightApp_Study( SUIT_Application* );
41   virtual ~LightApp_Study();
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   virtual std::string GetTmpDir      ( const char* theURL, const bool  isMultiFile );
58
59   virtual QString     componentDataType( const QString& ) const;
60   virtual QString     referencedToEntry( const QString& ) const;
61   virtual bool        isComponent( const QString& ) const;
62   virtual void        children( const QString&, QStringList& ) const;
63   virtual void        components( QStringList& ) const;
64
65 protected:
66   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
67   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
68   virtual bool        saveStudyData  ( const QString& theFileName );
69   virtual bool        openStudyData  ( const QString& theFileName );
70
71   virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
72   virtual void        SetListOfFiles ( const char* theModuleName,
73                                        const std::vector<std::string> theListOfFiles );
74
75   virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const;
76
77 protected:
78   virtual bool        openDataModel  ( const QString&, CAM_DataModel* );
79
80 signals:
81   void                saved  ( SUIT_Study* );
82   void                opened ( SUIT_Study* );
83   void                closed ( SUIT_Study* );
84   void                created( SUIT_Study* );
85
86
87 private:
88   LightApp_Driver*    myDriver;
89
90   friend class LightApp_Application;
91 };
92
93 #endif