Salome HOME
c2eb2d6e703e414b7950bf37efa5e1b007548007
[modules/gui.git] / src / LightApp / LightApp_DataModel.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 // File:      LightApp_DataModel.h
20 // Created:   10/25/2004 10:32:33 AM
21 // Author:    Sergey LITONIN
22 // Copyright (C) CEA 2004
23
24 #ifndef LIGHTAPP_DATAMODEL_H
25 #define LIGHTAPP_DATAMODEL_H
26
27 #if _MSC_VER > 1000
28 #pragma once
29 #endif // _MSC_VER > 1000
30
31 #include "LightApp.h"
32 #include "CAM_DataModel.h"
33
34 class LightApp_Module;
35 class LightApp_Study;
36 class LightApp_DataObject;
37
38 /*!
39   Description : Base class of data model
40 */
41 class LIGHTAPP_EXPORT LightApp_DataModel : public CAM_DataModel
42 {
43   Q_OBJECT
44
45 public:
46                                       LightApp_DataModel ( CAM_Module* theModule );
47   virtual                             ~LightApp_DataModel();
48
49   virtual bool                        open( const QString&, CAM_Study*, QStringList );
50   virtual bool                        save( QStringList& );
51   virtual bool                        saveAs( const QString&, CAM_Study*, QStringList& );
52   virtual bool                        close();
53
54   virtual void                        update( LightApp_DataObject* = 0, LightApp_Study* = 0 );
55
56   virtual bool                        isModified() const;
57   virtual bool                        isSaved()  const;
58
59   LightApp_Module*                    getModule() const;
60
61 signals:
62   void                                opened();
63   void                                saved();
64   void                                closed();
65
66 protected:
67   LightApp_Study*                     getStudy() const;
68   virtual void                        build();
69   virtual void                        updateWidgets();
70 };
71
72 #endif