1 #ifndef CAM_DATAMODEL_H
2 #define CAM_DATAMODEL_H
7 #include <qstringlist.h>
12 class SUIT_DataObject;
14 class CAM_EXPORT CAM_DataModel : public QObject
19 CAM_DataModel( CAM_Module* );
20 virtual ~CAM_DataModel();
22 virtual void initialize();
24 CAM_DataObject* root() const;
25 CAM_Module* module() const;
27 /** @name These methods should be redefined in successors.*/
29 virtual bool open( const QString&, CAM_Study*, QStringList ) { return true; }//!< return true
30 virtual bool save( QStringList& ) { return true; };
31 virtual bool saveAs( const QString&, CAM_Study*, QStringList& ) { return true; };
32 virtual bool close() { return true; };
33 virtual bool create( CAM_Study* ) { return true; }
37 /*! setRoot() should be used to specify custom root object instance.\n
38 * Such an object can be created in several ways, depending on application or module needs:\n
40 * \li while the model is being loaded
41 * \li when the model is updated and becomes non-empty
43 virtual void setRoot( const CAM_DataObject* );
46 void onDestroyed( SUIT_DataObject* );
49 void rootChanged( const CAM_DataModel* );
52 CAM_DataObject* myRoot;