Salome HOME
Copyrights update
[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\r
20 #define LIGHTAPP_STUDY_H\r
21 \r
22 #include <LightApp.h>\r
23 #include <LightApp_Driver.h>\r
24 \r
25 #include <CAM_Study.h>\r
26 #include <CAM_DataModel.h>\r
27 #include <SUIT_Study.h>\r
28 \r
29 #include "string"\r
30 #include "vector"\r
31 \r
32 class SUIT_Application;\r
33 class CAM_DataModel;\r
34 \r
35 class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study\r
36 {\r
37   Q_OBJECT\r
38 \r
39 public:\r
40   LightApp_Study( SUIT_Application* );\r
41   virtual ~LightApp_Study();\r
42 \r
43   virtual void        createDocument();\r
44   virtual bool        openDocument( const QString& );\r
45   virtual bool        loadDocument( const QString& ); \r
46 \r
47   virtual bool        saveDocument();\r
48   virtual bool        saveDocumentAs( const QString& );\r
49 \r
50   virtual void        closeDocument(bool permanently = true);\r
51 \r
52   virtual bool        isSaved()  const;\r
53   virtual bool        isModified() const;\r
54 \r
55   virtual void        addComponent   ( const CAM_DataModel* dm);\r
56 \r
57   virtual std::string GetTmpDir      ( const char* theURL, const bool  isMultiFile );\r
58 \r
59   virtual QString     componentDataType( const QString& ) const;\r
60   virtual QString     referencedToEntry( const QString& ) const;\r
61   virtual bool        isComponent( const QString& ) const;\r
62   virtual void        children( const QString&, QStringList& ) const;\r
63   virtual void        components( QStringList& ) const;\r
64 \r
65 protected:\r
66   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );\r
67   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );\r
68   virtual bool        saveStudyData  ( const QString& theFileName );\r
69   virtual bool        openStudyData  ( const QString& theFileName );\r
70 \r
71   virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;\r
72   virtual void        SetListOfFiles ( const char* theModuleName,\r
73                                        const std::vector<std::string> theListOfFiles );\r
74 \r
75   virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const;\r
76 \r
77 protected:\r
78   virtual bool        openDataModel  ( const QString&, CAM_DataModel* );\r
79 \r
80 signals:\r
81   void                saved  ( SUIT_Study* );\r
82   void                opened ( SUIT_Study* );\r
83   void                closed ( SUIT_Study* );\r
84   void                created( SUIT_Study* );\r
85 \r
86 \r
87 private:\r
88   LightApp_Driver*    myDriver;\r
89 };\r
90 \r
91 #endif \r