Back to index

salome-kernel  6.5.0
DF_Document.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef DFDOCUMENT_HXX
00021 #define DFDOCUMENT_HXX
00022 
00023 #include "DF_definitions.hxx"
00024 #include "DF_Label.hxx"
00025 
00026 #include <string>
00027 
00028 class DF_Application;
00029 
00030 //Class DF_Document is container for user's data stored as a tree of Labels
00031 //with assigned Attributes
00032 class DF_Document {
00033 public:
00034   //Constructor
00035   Standard_EXPORT DF_Document(const std::string& theDocumentType);
00036 
00037   Standard_EXPORT ~DF_Document();
00038 
00039   Standard_EXPORT DF_Application* GetApplication();    
00040 
00041   //Returns a Label of this Document with entry "0:1"
00042   Standard_EXPORT DF_Label Main();
00043 
00044   //Returns a root Label with entry "0:"
00045   Standard_EXPORT DF_Label Root();
00046 
00047   //Returns an ID of this 
00048   Standard_EXPORT int GetDocumentID() const;
00049 
00050   //Returns a type of the Document
00051   Standard_EXPORT std::string GetDocumentType();
00052 
00053   //Clears the content of this Document
00054   Standard_EXPORT void Clear();
00055 
00056   //Returns true if this document is empty
00057   Standard_EXPORT bool IsEmpty();
00058 
00059   //Returns true if this document is modified
00060   Standard_EXPORT bool IsModified();
00061 
00062   //Returns true if this document is modified
00063   Standard_EXPORT void SetModified(bool isModified); 
00064 
00065   //########### Load/Save virtual methods ##
00066 
00067   //Restores a content of the Document from the std::string theData
00068   Standard_EXPORT virtual void Load(const std::string& theData);
00069 
00070   //Converts a content of the Document into the std::string
00071   Standard_EXPORT virtual std::string Save();
00072 
00073   friend class DF_Application;
00074 
00075 private:
00076   DF_Label    _main;
00077   DF_Label    _root;
00078   std::string _type;
00079   int         _id;
00080   bool        _modified;
00081   DF_Application* _appli;
00082 };
00083 
00084 #endif