0031353: TDocStd_Application does not have api to set progress indicator
[occt.git] / src / XmlMDF / XmlMDF.hxx
CommitLineData
42cf5bc1 1// Created on: 2001-07-09
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 _XmlMDF_HeaderFile
17#define _XmlMDF_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <XmlObjMgt_Element.hxx>
24#include <XmlObjMgt_SRelocationTable.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_Boolean.hxx>
27#include <XmlObjMgt_RRelocationTable.hxx>
28#include <XmlMDF_MapOfDriver.hxx>
6d8f9f4a 29
30#include <Message_ProgressIndicator.hxx>
31
42cf5bc1 32class TDF_Data;
33class XmlMDF_ADriverTable;
34class TDF_Label;
83ae3591 35class Message_Messenger;
42cf5bc1 36class XmlMDF_ADriver;
37class XmlMDF_TagSourceDriver;
38class XmlMDF_ReferenceDriver;
39class XmlMDF_ADriverTable;
40
41
42//! This package provides classes and methods to
43//! translate a transient DF into a persistent one and
44//! vice versa.
45//!
46//! Driver
47//!
48//! A driver is a tool used to translate a transient
49//! attribute into a persistent one and vice versa.
50//!
51//! Driver Table
52//!
53//! A driver table is an object building links between
54//! object types and object drivers. In the
55//! translation process, a driver table is asked to
56//! give a translation driver for each current object
57//! to be translated.
58class XmlMDF
59{
60public:
61
62 DEFINE_STANDARD_ALLOC
63
42cf5bc1 64 //! Translates a transient <aSource> into a persistent
65 //! <aTarget>.
6d8f9f4a 66 Standard_EXPORT static void FromTo (const Handle(TDF_Data)& aSource,
67 XmlObjMgt_Element& aTarget,
68 XmlObjMgt_SRelocationTable& aReloc,
69 const Handle(XmlMDF_ADriverTable)& aDrivers,
70 const Handle(Message_ProgressIndicator)& theProgress = NULL);
42cf5bc1 71
72 //! Translates a persistent <aSource> into a transient
73 //! <aTarget>.
74 //! Returns True if completed successfully (False on error)
6d8f9f4a 75 Standard_EXPORT static Standard_Boolean FromTo
76 (const XmlObjMgt_Element& aSource,
77 Handle(TDF_Data)& aTarget, XmlObjMgt_RRelocationTable& aReloc,
78 const Handle(XmlMDF_ADriverTable)& aDrivers,
79 const Handle(Message_ProgressIndicator)& theProgress = NULL);
42cf5bc1 80
81 //! Adds the attribute storage drivers to <aDriverSeq>.
6d8f9f4a 82 Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
83 const Handle(Message_Messenger)& theMessageDriver);
42cf5bc1 84
85private:
86
6d8f9f4a 87 Standard_EXPORT static Standard_Integer WriteSubTree
88 (const TDF_Label& theLabel,
89 XmlObjMgt_Element& theElement,
90 XmlObjMgt_SRelocationTable& aReloc,
91 const Handle(XmlMDF_ADriverTable)& aDrivers,
92 const Handle(Message_ProgressIndicator)& theProgress = NULL);
42cf5bc1 93
6d8f9f4a 94 Standard_EXPORT static Standard_Integer ReadSubTree
95 (const XmlObjMgt_Element& theElement,
96 const TDF_Label& theLabel,
97 XmlObjMgt_RRelocationTable& aReloc,
98 const XmlMDF_MapOfDriver& aDrivers,
99 const Handle(Message_ProgressIndicator)& theProgress = NULL);
42cf5bc1 100
6d8f9f4a 101 Standard_EXPORT static void CreateDrvMap (const Handle(XmlMDF_ADriverTable)& aDriverTable,
102 XmlMDF_MapOfDriver& anAsciiDriverMap);
42cf5bc1 103
104friend class XmlMDF_ADriver;
105friend class XmlMDF_TagSourceDriver;
106friend class XmlMDF_ReferenceDriver;
107friend class XmlMDF_ADriverTable;
108
109};
110
42cf5bc1 111#endif // _XmlMDF_HeaderFile