aa5d7b04822f12c0f95549d24f363979783b90df
[occt.git] / src / XmlLDrivers / XmlLDrivers_DocumentStorageDriver.hxx
1 // Created on: 2001-07-25
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _XmlLDrivers_DocumentStorageDriver_HeaderFile
17 #define _XmlLDrivers_DocumentStorageDriver_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
21
22 #include <XmlLDrivers_SequenceOfNamespaceDef.hxx>
23 #include <TCollection_ExtendedString.hxx>
24 #include <XmlObjMgt_SRelocationTable.hxx>
25 #include <PCDM_StorageDriver.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <XmlObjMgt_Element.hxx>
28 #include <Standard_Integer.hxx>
29 class XmlMDF_ADriverTable;
30 class TCollection_ExtendedString;
31 class CDM_Document;
32 class TCollection_AsciiString;
33 class Message_Messenger;
34
35
36 class XmlLDrivers_DocumentStorageDriver;
37 DEFINE_STANDARD_HANDLE(XmlLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
38
39
40 class XmlLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
41 {
42
43 public:
44
45   
46   Standard_EXPORT XmlLDrivers_DocumentStorageDriver(const TCollection_ExtendedString& theCopyright);
47   
48   Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, 
49                                       const TCollection_ExtendedString& theFileName,
50                   const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
51
52   Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, 
53                                       Standard_OStream& theOStream,
54                   const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
55   
56   Standard_EXPORT virtual Handle(XmlMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
57
58
59
60
61   DEFINE_STANDARD_RTTIEXT(XmlLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
62
63 protected:
64
65   
66   Standard_EXPORT virtual Standard_Boolean WriteToDomDocument
67                                 (const Handle(CDM_Document)& theDocument, 
68                                  XmlObjMgt_Element& thePDoc,
69                                  const Handle(Message_ProgressIndicator)& theProgress = NULL);
70   
71   Standard_EXPORT virtual Standard_Integer MakeDocument
72                                 (const Handle(CDM_Document)& theDocument,
73                                  XmlObjMgt_Element& thePDoc, 
74                                  const Handle(Message_ProgressIndicator)& theProgress = NULL);
75   
76   Standard_EXPORT void AddNamespace (const TCollection_AsciiString& thePrefix,
77                                      const TCollection_AsciiString& theURI);
78   
79   Standard_EXPORT virtual Standard_Boolean WriteShapeSection
80                                 (XmlObjMgt_Element& thePDoc, 
81                                  const Handle(Message_ProgressIndicator)& theProgress = NULL);
82
83   Handle(XmlMDF_ADriverTable) myDrivers;
84   XmlObjMgt_SRelocationTable myRelocTable;
85
86
87 private:
88
89
90   XmlLDrivers_SequenceOfNamespaceDef mySeqOfNS;
91   TCollection_ExtendedString myCopyright;
92   TCollection_ExtendedString myFileName;
93
94
95 };
96
97
98
99
100
101
102
103 #endif // _XmlLDrivers_DocumentStorageDriver_HeaderFile