1 // File: Model_Document.hxx
2 // Created: 28 Dec 2011
3 // Author: Mikhail PONIKAROV
6 #ifndef ModelAPI_Document_HeaderFile
7 #define ModelAPI_Document_HeaderFile
11 /**\class Model_Document
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.
20 class ModelAPI_Document
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;
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;
35 //! Removes document data
36 MODELAPI_EXPORT virtual void Close() = 0;
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;
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;
59 /// Only for SWIG wrapping it is here
60 MODELAPI_EXPORT ModelAPI_Document()