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 // These methods should be redefined in successors.
27 virtual bool open( const QString&, CAM_Study* ) { return true; }
28 virtual bool save() { return true; };
29 virtual bool saveAs( const QString&, CAM_Study* ) { return true; };
30 virtual bool close() { return true; };
31 virtual bool create( CAM_Study* ) { return true; }
34 virtual void setRoot( const CAM_DataObject* );
35 // setRoot() should be used to specify custom root object instance.
36 // Such an object can be created in several ways, depending on application or module needs:
38 // - while the model is being loaded
39 // - when the model is updated and becomes non-empty
42 void onDestroyed( SUIT_DataObject* );
45 void rootChanged( const CAM_DataModel* );
48 CAM_DataObject* myRoot;