42cf5bc1 |
1 | // Created on: 1997-10-22 |
2 | // Created by: Jean-Louis Frenkel |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _CDM_Reference_HeaderFile |
18 | #define _CDM_Reference_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <CDM_DocumentPointer.hxx> |
24 | #include <Standard_Integer.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <Standard_Transient.hxx> |
27 | class CDM_Document; |
28 | class CDM_Application; |
29 | class CDM_MetaData; |
30 | |
31 | |
32 | class CDM_Reference; |
33 | DEFINE_STANDARD_HANDLE(CDM_Reference, Standard_Transient) |
34 | |
35 | |
36 | class CDM_Reference : public Standard_Transient |
37 | { |
38 | |
39 | public: |
40 | |
41 | |
42 | Standard_EXPORT Handle(CDM_Document) FromDocument(); |
43 | |
44 | Standard_EXPORT Handle(CDM_Document) ToDocument(); |
45 | |
46 | Standard_EXPORT Standard_Integer ReferenceIdentifier(); |
47 | |
48 | Standard_EXPORT Standard_Integer DocumentVersion() const; |
49 | |
50 | Standard_EXPORT Standard_Boolean IsReadOnly() const; |
51 | |
52 | |
53 | friend class CDM_Document; |
54 | |
55 | |
56 | DEFINE_STANDARD_RTTI(CDM_Reference,Standard_Transient) |
57 | |
58 | protected: |
59 | |
60 | |
61 | |
62 | |
63 | private: |
64 | |
65 | |
66 | Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion); |
67 | |
68 | Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_MetaData)& aMetaData, const Standard_Integer aReferenceIdentifier, const Handle(CDM_Application)& anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration); |
69 | |
70 | Standard_EXPORT void Update (const Handle(CDM_MetaData)& aMetaData); |
71 | |
72 | //! compares the actual document version with the |
73 | //! document version at the creation of the reference |
74 | Standard_EXPORT Standard_Boolean IsUpToDate() const; |
75 | |
76 | Standard_EXPORT void SetIsUpToDate(); |
77 | |
78 | Standard_EXPORT void UnsetToDocument (const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication); |
79 | |
80 | //! returns true if the ToDocument has been retrieved |
81 | //! and opened. |
82 | Standard_EXPORT Standard_Boolean IsOpened() const; |
83 | |
84 | Standard_EXPORT Handle(CDM_Document) Document() const; |
85 | |
86 | Standard_EXPORT Handle(CDM_MetaData) MetaData() const; |
87 | |
88 | Standard_EXPORT Handle(CDM_Application) Application() const; |
89 | |
90 | Standard_EXPORT Standard_Boolean UseStorageConfiguration() const; |
91 | |
92 | Standard_EXPORT Standard_Boolean IsInSession() const; |
93 | |
94 | Standard_EXPORT Standard_Boolean IsStored() const; |
95 | |
96 | Handle(CDM_Document) myToDocument; |
97 | CDM_DocumentPointer myFromDocument; |
98 | Standard_Integer myReferenceIdentifier; |
99 | Handle(CDM_Application) myApplication; |
100 | Handle(CDM_MetaData) myMetaData; |
101 | Standard_Integer myDocumentVersion; |
102 | Standard_Boolean myUseStorageConfiguration; |
103 | |
104 | |
105 | }; |
106 | |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | #endif // _CDM_Reference_HeaderFile |