Commit | Line | Data |
---|---|---|
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_Application_HeaderFile | |
18 | #define _CDM_Application_HeaderFile | |
19 | ||
20 | #include <Standard.hxx> | |
21 | #include <Standard_Type.hxx> | |
22 | ||
23 | #include <Standard_Transient.hxx> | |
24 | #include <Standard_Boolean.hxx> | |
25 | #include <Standard_Integer.hxx> | |
26 | #include <Standard_ExtString.hxx> | |
fe21f796 BB |
27 | #include <TCollection_AsciiString.hxx> |
28 | #include <TCollection_ExtendedString.hxx> | |
29 | ||
42cf5bc1 | 30 | class CDM_Reference; |
31 | class CDM_MetaData; | |
32 | class CDM_Document; | |
33 | class Resource_Manager; | |
83ae3591 | 34 | class Message_Messenger; |
42cf5bc1 | 35 | |
36 | class CDM_Application; | |
37 | DEFINE_STANDARD_HANDLE(CDM_Application, Standard_Transient) | |
38 | ||
39 | ||
40 | class CDM_Application : public Standard_Transient | |
41 | { | |
42 | ||
43 | public: | |
44 | ||
45 | ||
6fe96f84 | 46 | //! The manager returned by this virtual method will be |
47 | //! used to search for Format.Retrieval resource items. | |
42cf5bc1 | 48 | Standard_EXPORT virtual Handle(Resource_Manager) Resources() = 0; |
49 | ||
83ae3591 | 50 | //! Returns default messenger; |
51 | Standard_EXPORT virtual Handle(Message_Messenger) MessageDriver(); | |
42cf5bc1 | 52 | |
53 | //! this method is called before the update of a document. | |
54 | //! By default, writes in MessageDriver(). | |
55 | Standard_EXPORT virtual void BeginOfUpdate (const Handle(CDM_Document)& aDocument); | |
56 | ||
57 | //! this method is called affter the update of a document. | |
58 | //! By default, writes in MessageDriver(). | |
9fd2d2c3 | 59 | Standard_EXPORT virtual void EndOfUpdate (const Handle(CDM_Document)& aDocument, const Standard_Boolean theStatus, const TCollection_ExtendedString& ErrorString); |
42cf5bc1 | 60 | |
61 | //! writes the string in the application MessagerDriver. | |
62 | Standard_EXPORT void Write (const Standard_ExtString aString); | |
63 | ||
fe21f796 BB |
64 | //! Returns the application name. |
65 | Standard_EXPORT virtual TCollection_ExtendedString Name() const; | |
66 | ||
67 | //! Returns the application version. | |
68 | Standard_EXPORT virtual TCollection_AsciiString Version() const; | |
bc73b006 | 69 | |
70 | //! Dumps the content of me into the stream | |
71 | Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; | |
42cf5bc1 | 72 | |
73 | friend class CDM_Reference; | |
74 | friend class CDM_MetaData; | |
75 | ||
76 | ||
92efcf78 | 77 | DEFINE_STANDARD_RTTIEXT(CDM_Application,Standard_Transient) |
42cf5bc1 | 78 | |
79 | protected: | |
80 | ||
81 | ||
82 | Standard_EXPORT void SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const; | |
83 | ||
84 | Standard_EXPORT void SetReferenceCounter (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceCounter); | |
85 | ||
86 | ||
87 | ||
88 | private: | |
89 | ||
90 | ||
91 | Standard_EXPORT virtual Handle(CDM_Document) Retrieve (const Handle(CDM_MetaData)& aMetaData, const Standard_Boolean UseStorageConfiguration) = 0; | |
92 | ||
93 | //! returns -1 if the metadata has no modification counter. | |
94 | Standard_EXPORT virtual Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& aMetaData) = 0; | |
95 | ||
96 | ||
97 | ||
98 | }; | |
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | #endif // _CDM_Application_HeaderFile |