Salome HOME
Removed CASCatch
[modules/kernel.git] / src / DF / DF_Document.hxx
1 #ifndef DFDOCUMENT_HXX
2 #define DFDOCUMENT_HXX
3
4 #include "DF_definitions.hxx"
5 #include "DF_Label.hxx"
6
7 #include <string>
8
9 class DF_Application;
10
11 //Class DF_Document is container for user's data stored as a tree of Labels
12 //with assigned Attributes
13 class DF_Document {
14 public:
15   //Constructor
16   Standard_EXPORT DF_Document(const std::string& theDocumentType);
17
18   Standard_EXPORT ~DF_Document();
19
20   Standard_EXPORT DF_Application* GetApplication();    
21
22   //Returns a Label of this Document with entry "0:1"
23   Standard_EXPORT DF_Label Main();
24
25   //Returns a root Label with entry "0:"
26   Standard_EXPORT DF_Label Root();
27
28   //Returns an ID of this 
29   Standard_EXPORT int GetDocumentID() const;
30
31   //Returns a type of the Document
32   Standard_EXPORT std::string GetDocumentType();
33
34   //Clears the content of this Document
35   Standard_EXPORT void Clear();
36
37   //Returns true if this document is empty
38   Standard_EXPORT bool IsEmpty();
39
40   //Returns true if this document is modified
41   Standard_EXPORT bool IsModified();
42
43   //Returns true if this document is modified
44   Standard_EXPORT void SetModified(bool isModified); 
45
46   //########### Load/Save virtual methods ##
47
48   //Restores a content of the Document from the std::string theData
49   Standard_EXPORT virtual void Load(const std::string& theData);
50
51   //Converts a content of the Document into the std::string
52   Standard_EXPORT virtual std::string Save();
53
54   friend class DF_Application;
55
56 private:
57   DF_Label    _main;
58   DF_Label    _root;
59   std::string _type;
60   int         _id;
61   bool        _modified;
62   DF_Application* _appli;
63 };
64
65 #endif