Salome HOME
Synchronize adm files
[modules/kernel.git] / src / DF / DF_Document.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef DFDOCUMENT_HXX
21 #define DFDOCUMENT_HXX
22
23 #include "DF_definitions.hxx"
24 #include "DF_Label.hxx"
25
26 #include <string>
27
28 class DF_Application;
29
30 //Class DF_Document is container for user's data stored as a tree of Labels
31 //with assigned Attributes
32 class DF_Document {
33 public:
34   //Constructor
35   Standard_EXPORT DF_Document(const std::string& theDocumentType);
36
37   Standard_EXPORT ~DF_Document();
38
39   Standard_EXPORT DF_Application* GetApplication();    
40
41   //Returns a Label of this Document with entry "0:1"
42   Standard_EXPORT DF_Label Main();
43
44   //Returns a root Label with entry "0:"
45   Standard_EXPORT DF_Label Root();
46
47   //Returns an ID of this 
48   Standard_EXPORT int GetDocumentID() const;
49
50   //Returns a type of the Document
51   Standard_EXPORT std::string GetDocumentType();
52
53   //Clears the content of this Document
54   Standard_EXPORT void Clear();
55
56   //Returns true if this document is empty
57   Standard_EXPORT bool IsEmpty();
58
59   //Returns true if this document is modified
60   Standard_EXPORT bool IsModified();
61
62   //Returns true if this document is modified
63   Standard_EXPORT void SetModified(bool isModified); 
64
65   //########### Load/Save virtual methods ##
66
67   //Restores a content of the Document from the std::string theData
68   Standard_EXPORT virtual void Load(const std::string& theData);
69
70   //Converts a content of the Document into the std::string
71   Standard_EXPORT virtual std::string Save();
72
73   friend class DF_Application;
74
75 private:
76   DF_Label    _main;
77   DF_Label    _root;
78   std::string _type;
79   int         _id;
80   bool        _modified;
81   DF_Application* _appli;
82 };
83
84 #endif