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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _CDF_Store_HeaderFile
18 #define _CDF_Store_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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 #include <TCollection_HExtendedString.hxx>
33 #include <Message_ProgressRange.hxx>
37 class TCollection_ExtendedString;
48 //! creates a store list from the document of the current selection.
49 Standard_EXPORT CDF_Store(const Handle(CDM_Document)& aDocument);
51 //! returns the folder in which the current document will be stored.
52 Standard_EXPORT Handle(TCollection_HExtendedString) Folder() const;
54 //! returns the name under which the current document will be stored
55 Standard_EXPORT Handle(TCollection_HExtendedString) Name() const;
57 //! returns true if the current document is already stored
58 Standard_EXPORT Standard_Boolean IsStored() const;
60 Standard_EXPORT Standard_Boolean IsModified() const;
62 Standard_EXPORT Standard_Boolean CurrentIsConsistent() const;
64 Standard_EXPORT Standard_Boolean IsConsistent() const;
66 Standard_EXPORT Standard_Boolean HasAPreviousVersion() const;
68 Standard_EXPORT Handle(TCollection_HExtendedString) PreviousVersion() const;
70 //! returns true if the currentdocument is the main one, ie the document
71 //! of the current selection.
72 Standard_EXPORT Standard_Boolean IsMainDocument() const;
74 //! defines the folder in which the document should be
75 //! stored. returns Standard_True if the Folder exists,
76 //! Standard_False otherwise.
77 Standard_EXPORT Standard_Boolean SetFolder (const TCollection_ExtendedString& aFolder);
79 //! defines the name under which the document should be stored.
80 Standard_EXPORT CDF_StoreSetNameStatus SetName (const Standard_ExtString aName);
82 Standard_EXPORT void SetComment (const Standard_ExtString aComment);
84 Standard_EXPORT Handle(TCollection_HExtendedString) Comment() const;
86 //! defines the name under which the document should be stored.
87 //! uses for example after modification of the folder.
88 Standard_EXPORT CDF_StoreSetNameStatus RecheckName();
90 Standard_EXPORT Standard_Boolean SetPreviousVersion (const Standard_ExtString aPreviousVersion);
92 Standard_EXPORT void Realize (const Message_ProgressRange& theRange = Message_ProgressRange());
94 //! returns the complete path of the created meta-data.
95 Standard_EXPORT Standard_ExtString Path() const;
97 //! returns the path of the previous store is the object
98 //! is already stored, otherwise an empty string;
99 Standard_EXPORT Handle(TCollection_HExtendedString) MetaDataPath() const;
101 //! returns the description of the format of the main object.
102 Standard_EXPORT Handle(TCollection_HExtendedString) Description() const;
104 Standard_EXPORT void SetCurrent (const Standard_ExtString aPresentation);
106 //! the two following methods can
107 //! be used just after Realize or Import -- method to know if
108 //! thes methods worked correctly, and if not why.
109 Standard_EXPORT void SetMain();
111 Standard_EXPORT PCDM_StoreStatus StoreStatus() const;
113 Standard_EXPORT Standard_ExtString AssociatedStatusText() const;
115 //! defines the name under which the document should be stored.
116 Standard_EXPORT CDF_StoreSetNameStatus SetName (const TCollection_ExtendedString& aName);
118 //! defines the folder in which the document should be
119 //! stored. returns Standard_True if the Folder exists,
120 //! Standard_False otherwise.
121 Standard_EXPORT Standard_Boolean SetFolder (const Standard_ExtString aFolder);
135 Standard_EXPORT CDF_Store();
137 Standard_EXPORT void FindDefault();
139 Standard_EXPORT void Init();
142 Handle(CDF_StoreList) myList;
143 Handle(CDM_Document) myMainDocument;
144 Handle(CDM_Document) myCurrentDocument;
145 Standard_Boolean myHasSubComponents;
146 Standard_Boolean myIsMainDocument;
147 TCollection_ExtendedString myPath;
148 TCollection_ExtendedString myText;
149 PCDM_StoreStatus myStatus;
160 #endif // _CDF_Store_HeaderFile