src/CAM/CAM_DataModel.h

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
00002 // 
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either 
00006 // version 2.1 of the License.
00007 // 
00008 // This library is distributed in the hope that it will be useful 
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public  
00014 // License along with this library; if not, write to the Free Software 
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 #ifndef CAM_DATAMODEL_H
00020 #define CAM_DATAMODEL_H
00021 
00022 #include "CAM.h"
00023 
00024 #include <qobject.h>
00025 #include <qstringlist.h>
00026 
00027 class CAM_Module;
00028 class CAM_DataObject;
00029 class CAM_Study;
00030 class SUIT_DataObject;
00031 
00037 class CAM_EXPORT CAM_DataModel : public QObject
00038 {
00039   Q_OBJECT
00040 
00041 public:
00042   CAM_DataModel( CAM_Module* );
00043   virtual ~CAM_DataModel();
00044 
00045   virtual void     initialize();
00046 
00047   CAM_DataObject*  root() const;
00048   CAM_Module*      module() const;
00049 
00052   virtual bool     open( const QString&, CAM_Study*, QStringList ) { return true; }
00053   virtual bool     save( QStringList& ) { return true; };
00054   virtual bool     saveAs( const QString&, CAM_Study*, QStringList&  ) { return true; };
00055   virtual bool     close() { return true; };
00056   virtual bool     create( CAM_Study* ) { return true; }
00058 
00059 protected:
00066   virtual void     setRoot( const CAM_DataObject* );
00067 
00068 private slots:
00069   void             onDestroyed( SUIT_DataObject* );
00070 
00071 signals:
00072   void             rootChanged( const CAM_DataModel* );
00073 
00074 private:
00075   CAM_DataObject*  myRoot;
00076   CAM_Module*      myModule;
00077 };
00078 
00079 #endif