1 #ifndef CAM_DATAMODEL_H
2 #define CAM_DATAMODEL_H
11 class SUIT_DataObject;
13 class CAM_EXPORT CAM_DataModel : public QObject
18 CAM_DataModel( CAM_Module* );
19 virtual ~CAM_DataModel();
21 virtual void initialize();
23 CAM_DataObject* root() const;
24 CAM_Module* module() const;
26 /** @name These methods should be redefined in successors.*/
28 virtual bool open( const QString&, CAM_Study* ) { return true; }//!< return true
29 virtual bool save() { return true; };
30 virtual bool saveAs( const QString&, CAM_Study* ) { return true; };
31 virtual bool close() { return true; };
32 virtual bool create( CAM_Study* ) { return true; }
36 /*! setRoot() should be used to specify custom root object instance.\n
37 * Such an object can be created in several ways, depending on application or module needs:\n
39 * \li while the model is being loaded
40 * \li when the model is updated and becomes non-empty
42 virtual void setRoot( const CAM_DataObject* );
45 void onDestroyed( SUIT_DataObject* );
48 void rootChanged( const CAM_DataModel* );
51 CAM_DataObject* myRoot;