Test for 0022778: Bug in BRepMesh
[occt.git] / src / CDF / CDF_Application.cdl
1 -- Created on: 1997-08-07
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 deferred class Application from CDF inherits Application from CDM
23
24 uses  
25     ExtendedString from TCollection,  
26     ExtendedString from TCollection,  
27     Document from CDM,  
28     Manager from Resource, 
29     MetaData from CDM,  
30     ReaderStatus  from PCDM,  
31     GUID from Standard, 
32     Reader from PCDM,  
33     Writer from PCDM, 
34     TypeOfActivation from CDF, 
35     SequenceOfExtendedString from TColStd, 
36     CanCloseStatus from CDM,  
37     AsciiString from TCollection 
38     
39 raises NoSuchObject from Standard
40 is
41
42
43     Initialize;
44     
45     Load(myclass; aGUID:GUID from Standard)
46     returns  mutable Application from CDF;
47     ---Purpose: plugs an application.
48     
49
50 ---Category: Open closing of documents
51 ---Purpose:
52 -- Open is used 
53 --       - for opening a Document that has been created in an application
54 --       - for opening a Document from the database
55 --       - for opening a Document from a file.
56 --  The Open methods always add the document in the session directory and 
57 --  calls the virtual Activate method. The document is considered to be 
58 --  opened until Close is used. To be storable, a document must be 
59 --  opened by an application since the application resources are 
60 --  needed to store it.
61 --          
62 --          
63 --          
64 --          
65     Open(me: mutable; aDocument: Document from CDM);
66     ---Purpose: puts the document in the current session directory
67     --          and calls the virtual method Activate on it.
68     
69     
70     CanClose(me: mutable; aDocument: Document from CDM)
71     returns CanCloseStatus from CDM;
72     
73     Close(me: mutable; aDocument: Document from CDM);
74     ---Purpose: removes the document of the current session directory 
75     --          and closes the document;
76     
77     Retrieve (me: mutable; aFolder, aName: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
78     returns Document from CDM;
79     ---Purpose: This method retrieves a document from the database. 
80     --          If the Document references other documents which have
81     --          been updated, the latest version of these documents will 
82     --          be used if {UseStorageConfiguration} is Standard_True.
83    --           The content of {aFolder}, {aName} and {aVersion} depends on 
84    --           the Database Manager system. If the DBMS is only based on 
85    --           the OS, {aFolder} is a directory and {aName} is the name of a 
86    --           file. In this case the use of the syntax with {aVersion} 
87    --           has no sense. For example: 
88 --
89 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("/home/cascade","box.dsg");
90 --              If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} 
91 --              have the form they have in EUCLID/Design Manager. For example:
92 --              
93 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box"); 
94 -- 
95 -- Since  the version is not specified in  this syntax, the  latest wil be used.
96 --  A link is kept with the database through an instance of CDM_MetaData
97
98
99     Retrieve (me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
100     returns Document from CDM;
101     ---Purpose:  This method retrieves  a  document from the database.
102     --          If the  Document references other documents which have
103     --          been  updated, the  latest version of  these documents
104     --           will    be   used  if   {UseStorageConfiguration}  is
105     --          Standard_True.  --  If the DBMS is  only  based on the
106     --           OS, this syntax  should not be used.
107     --           
108 --              If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} 
109 --              and  {aVersion} have the form they have in 
110 --              EUCLID/Design Manager. For example:
111 --              
112 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box","2");
113 --             A link is kept with the database through an instance 
114 --             of CDM_MetaData
115
116
117     CanRetrieve(me: mutable; aFolder, aName: ExtendedString from TCollection)
118     ---Purpose:
119     returns ReaderStatus from PCDM;
120     
121     CanRetrieve(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
122     ---Purpose:
123     returns ReaderStatus from PCDM;
124        
125     Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd) 
126     is deferred;
127 ---Category: CurrentDocument methods.
128 --           
129
130     GetRetrieveStatus(me) returns ReaderStatus from PCDM; 
131     ---C++: inline     
132     ---Purpose: Checks  status  after  Retrieve 
133      
134    ---Category: Store&Retrieve virtuals methods
135
136     Activate(me: mutable; aDocument: Document from CDM; aTypeOfActivation: TypeOfActivation from CDF)
137     is virtual private;
138     ---Purpose: Informs the  application that aDocument has  been
139     --          activated. A document is activated when it is created or 
140     --          retrieved.
141     --    aTypeOfActivation will be:
142     --            - CDF_TOA_New if the document is a new one 
143     --              (even empty or retrieved from the database for 
144     --              the first time).
145     --            - CDF_TOA_Unchanged if the document was already 
146     --              retrieved but had no changes since the previous retrieval.
147     --            - CDF_TOA_Modified if the document was already 
148     --              retrieved and modified since the previous retrieval.
149     --  You do not need to call <Activate>, but you should  redefine 
150     --  this method to implement application specific behavior.
151
152
153  ---Category:  methods to get storage/retrieval driver.
154  --           
155  --           
156     FindReader(me: mutable; aFileName: ExtendedString from TCollection)
157     returns Boolean from Standard;
158
159
160     Reader(me: mutable; aFileName: ExtendedString from TCollection) 
161     returns Reader from PCDM
162     raises NoSuchObject from Standard;
163     
164     FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection)
165     returns Boolean from Standard;
166     
167     ReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection) 
168     returns Reader from PCDM
169     raises NoSuchObject from Standard;
170
171     ---Purpose: 
172
173     Format (me : mutable; aFileName :     ExtendedString from TCollection; 
174                           theFormat : out ExtendedString from TCollection)
175     ---Purpose: try to  retrieve a Format  directly in the  file or in
176     --           application   resource  by using   extension. returns
177     --          True if found;
178     returns Boolean from Standard;
179     
180
181
182 ---Category: Default Storage folder
183 --           
184     DefaultFolder(me: mutable) returns ExtString from Standard;
185     
186     SetDefaultFolder(me: mutable; aFolder: ExtString from Standard)
187     returns Boolean from Standard;
188     
189     DefaultExtension(me: mutable) returns ExtString from Standard;
190     
191 ---Category: private methods
192     Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard)
193     returns mutable Document from CDM
194     is private;
195
196     Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard; IsComponent: Boolean from Standard)
197     returns mutable Document from CDM
198     is private;
199
200     DocumentVersion(me: mutable; theMetaData: MetaData from CDM)
201     returns Integer from Standard
202     is private;
203
204     FindReader(me: mutable; aFileName: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
205     returns Boolean from Standard
206     is private;
207     
208
209     FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
210     returns Boolean from Standard
211     is private;
212     
213     TypeOfActivation(me: mutable; aMetaData: MetaData from CDM)
214     returns TypeOfActivation from CDF
215     is private;
216
217     CanRetrieve(me: mutable; aMetaData: MetaData from CDM)
218     returns ReaderStatus from PCDM
219     is private;
220 fields
221
222     myDefaultFolder: ExtendedString from TCollection; 
223     myRetrievableStatus :  ReaderStatus from PCDM  is protected; 
224     
225 friends 
226     class Session from CDF--,
227     --class CheckDocumentToStore from CDF 
228
229 end Application from CDF;