]> SALOME platform Git repositories - modules/gui.git/blob - src/SalomeApp/SalomeApp_DataModel.h
Salome HOME
ENV: Windows porting
[modules/gui.git] / src / SalomeApp / SalomeApp_DataModel.h
1 // File:      SalomeApp_DataModel.h
2 // Created:   10/25/2004 10:32:33 AM
3 // Author:    Sergey LITONIN
4 // Copyright (C) CEA 2004
5
6 #ifndef SALOMEAPP_DATAMODEL_H
7 #define SALOMEAPP_DATAMODEL_H
8
9 #if _MSC_VER > 1000
10 #pragma once
11 #endif // _MSC_VER > 1000
12
13 #include "SalomeApp.h"
14 #include "CAM_DataModel.h"
15
16 #include "SALOMEDSClient.hxx"
17
18 class SalomeApp_Module;
19 class SalomeApp_Study;
20 class SalomeApp_DataObject;
21 class SalomeApp_SelectionMgr;
22
23 //   Class       : SalomeApp_DataModel
24 ///  Description : Base class of data model
25 class SALOMEAPP_EXPORT SalomeApp_DataModel : public CAM_DataModel
26 {
27   Q_OBJECT
28
29 public:
30   static SUIT_DataObject*             BuildTree(const _PTR(SObject)& obj, 
31                                                 SUIT_DataObject* parent, 
32                                                 SalomeApp_Study* study,
33                                                 bool skip = false );
34
35                                       SalomeApp_DataModel ( CAM_Module* theModule );
36   virtual                             ~SalomeApp_DataModel();
37
38   /** @name These methods should be redefined in successors.*/
39   //@{
40   virtual bool                        open( const QString&, CAM_Study* );
41   virtual bool                        save();
42   virtual bool                        saveAs( const QString&, CAM_Study* );
43   virtual bool                        close();
44
45   virtual void                        update( SalomeApp_DataObject* = 0, SalomeApp_Study* = 0 );
46
47   virtual bool                        isModified() const;
48   virtual bool                        isSaved()  const;
49   //@}
50
51 signals:
52   void                                opened();
53   void                                saved();
54   void                                closed();
55
56 protected:
57   SalomeApp_Module*                   getModule() const;
58   SalomeApp_Study*                    getStudy() const;
59
60   virtual void                        buildTree(const _PTR(SObject)&, SUIT_DataObject*, SalomeApp_Study* );
61
62   /** @name methods to be used by CORBAless modules*/
63   //@{
64   std::vector<std::string>            GetListOfFiles () const;
65   void                                SetListOfFiles (const std::vector<std::string> theListOfFiles);
66
67   static std::string                  GetTmpDir (const char* theURL,
68                                                  const bool  isMultiFile);
69
70   void                                RemoveTemporaryFiles (const bool isMultiFile) const;
71   //@}
72   // END: methods to be used by CORBAless modules
73
74 private:
75   QString                             getRootEntry( SalomeApp_Study* ) const;
76 };
77
78 #endif