Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/kernel.git] / idl / SALOME_ModuleCatalog.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SALOME_ModuleCatalog.idl
23 //  Author : Estelle Deville
24 //  $Header$
25
26 /*! \file SALOME_ModuleCatalog.idl This file conatins a set of interfaces used for  
27   creation of the catalog of components in %SALOME application
28 */
29
30 /*!  
31 The main package of interfaces used for creation of the module catalog in %SALOME application.
32 Module catalog allows to manage components of %SALOME application, to call specified in the
33 xml files interfaces with the help of AComponent interface.
34 */
35 module SALOME_ModuleCatalog
36 {
37   // Type Definitions
38 /*! 
39 This enumeration contains a current set of definitions of the components integrated
40 into %SALOME application.
41 */
42   enum ComponentType {  GEOM,  /*!<Module %GEOM */
43                         MESH,  /*!<Module %MESH */
44                          Med,  /*!<Module %Med*/
45                       SOLVER,  /*!<Module of %SOLVER type */
46                         DATA,  /*!<Module %DATA */
47                         VISU,  /*!<Module %VISU */
48                       SUPERV,  /*!<Module %SUPERVISION */
49                        OTHER   /*!<Any other type of module */
50                      } ;
51 /*! 
52 This struct contains fields defining the parameter of the service.
53 */
54
55   struct ServicesParameter
56   {
57     string Parametertype; /*!<Type of the parameter.*/
58     string Parametername; /*!<Name of the parameter.*/
59   } ;
60
61   enum DataStreamDependency {
62     DATASTREAM_UNDEFINED,
63     DATASTREAM_TEMPORAL,
64     DATASTREAM_ITERATIVE
65   } ;
66
67   struct ServicesDataStreamParameter
68   {
69     string Parametertype;                     /*!<Type of the parameter.*/
70     string Parametername;                     /*!<Name of the parameter.*/
71     DataStreamDependency Parameterdependency; /*!<Temporal or iterative dependency.*/
72   } ;
73
74 /*! 
75 The list of the parameters of service.
76 */
77
78   typedef sequence<ServicesParameter> ListOfServicesParameter;
79   typedef sequence<ServicesDataStreamParameter> ListOfServicesDataStreamParameter;
80
81   typedef sequence<string> ListOfString;
82   enum TypeKind 
83   {
84     NONE     ,
85     Dble   ,
86     Int      ,
87     Str   ,
88     Bool     ,
89     Objref   ,
90     Seq ,
91     Array    ,
92     Struc 
93   };
94   struct MemberDefinition
95   {
96     string name; /*! Name of the member */
97     string type; /*! Type of the member */
98   };
99   typedef sequence<MemberDefinition> ListOfMemberDefinition;
100 /*! 
101  * Struct to get the definition of types used in Salome catalogs
102  */
103   struct TypeDefinition
104   {
105     string name; /*! Name of the type */
106     TypeKind kind; /*! Kind of the type.*/
107     string id; /*! id (if needed) */
108     string content; /*! Content type (if needed) */
109     ListOfString bases; /*! Content type (if needed) */
110     ListOfMemberDefinition members; /*! Members types (if needed) */
111   };
112
113   typedef sequence<TypeDefinition> ListOfTypeDefinition;
114
115 /*! 
116 This struct contains fields completely defining each service.
117 */
118
119   struct Service
120   {
121     string                            ServiceName; /*!<Name of the service.*/
122     ListOfServicesParameter           ServiceinParameter; /*!< List of input parameters of the services.*/
123     ListOfServicesParameter           ServiceoutParameter; /*!< List of output parameters of the services.*/
124     ListOfServicesDataStreamParameter ServiceinDataStreamParameter; /*!< List of input parameters of the services.*/
125     ListOfServicesDataStreamParameter ServiceoutDataStreamParameter; /*!< List of output parameters of the services.*/
126     boolean                           Servicebydefault; /*!<True if the service is taken with its default fields.*/
127     boolean                           TypeOfNode; /*!<True is the service is a factory node. Otherwise, it's a compute node.*/
128   } ;
129 /*! 
130 List of services of the interface.
131 */
132   typedef sequence<Service> ListOfInterfaceService;
133 /*! 
134 List of services.
135 */
136   typedef sequence<string> ListOfServices ;
137 /*! 
138 This struct contains fields defining each interface.
139 */
140   struct DefinitionInterface
141   {
142     string                 interfacename ; /*!<Name of the interface.*/
143     ListOfInterfaceService interfaceservicelist ; /*!<List of services of the interface.*/
144   } ;
145 /*! 
146 List of interface definitions.
147 */
148   typedef sequence<DefinitionInterface> ListOfDefInterface ;
149 /*! 
150 List of names of interfaces.
151 */
152   typedef sequence<string> ListOfInterfaces ;
153
154 /*!
155 PathPrefix : association of a machine name and
156 a path to a component
157 */
158   struct PathPrefix {
159     string             machine;
160     string             path;
161   };
162
163 /*! 
164 List of path prefixes
165 */
166   typedef sequence<PathPrefix> PathPrefixes;
167
168 /*!
169 Implementation type
170 */
171   enum ImplType {
172     SO,                       /* component implemented as a dynamic library loadable with dlopen */
173     PY,                       /* component implemented as a python module loadable with import */
174     EXE                       /* component implemented as an executable */
175   } ;
176
177 /*!
178 Description of a component
179 */
180   struct ComponentDef
181   {
182     ComponentType      type;
183     string             name;
184     string             username;
185     boolean            multistudy;
186     ImplType           implementationType;
187     string             implname;
188     string             icon;
189     string             constraint;
190     ListOfDefInterface interfaces;
191     PathPrefixes       paths;
192   };
193
194 /*! 
195 List of names of components.
196 */
197   typedef sequence<string> ListOfComponents ;
198 /*! 
199 List of names of computers.
200 */
201   typedef sequence<string> ListOfComputers ;
202 /*! 
203 This struct contains GUI elements used for representation of the module in %IAPP component.
204 */
205   struct IAPP_Affich
206   {
207     string modulename;     /*!<Name of the module.*/
208     string moduleusername; /*!<UserName of the module.*/
209     string moduleicone;    /*!<Icone representing the module.*/
210     string moduleversion;  /*!<Version of the module.*/
211     string modulecomment;  /*!<Comment to the module.*/
212   };
213 /*!
214 List of pair GUI elements (component name, component icone)
215  used for representation of the module in %IAPP component.
216 */
217   typedef sequence<IAPP_Affich> ListOfIAPP_Affich ;
218
219 /*! 
220  This exception is raised when a %component, a %service or a % pathPrefix is not found.
221 */
222   exception NotFound
223   {
224     string what ; /*!<Indicates if it's a %component, a %service or a % pathPrefix.*/
225   } ;
226
227   /*!
228    This interface provides the common funcionality information of corresponding component.
229    Information is loaded from specific xml files.
230   */
231   interface Acomponent
232   {
233     // GetInterfaceList : operation to get a list of the interfaces name of
234     //                    a component
235   /*!
236    Gets the list of names of interfaces of the component
237     \return a list of interfaces of the component 
238   */
239     ListOfInterfaces GetInterfaceList() ;
240
241     // GetInterface : operation to get one interface of a component
242   
243   /*! 
244     Gets a definite interface of the component
245     \note <BR>If the specified interface doesn't exist, Notfound exception is thrown
246     \param interfacename  Name of the interface 
247     \return Required interface
248   */
249     DefinitionInterface GetInterface(in string interfacename) raises(NotFound);
250
251     // GetServiceList : operation to get a list of the services name of
252     //                  an interface of a component
253  /*! 
254    Gets the list of names of services of a definite interface belonging to the component.
255    \note <BR>If the specified interface doesn't exist, Notfound exception is thrown.
256    \param interfacename Name of the interface 
257    \return List of services of the required interface
258  */
259     ListOfServices GetServiceList(in string interfacename) raises(NotFound);
260
261     
262     // GetService : operation to get one service of an interface of a component
263   
264  /*! 
265    Gets a definite service of an interface of the component.
266    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
267    \param interfacename Name of the interface
268    \param servicename Name of the service
269    \return Required service
270  */
271
272     Service GetService(in string interfacename, 
273                        in string servicename) raises(NotFound);
274
275     // GetDefaultService : operation to get the default service
276     //                     of an interface of a component
277 /*! 
278    Gets the default service of an interface of the component.
279    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
280    \param interfacename Name of the interface
281    \return Required service
282  */
283
284     Service GetDefaultService(in string interfacename) raises(NotFound);
285
286     // GetPathPrefix : operation to get the PathPrefix of a computer
287  /*!  
288    Gets the prefix path of the computer containing the %component.
289    \note <BR>If the required computer doesn't exist, Notfound exception is thrown
290    \param machinename Name of the machine 
291    \return Prefix path
292  */
293
294     string GetPathPrefix(in string machinename) raises(NotFound);
295
296 /*! 
297     Get the constraint affected to the component 
298     (to be resolved by LifeCycle for the computer choice)
299 */
300     readonly attribute string constraint ;
301
302 /*! 
303 Get the name of the component
304 */
305     readonly attribute string componentname;
306
307 /*!
308 Get the user name of the component
309 */
310     readonly attribute string componentusername;
311
312 /*! 
313 Ask whether the component is multistudy or not
314 */
315     readonly attribute boolean multistudy;
316
317 /*! 
318 Ask the type of the component
319 */
320     readonly attribute ComponentType component_type ;
321
322 /*! 
323 Gets the icone of the component (for IAPP)
324 */
325     readonly attribute string component_icone;
326
327 /*! 
328 Gets the implementation type of the component : C++ (dyn lib), Python (module) or executable 
329 */
330     readonly attribute ImplType implementation_type;
331 /*! 
332 Gets the implementation name of the component : name of the dyn lib or the python module or the executable
333 if the default naming scheme is not convenient.
334 */
335     readonly attribute string implementation_name;
336   } ;
337
338 /*! \brief %Module catalog interface
339
340 This interface is used for creation of the module catalog in %SALOME application.
341 */
342   interface ModuleCatalog
343   {
344     void ping();
345
346 /*!
347     Returns the PID of the server
348 */
349     long getPID();
350
351 /*!
352     Shutdown the ModuleCatalog process.
353 */    
354     oneway void ShutdownWithExit();
355
356 /*! 
357  * Get the types of the catalog
358  */   
359     ListOfTypeDefinition GetTypes();
360
361 /*! 
362  Gets a list of names of computers of the catalog 
363 */   
364     ListOfComputers GetComputerList();
365
366 /*! 
367 Gets the %PathPrefix of a computer
368 */
369     string GetPathPrefix(in string machinename) raises(NotFound);
370 /*! 
371  Gets a list of names of components of the catalog 
372 */   
373     ListOfComponents GetComponentList();
374 /*! 
375 Gets a list of pair GUI elements (component name, component icone) 
376 used for representation of the module in %IAPP component.
377 */
378
379     ListOfIAPP_Affich GetComponentIconeList();
380 /*! 
381 Gets a list of names of components of a particular type, which belong to this catalog.
382 */  
383     // GetComponentList : operation to get a list of the components name of
384     //                    a particular type of the catalog   
385     ListOfComponents GetTypedComponentList(in ComponentType _component_type);
386
387 /*! 
388 Gets one component of the catalog.
389 */
390     Acomponent GetComponent(in string componentname) raises(NotFound);
391
392 /*! 
393 Gets the description of a component of the catalog.
394 */
395     ComponentDef GetComponentInfo(in string componentName) raises(NotFound);
396
397 /*!
398 Reads a xml file and imports new components from this file.
399 New components replace existing components with the same name.
400 */
401     void ImportXmlCatalogFile(in string filename) raises(NotFound);
402
403     void shutdown();
404   } ;
405 };