1 // Copyright (C) 2005-2012 OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // LIGHT : sample (no-corba-engine) SALOME module
21 // File : LIGHTGUI_DataModel.h
22 // Author : Julia DOROVSKIKH
24 #ifndef LIGHTGUI_DATAMODEL_H
25 #define LIGHTGUI_DATAMODEL_H
27 #include <LightApp_DataModel.h>
31 class LightApp_DataObject;
32 class LIGHTGUI_DataObject;
34 class LIGHTGUI_DataModel : public LightApp_DataModel
39 LIGHTGUI_DataModel( CAM_Module* theModule );
40 virtual ~LIGHTGUI_DataModel();
42 virtual bool open( const QString&, CAM_Study*, QStringList );
43 virtual bool save( QStringList& );
44 virtual bool saveAs( const QString&, CAM_Study*, QStringList& );
46 virtual bool create( CAM_Study* );
48 virtual bool isModified() const;
49 virtual bool isSaved() const;
51 virtual void update( LightApp_DataObject* = 0, LightApp_Study* = 0 );
53 bool loadFile( const QString&, CAM_Study* = 0 );
54 bool dumpFile( const QString& = QString() );
55 QString fileName() const;
57 QString getLineText( const int ) const;
58 bool setLineText( const int, const QString& );
59 bool insertLineBefore( const int, const QString& );
60 bool deleteTextLine( const int );
66 static int id( const QString& );
67 static QString entry( const int );
69 int lineNb( const QString& );
70 int lineNb( const int );
72 QList<int> getIds() const;
75 void buildTree( SUIT_DataObject*, const QStringList& );
76 LIGHTGUI_DataObject* findObject( const int ) const;
84 #endif // LIGHTGUI_DATAMODEL_H