42cf5bc1 |
1 | // Created on: 1995-11-13 |
2 | // Created by: Jean-Louis Frenkel |
3 | // Copyright (c) 1995-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 _CDF_Store_HeaderFile |
18 | #define _CDF_Store_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <TCollection_ExtendedString.hxx> |
26 | #include <PCDM_StoreStatus.hxx> |
27 | #include <CDF_TryStoreStatus.hxx> |
28 | #include <Standard_ExtString.hxx> |
29 | #include <CDF_StoreSetNameStatus.hxx> |
30 | #include <CDF_SubComponentStatus.hxx> |
31 | class CDF_StoreList; |
32 | class CDM_Document; |
33 | class TCollection_ExtendedString; |
34 | |
35 | |
36 | |
37 | class CDF_Store |
38 | { |
39 | public: |
40 | |
41 | DEFINE_STANDARD_ALLOC |
42 | |
43 | |
44 | //! creates a store list from the document of the current selection. |
45 | Standard_EXPORT CDF_Store(const Handle(CDM_Document)& aDocument); |
46 | |
42cf5bc1 |
47 | //! returns the folder in which the current document will be stored. |
48 | Standard_EXPORT Standard_ExtString Folder() const; |
49 | |
50 | //! returns the name under which the current document will be stored |
51 | Standard_EXPORT Standard_ExtString Name() const; |
52 | |
53 | //! returns true if the current document is already stored |
54 | Standard_EXPORT Standard_Boolean IsStored() const; |
55 | |
56 | Standard_EXPORT Standard_Boolean IsModified() const; |
57 | |
58 | Standard_EXPORT Standard_Boolean CurrentIsConsistent() const; |
59 | |
60 | Standard_EXPORT Standard_Boolean IsConsistent() const; |
61 | |
62 | Standard_EXPORT Standard_Boolean HasAPreviousVersion() const; |
63 | |
64 | Standard_EXPORT Standard_ExtString PreviousVersion() const; |
65 | |
66 | //! returns true if the currentdocument is the main one, ie the document |
67 | //! of the current selection. |
68 | Standard_EXPORT Standard_Boolean IsMainDocument() const; |
69 | |
70 | //! defines the folder in which the document should be |
71 | //! stored. returns Standard_True if the Folder exists, |
72 | //! Standard_False otherwise. |
73 | Standard_EXPORT Standard_Boolean SetFolder (const TCollection_ExtendedString& aFolder); |
74 | |
75 | //! defines the name under which the document should be stored. |
76 | Standard_EXPORT CDF_StoreSetNameStatus SetName (const Standard_ExtString aName); |
77 | |
78 | Standard_EXPORT void SetComment (const Standard_ExtString aComment); |
79 | |
80 | Standard_EXPORT Standard_ExtString Comment() const; |
81 | |
82 | //! defines the name under which the document should be stored. |
83 | //! uses for example after modification of the folder. |
84 | Standard_EXPORT CDF_StoreSetNameStatus RecheckName(); |
85 | |
86 | Standard_EXPORT Standard_Boolean SetPreviousVersion (const Standard_ExtString aPreviousVersion); |
87 | |
88 | Standard_EXPORT void Realize(); |
89 | |
90 | //! returns the complete path of the created meta-data. |
91 | Standard_EXPORT Standard_ExtString Path() const; |
92 | |
93 | //! returns the path of the previous store is the object |
94 | //! is already stored, otherwise an empty string; |
95 | Standard_EXPORT Standard_ExtString MetaDataPath() const; |
96 | |
97 | //! returns the description of the format of the main object. |
98 | Standard_EXPORT Standard_ExtString Description() const; |
99 | |
100 | //! Allows to Start a new Iteration from beginning |
101 | Standard_EXPORT void InitComponent(); |
102 | |
103 | //! Returns True if there are more entries to return |
104 | Standard_EXPORT Standard_Boolean MoreComponent() const; |
105 | |
106 | //! Go to the next entry |
107 | //! (if there is not, Value will raise an exception) |
108 | Standard_EXPORT void NextComponent(); |
109 | |
110 | Standard_EXPORT void SetCurrent(); |
111 | |
112 | //! Returns item value of current entry |
113 | Standard_EXPORT Standard_ExtString Component() const; |
114 | |
115 | Standard_EXPORT Standard_Boolean HasSubComponents() const; |
116 | |
117 | Standard_EXPORT CDF_SubComponentStatus SubComponentStatus (const Standard_ExtString aPresentation) const; |
118 | |
119 | Standard_EXPORT void SetCurrent (const Standard_ExtString aPresentation); |
120 | |
121 | //! the two following methods can |
122 | //! be used just after Realize or Import -- method to know if |
123 | //! thes methods worked correctly, and if not why. |
124 | Standard_EXPORT void SetMain(); |
125 | |
126 | Standard_EXPORT PCDM_StoreStatus StoreStatus() const; |
127 | |
128 | Standard_EXPORT Standard_ExtString AssociatedStatusText() const; |
129 | |
130 | //! defines the name under which the document should be stored. |
131 | Standard_EXPORT CDF_StoreSetNameStatus SetName (const TCollection_ExtendedString& aName); |
132 | |
133 | //! defines the folder in which the document should be |
134 | //! stored. returns Standard_True if the Folder exists, |
135 | //! Standard_False otherwise. |
136 | Standard_EXPORT Standard_Boolean SetFolder (const Standard_ExtString aFolder); |
137 | |
138 | |
139 | |
140 | |
141 | protected: |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | private: |
148 | |
149 | |
150 | Standard_EXPORT CDF_Store(); |
151 | |
152 | Standard_EXPORT void FindDefault(); |
153 | |
154 | Standard_EXPORT void Init(); |
155 | |
156 | |
157 | Handle(CDF_StoreList) myList; |
158 | Handle(CDM_Document) myMainDocument; |
159 | Handle(CDM_Document) myCurrentDocument; |
160 | Standard_Boolean myHasSubComponents; |
161 | Standard_Boolean myIsMainDocument; |
42cf5bc1 |
162 | TCollection_ExtendedString myPath; |
163 | TCollection_ExtendedString myText; |
164 | PCDM_StoreStatus myStatus; |
165 | |
166 | |
167 | }; |
168 | |
169 | |
170 | |
171 | |
172 | |
173 | |
174 | |
175 | #endif // _CDF_Store_HeaderFile |