Salome HOME
cc8aa70dfe65c852617b29f41eda0dc91e78dd05
[modules/shaper.git] / src / ModelAPI / ModelAPI_Document.hxx
1 // File:        Model_Document.hxx
2 // Created:     28 Dec 2011
3 // Author:      Mikhail PONIKAROV
4 // Copyright:   CEA 2011
5
6 #ifndef ModelAPI_Document_HeaderFile
7 #define ModelAPI_Document_HeaderFile
8
9 #include <ModelAPI.hxx>
10
11 /**\class Model_Document
12  * \ingroup DataModel
13  * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
14  * Document contains all data of te SALOME Study specific to this module
15  * that must be written into the HDF file.
16  * Also it provides acces to this data: open/save, transactions management etc.
17  * to provide access to all stored data.
18  */
19
20 class ModelAPI_Document
21 {
22 public:
23
24   //! Loads the OCAF document from the file.
25   //! \param theFileName full name of the file to load
26   //! \param theStudyID identifier of the SALOME study to associate with loaded file
27   //! \returns true if file was loaded successfully
28   MODELAPI_EXPORT virtual bool Load(const char* theFileName) = 0;
29
30   //! Saves the OCAF document to the file.
31   //! \param theFileName full name of the file to store
32   //! \returns true if file was stored successfully
33   MODELAPI_EXPORT virtual bool Save(const char* theFileName) = 0;
34
35   //! Removes document data
36   MODELAPI_EXPORT virtual void Close() = 0;
37
38   //! Starts a new operation (opens a tansaction)
39   MODELAPI_EXPORT virtual void StartOperation() = 0;
40   //! Finishes the previously started operation (closes the transaction)
41   MODELAPI_EXPORT virtual void FinishOperation() = 0;
42   //! Aborts the operation 
43   MODELAPI_EXPORT virtual void AbortOperation() = 0;
44   //! Returns true if operation has been started, but not yet finished or aborted
45   MODELAPI_EXPORT virtual bool IsOperation() = 0;
46   //! Returns true if document was modified (since creation/opening)
47   MODELAPI_EXPORT virtual bool IsModified() = 0;
48
49   //! Returns True if there are available Undos
50   MODELAPI_EXPORT virtual bool CanUndo() = 0;
51   //! Undoes last operation
52   MODELAPI_EXPORT virtual void Undo() = 0;
53   //! Returns True if there are available Redos
54   MODELAPI_EXPORT virtual bool CanRedo() = 0;
55   //! Redoes last operation
56   MODELAPI_EXPORT virtual  void Redo() = 0;
57
58   /// Only for SWIG wrapping it is here
59   MODELAPI_EXPORT ModelAPI_Document() {};
60 };
61
62 #endif