Salome HOME
22874: [CEA 1425] Performance SMESH Module
[modules/yacs.git] / idl / SALOMEDS.idl
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SALOMEDS.idl
24 //  Author : Yves FRICAUD
25 //
26 /*!  \file SALOMEDS.idl  \brief This file contains a set of interfaces used for creation, management
27   and modification of the %Study
28 */
29
30 #ifndef _SALOMEDS_IDL_
31 #define _SALOMEDS_IDL_
32
33 #include "SALOME_Exception.idl"
34 #include "SALOME_GenericObj.idl"
35
36 /*! \brief
37      This package contains the interfaces used for creation, management
38      and modification of the %Study
39 */
40 module SALOMEDS
41 {
42 /*! \brief Name of the file in which the %Study is saved.
43 */
44   typedef string URL;
45
46 /*! \brief Main identifier of an object in %SALOME application
47 */
48   typedef string ID;
49
50 /*! \brief While saving the data, IOR is transformed into persistent reference
51 */
52   typedef string PersistentReference;
53
54 /*! \brief IOR of the study in %SALOME application
55 */
56   typedef string SalomeReference;
57
58 /*! \brief List of the names of studies which are currently open in this %SALOME session.
59
60 Since %SALOME is a multi-study application, it allows to open a lot of studies
61 during each working session.
62 */
63   typedef sequence<string> ListOfOpenStudies;
64 //! List of file names
65   typedef sequence<string> ListOfFileNames;
66 //! List of modification dates of a study
67   typedef sequence<string> ListOfDates ;
68 //! An unbounded sequence of strings
69   typedef sequence<string> ListOfStrings ;
70 //! An unbounded sequence of sequence of strings
71   typedef sequence<ListOfStrings> ListOfListOfStrings ;
72 //! A byte stream which is used for binary data transfer between different components
73   typedef sequence<octet> TMPFile;
74
75   // Reference to other objects is treated with function AddReference
76   // and ReferencedObject
77   // All other type of attributes defined in AttributeType enum are
78   // treated with AddAdttribute and GetAttribute
79   // The difference is made because Reference attribute don't contain
80   // strings but reference to ID of other objects
81
82   interface GenericAttribute;
83   interface Study;
84   interface StudyManager;
85   interface StudyBuilder;
86   interface SObject;
87   interface SComponent;
88   interface SComponentIterator;
89   interface ChildIterator;
90   interface Driver;
91   interface AttributeStudyProperties;
92   interface AttributeParameter;
93   interface UseCaseIterator;
94   interface UseCaseBuilder;
95
96   interface Observer
97   {
98     oneway void notifyObserverID(in string theID, in long event);
99   };
100
101
102 //! List of attributes of %SObjects
103   typedef sequence<GenericAttribute> ListOfAttributes;
104
105 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
106   exception NotImplemented {};
107
108
109   //===========================================================================
110  /*! \brief %Study Interface
111
112     The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
113    Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
114    What is left in the %Study interface are elementary inquiries.
115    (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
116       and set methods.) A %Study is explored by a set of tools, mainly iterators
117     , which are described further. Nevertheless, the %Study
118      interface allows the search of an object by name or by ID.
119      \note
120      <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
121     In general it's a string of names of directories divided by a slash '/'.
122      <BR><VAR>The Context</VAR> is the current directory of an object.</P>
123 */
124
125   interface Study
126   {
127
128 //! Invalid study reference
129     exception StudyInvalidReference {};
130 //! Invalid study context
131     exception StudyInvalidContext {};
132 //! Invalid study component
133     exception StudyInvalidComponent {};
134 //! Invalid directory of the %study exception
135     exception StudyInvalidDirectory {};
136 //! Exception pointing that this name of the study has already been used.
137     exception StudyNameAlreadyUsed {};
138 //! study object already exists
139     exception StudyObjectAlreadyExists {};
140 //! Invalid name of the %study exception
141     exception StudyNameError {};
142 //! Invalid study comment 
143     exception StudyCommentError {};
144
145 /*! \brief The name of the %Study
146
147    This is equivalent to the methods setName() & getName()
148 */
149     attribute string     Name; // equivalent to setName() & getName()
150 /*! \brief The ID of the %Study
151
152    This is equivalent to the methods setID() & getID()
153 */
154     attribute short      StudyId;
155 //! Sequence containing %SObjects
156     typedef sequence<SObject> ListOfSObject;
157 //!  Get the persistent reference to the %Study.
158     PersistentReference  GetPersistentReference() raises(StudyInvalidReference);
159 //! Get a transient reference to the %Study.
160     SalomeReference      GetTransientReference() raises(StudyInvalidReference);
161
162 /*! \brief indicate whether the %Study is empty
163
164     \return True if the %Study is empty
165 */
166     boolean IsEmpty() raises(StudyInvalidReference);
167 /*! \brief  Find a %SComponent by its name.
168
169    \param aComponentName    It's a string value in the Comment Attribute of the Component,
170     which is looked for, defining the data type of this Component.
171
172 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
173
174 */
175     SComponent FindComponent  (in string aComponentName) raises(StudyInvalidReference);
176
177 /*! \brief  Find a %SComponent by ID of the according %SObject
178 */
179     SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
180 /*! \brief  Find a %SObject by the Name Attribute of this %SObject
181
182     \param anObjectName String parameter defining the name of the object
183     \return The obtained %SObject
184
185 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
186 */
187     SObject       FindObject      (in string anObjectName) raises(StudyInvalidReference);
188 /*! \brief  Find a %SObject by its ID
189
190     \param aObjectID This parameter defines the ID of the required object
191     \return The obtained %SObject
192 */
193     SObject       FindObjectID    (in ID aObjectID) raises(StudyInvalidReference);
194 /*! \brief Create a %SObject by its ID
195
196     \param aObjectID This parameter defines the ID of the required object
197     \return The created %SObject
198 */
199     SObject       CreateObjectID    (in ID aObjectID) raises(StudyInvalidReference);
200 /*!  \brief Find a %SObject by IOR of the object belonging to this %SObject.
201
202     \param anObjectName This parameter defines the IOR of the object
203     \return The obtained %SObject
204 */
205     SObject       FindObjectIOR   (in ID aObjectIOR) raises(StudyInvalidReference);
206 /*! \brief  Find in the study all %SObjects produced by a given %Component.
207
208     \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
209     \param aComponentName The name of the component, which objects are searched for.
210 */
211     ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
212 /*! \brief  Find a %SObject by the path to it.
213
214     \param thePath The path to the required %SObject.
215     \return The obtained %SObject.
216 */
217     SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
218 /*! \brief Get the path to the %SObject.
219 */
220     string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
221
222 /*! \brief  Set the context of the %Study.
223
224     \param thePath String parameter defining the context of the study.
225
226 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
227 */
228     void SetContext(in string thePath) raises (StudyInvalidReference, StudyInvalidContext);
229 /*!  \brief Get the context of the %Study.
230     
231 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
232 */
233     string GetContext() raises (StudyInvalidReference, StudyInvalidContext);
234 /*!  \brief Get a list of names of objects corresponding to the context.
235
236    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
237 */
238     ListOfStrings GetObjectNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
239 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
240
241    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
242 */
243     ListOfStrings GetDirectoryNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
244 /*! \brief  Get a list of names of Files corresponding to the context.
245
246     \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
247 */
248     ListOfStrings GetFileNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
249 /*! \brief Get a list of names of Components corresponding to the context.
250
251    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
252 */
253     ListOfStrings GetComponentNames(in string theContext) raises(StudyInvalidReference);
254 /*!  \brief Create a new iterator of child levels of the given %SObject.
255
256     \param aSO The given %SObject
257     \return A new iterator of child levels of the given %SObject.
258 */
259     ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
260
261 /*!  \brief Create a new iterator of the %SComponents.
262
263     \return A new iterator of the %SComponents.
264 */
265     SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
266
267 /*! \brief  Create a new %StudyBuilder to add or modify an object in the study.
268
269    \return A new %StudyBuilder.
270
271 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
272 */
273     StudyBuilder NewBuilder() raises(StudyInvalidReference);
274 /*! \brief Labels dependency
275
276     Updates the map with IOR attribute. It's an inner method used for optimization.
277 */
278     void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
279
280 /*! \brief Getting properties of the study
281
282    Returns the attribute, which contains the properties of this study.
283
284 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
285
286 */
287     AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
288 /*! \brief  Indicate whether the %study has been saved
289 */
290     attribute boolean IsSaved;
291 /*! \brief  Indicate whether the %study has been modified and not saved.
292
293   Returns True if the %study has been modified and not saved.
294 */
295     boolean IsModified() raises(StudyInvalidReference);
296
297 /*! \brief  Mark the %study as being modified and not saved.
298 */
299     void Modified() raises(StudyInvalidReference);
300
301 /*! \brief  Indicate the file where the %study has been saved
302 */
303     attribute string URL;
304
305 /*! \brief List of %SObjects
306
307     Returns the list of %SObjects which refers to %anObject.
308 */
309     ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
310
311 /*! \brief The date of the last saving of the study
312
313     Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
314 */
315     string GetLastModificationDate() raises(StudyInvalidReference);
316 /*! \brief The list of modification dates of the study
317
318     Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
319       Note : the first modification begins the list.
320 */
321     ListOfDates GetModificationsDate() raises(StudyInvalidReference);
322 /*! \brief Object conversion.
323
324     Converts an object into IOR.
325     \return    IOR
326 */
327     string ConvertObjectToIOR(in Object theObject);
328 /*! \brief Object conversion.
329
330     Converts IOR into an object.
331     \return    An object
332 */
333     Object ConvertIORToObject(in string theIOR);
334
335 /*!  \brief Get a new %UseCaseBuilder.
336 */
337     UseCaseBuilder  GetUseCaseBuilder() raises(StudyInvalidReference);
338
339 /*! \brief  Close the components in the study, remove itself from the %StudyManager.
340 */
341     void Close() raises(StudyInvalidReference);
342
343 /*! \brief  Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
344 */
345     void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
346
347 /*!
348     Functions for internal usage only
349 */
350     void AddPostponed(in string theIOR) raises(StudyInvalidReference);
351
352     void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
353
354     void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
355
356     void UndoPostponed(in long theWay) raises(StudyInvalidReference);
357
358     boolean DumpStudy(in string thePath,
359                       in string theBaseName,
360                       in boolean isPublished,
361                       in boolean isMultiFile) raises(StudyInvalidReference);
362
363 /*! \brief  Get an AttributeParameter used to store common parameters for given %theSavePoint.
364
365     \param theID identifies a common parameters set (Example: "Interface Applicative")
366     \param theSavePoint is number of a set of parameters as there can be several sets
367 */
368     AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
369
370 /*! \brief  Get an AttributeParameter used to store parameters for given %theModuleName.
371
372     \param theID identifies a common parameters set (Example: "Interface Applicative")
373     \param theModuleName is a name of the module (Example: "Geometry")
374     \param theSavePoint is number of a set of parameters as there can be several sets
375 */
376     AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
377
378
379 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
380
381     \param theModuleName is a name of the module (Example: "Geometry")
382     \param indent is a string to use for script indentation
383 */
384     string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
385
386 /*!
387     Private method, returns an implementation of this Study.
388    \param theHostname is a hostname of the caller
389    \param thePID is a process ID of the caller
390    \param isLocal is set True if the Study is launched locally with the caller
391 */
392     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
393
394
395 /*! \brief  Mark this Study as being locked by the given locker. 
396
397     The lock status can be checked by method IsStudyLocked
398     \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
399 */
400     void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
401
402 /*! \brief Indicate if the Study is locked
403
404    Returns True if the Study was marked locked. 
405 */
406     boolean IsStudyLocked() raises(StudyInvalidReference);
407
408 /*! \brief  Mark this Study as being unlocked by the given locker. 
409
410      The lock status can be checked by method IsStudyLocked
411     \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
412 */
413     void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
414
415 /*! \brief  Get the list of IDs of the Study's lockers. 
416 */
417     ListOfStrings GetLockerID() raises(StudyInvalidReference);
418
419 /*! \brief  Create real variable with Name theVarName and value theValue 
420
421     (or set if variable value into theValue already exists)
422     \param theVarName is a name of the variable
423     \param theVarName is a value of the variable.
424 */
425     void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
426
427 /*! \brief  Create integer variable with Name theVarName and value theValue 
428
429     (or set if variable value into theValue already exists)
430     \param theVarName is a name of the variable
431     \param theVarName is a value of the variable.
432 */
433     void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
434 /*! \brief  Create boolean variable with Name theVarName and value theValue 
435
436     (or set if variable value into theValue already exists)
437     \param theVarName is a name of the variable
438     \param theVarName is a value of the variable.
439 */
440     void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
441
442 /*! \brief  Create string variable with Name theVarName and value theValue 
443
444     (or set if variable value into theValue already exists)
445     \param theVarName is a name of the variable
446     \param theVarName is a value of the variable.
447 */
448     void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
449
450 /*! \brief  Set current value as double for string variable
451 */
452     void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
453
454 /*! \brief Get value of a real variable
455
456     \param theVarName is a name of the variable.
457 */
458     double GetReal( in string theVarName ) raises(StudyInvalidReference);
459
460 /*! \brief Get value of an integer variable
461
462     \param theVarName is a name of the variable.
463 */
464     long GetInteger( in string theVarName ) raises(StudyInvalidReference);
465
466 /*! \brief Get value of a boolean variable
467
468     \param theVarName is a name of the variable.
469 */
470     boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
471
472 /*! \brief Get value of a string variable
473
474     \param theVarName is a name of the variable.
475 */
476     string GetString( in string theVarName ) raises(StudyInvalidReference);
477     
478
479 /*! \brief Indicate if a variable is real
480
481     Return true if variable is real otherwise return false.
482     \param theVarName is a name of the variable.
483 */
484     boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
485
486 /*! \brief Indicate if a variable is integer
487
488     Return true if variable is integer otherwise return false.
489     \param theVarName is a name of the variable.
490 */
491     boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
492
493 /*! \brief Indicate if a variable is boolean
494
495     Return true if variable is boolean otherwise return false.
496     \param theVarName is a name of the variable.
497 */
498     boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
499
500 /*! \brief Indicate if a variable is string
501
502     Return true if variable is string otherwise return false.
503     \param theVarName is a name of the variable.
504 */
505     boolean IsString( in string theVarName ) raises(StudyInvalidReference);
506
507 /*! \brief Indicate if a variable exists in the study
508
509     Return true if variable exists in the study,
510     otherwise return false.
511     \param theVarName is a name of the variable.
512 */
513     boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
514
515 /*! \brief Get names of all variables from the study.
516 */
517     ListOfStrings GetVariableNames() raises(StudyInvalidReference);
518
519 /*! \brief Remove a variable
520
521    Remove variable with the specified name from the study with substitution of its value.
522
523    \param theVarName Name of the variable.
524    \return Status of operation.
525 */
526     boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
527
528 /*! \brief Rename a variable
529
530    Rename variable with the specified name within the study.
531
532    \param theVarName Name of the variable.
533    \param theNewVarName New name for the variable.
534    \return Status of operation.
535 */
536     boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
537
538 /*! \brief Indicate whether variable is used
539
540    Check that variable is used in the study.
541
542    \param theVarName Name of the variable.
543    \return Variable usage.
544 */
545     boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
546
547 /*! \brief Parse variables used for object creation
548
549    \param string with variables, separated by special symbol. 
550    \return Variables list.
551 */
552     ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
553
554 /*!
555      Attach an observer to the Study
556
557     \param theObserver observer being attached
558     \param modify when \c true, observer receives any object's modification events;
559            otherwise observer receives object's creation events only
560 */
561      void attach(in SALOMEDS::Observer theObserver, in boolean modify);   
562 /*!
563      Detach an observer from the Study
564
565     \param theObserver observer to be detached
566 */
567      void detach(in SALOMEDS::Observer theObserver);   
568   };
569
570   //===========================================================================
571  /*! \brief %SimanStudy Interface
572
573     The Siman (simulation management) study is an interface extension to the %Study
574     with functions for working with SIMAN server. Is allows to get data from SIMAN (check-out operation)
575     and to store it back (check-in operation).
576     This interface is correctly working if SALOME is compiled with SimanIO library, launched with siman
577     option and  connection to SIMAN server is established and alive. Only one study per application,
578     checked out from the SIMAN is SimanStudy. For other studies all functionality is unaccessible.
579 */
580
581   interface SimanStudy
582   {
583
584 //! No connection with SIMAN server
585     exception SimanStudyNoConnection {};
586 //! There is no SimanStudy with: study with checked out data.
587     exception SimanStudyNotExists {};
588
589 /*! \brief The ID of the study in SIMAN server
590
591    This is equivalent to the methods setStudyId() & getStudyId()
592 */
593     attribute string      StudyId;
594     
595 /*! \brief The ID of the scenario in SIMAN server
596
597    This is equivalent to the methods setScenarioId() & getScenarioId()
598 */
599     attribute string      ScenarioId;
600 /*! \brief The ID of the user in SIMAN server
601
602    This is equivalent to the methods setUserId() & getUserId()
603 */
604     attribute string      UserId;
605
606 /*! \brief Get data from SIMAN and put it to the given study
607
608    This method is called for just created study to make it referenced
609    by this Siman study. Also it fills this study by the checked out
610    data from SIMAN server.
611    Warning: StudyID, ScenarioID and User Id must be set before calling of this method!
612
613    \param theTarget referenced study for checking out
614 */
615     void CheckOut(in Study theTarget);
616
617 /*! \brief Get data from the source study and store in SIMAN
618     
619     It works only with already checked out study.
620     \param theModuleName name of the module the check in must be perfrormed for. If empty, check in is performed for all modules.
621 */
622     void CheckIn(in string theModuleName);
623
624 /*! \brief Returns the %Study with checked out data
625
626    If study is null, there is no such study in this application instance, or Salome was
627    launched without siman option.
628 */
629     Study getReferencedStudy();
630
631 };
632
633   //==========================================================================
634 /*! \brief %Study Builder Interface
635
636   The purpose of the Builder is to add and/or remove objects and attributes.
637   A %StudyBuilder is linked to a %Study. A
638   command management is provided for the undo/redo functionalities.
639   \note
640   <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
641   item's position in the tree-type structure of the browser. In general it has the following
642   form: <TT>0:2:1:1</TT>
643 */
644   //==========================================================================
645
646   interface StudyBuilder
647   {
648 /*! \brief %LockProtection Exception
649
650     This exception is raised while attempting to modify a locked %study.
651 */
652     exception LockProtection {};
653 /*! \brief Creation of a new %SComponent.
654
655    Creates a new %SComponent
656    \param ComponentDataType    Data type of the %SComponent which will be created.
657
658 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
659
660 */
661     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
662 /*! \brief Definition of the instance to the %SComponent
663
664     Defines the instance to the %SComponent.
665 */
666     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
667         
668 /*! \brief Deletion of a %SComponent
669
670   Removes a %SComponent.
671 */
672     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
673
674 /*! \brief Creation of a new %SObject
675
676    Creates a new %SObject under a definite father %SObject.
677
678    \param theFatherObject The father %SObject under which this one should be created.
679    \return New %SObject
680
681 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
682
683 */
684
685     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
686
687 /*! \brief Creation of a new %SObject with a definite %tag
688
689    Creates a new %SObject with a definite %tag.
690
691    \param atag Long value corresponding to the tag of the new %SObject.
692    \return New %SObject
693
694 */
695     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
696 /*! \brief Deletion of the %SObject
697
698   Removes a %SObject from the %StudyBuilder.
699
700   \param anObject The %SObject to be deleted.
701 */
702     void    RemoveObject   (in SObject anObject) raises(LockProtection);
703 /*! \brief Deletion of the %SObject with all his child objects.
704
705   Removes the %SObject with all his child objects.
706
707   \param anObject The %SObject to be deleted with all child objects.
708 */
709     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
710
711 /*!
712    Loads a %SComponent.
713
714 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
715
716 */
717     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
718 /*!
719    Loads a %SObject.
720
721    \param sco %SObject to be loaded.
722 */
723     void  Load (in SObject sco);
724
725 /*! \brief Looking for or creating an attribute assigned to the %SObject
726
727     Allows to find or create an attribute of a specific type which is assigned to the object.
728     \param anObject        The %SObject corresponding to the attribute which is looked for.
729     \param aTypeOfAttribute     Type of the attribute.
730
731 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
732 */
733
734     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
735                                          in  string         aTypeOfAttribute) raises(LockProtection);
736
737 /*! \brief Looking for an attribute assigned to a %SObject
738
739     Allows to find an attribute of a specific type which is assigned to the object.
740     \param anObject        The %SObject corresponding to the attribute which is looked for.
741     \param aTypeOfAttribute     Type of the attribute.
742     \param anAttribute       Where the attribute is placed if it's found.
743     \return True if it finds an attribute.
744  */
745
746     boolean FindAttribute(in  SObject        anObject,
747                                  out GenericAttribute anAttribute,
748                                  in  string         aTypeOfAttribute);
749 /*! \brief Deleting the attribute assigned to the %SObject
750
751     Removes the attribute of a specific type which is assigned to the object.
752     \param anObject        The %SObject corresponding to the attribute.
753     \param aTypeOfAttribute     Type of the attribute.
754
755 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
756 */
757     void RemoveAttribute(in  SObject        anObject,
758                          in  string         aTypeOfAttribute) raises(LockProtection);
759 /*!
760     Adds a reference between %anObject and %theReferencedObject.
761     \param anObject The %SObject which will get a reference
762     \param theReferencedObject The %SObject having a reference
763 */
764
765     void Addreference(in SObject anObject,
766                       in SObject theReferencedObject) ;
767
768 /*!
769     Removes a reference from %anObject to another object.
770     \param anObject The %SObject which contains a reference
771 */
772
773     void RemoveReference(in SObject anObject) ;
774
775 /*!
776    Adds a directory in the %Study.
777    \param theName String parameter defining the name of the directory.
778
779 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
780
781 */
782     void AddDirectory(in string theName) raises(LockProtection);
783
784 /*! \brief Identification of the %SObject's substructure.
785
786       Identification of the %SObject's substructure by GUID.
787
788
789       \param anObject The %SObject which will be identified
790       \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
791 */
792
793      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
794 /*!
795 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
796
797 \param anObject A definite %SObject which will be identified
798 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
799 */
800      boolean IsGUID(in SObject anObject, in string theGUID);
801
802 /*! \brief Creation of a new command
803
804    Creates a new command which can contain several different actions.
805    
806 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
807
808 */
809     void NewCommand(); // command management
810 /*! \brief Execution of the command
811
812    Commits all actions declared within this command.
813
814    \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
815
816 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
817
818 */
819     void CommitCommand() raises(LockProtection); // command management
820 /*!
821     Returns True if at this moment there is a command under execution.
822 */
823     boolean HasOpenCommand();
824 /*! \brief Cancelation of the command
825
826     Cancels all actions declared within the command.
827     
828 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
829 */
830     void AbortCommand(); // command management
831 /*! \brief Undolimit
832
833     The number of actions which can be undone
834 */
835     attribute long  UndoLimit;
836 /*! \brief Undo method
837
838     Cancels all actions of the last command.
839
840     \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
841
842 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
843
844 */
845     void Undo() raises (LockProtection);
846 /*! \brief Redo method
847
848     Redoes all actions of the last command.
849
850 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
851
852 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
853
854 */
855     void Redo() raises (LockProtection);
856 /*!
857     Returns True if at this moment there are any actions which can be canceled.
858     
859 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
860
861 */
862     boolean GetAvailableUndos();
863 /*!
864     Returns True if at this moment there are any actions which can be redone.
865
866 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
867
868 */
869     boolean GetAvailableRedos();
870 /*!
871     Puts name attribute with the given string value to the given %SObject
872
873     \param theSO Existing SObject to set name attribute.
874     \param theValue The value to be set to the name attribute.
875 */
876     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
877
878 /*!
879     Puts comment attribute with the given string value to the given %SObject
880
881     \param theSO Existing SObject to set comment attribute.
882     \param theValue The value to be set to the comment attribute.
883 */
884     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
885
886 /*!
887     Puts IOR attribute with the given string value to the given %SObject
888
889     \param theSO Existing SObject to set IOR attribute.
890     \param theValue The value to be set to the IOR attribute.
891 */
892     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
893   };
894
895   //==========================================================================
896 /*! \brief %Study Manager interface
897
898     The purpose of the Manager is to manipulate the %Studies. You will find in this
899     interface the methods to create, open,
900     close, and save a %Study. Since a %SALOME session is multi-document, you will
901     also find the methods allowing to navigate
902     through the collection of studies present in a session.
903 */
904   //==========================================================================
905
906   interface StudyManager
907   {
908 /*!
909     Determines whether the server has already been loaded or not.
910 */
911     void ping();
912
913     void Shutdown();
914
915 /*!
916     Returns the PID of the server
917 */
918     long getPID();
919
920 /*!
921     Shutdown the StudyManager process.
922 */    
923     oneway void ShutdownWithExit();
924
925 /*! \brief Creation of a new study
926
927      Creates a new study with a definite name.
928
929      \param study_name String parameter defining the name of the study
930
931 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
932
933 */
934     Study NewStudy(in string study_name) raises (SALOME::SALOME_Exception);
935
936 /*! \brief Open a study
937
938      Reads and activates the structure of the study %Objects.
939      \param aStudyUrl The path to the study
940     \warning This method doesn't activate the corba objects. Only a component can do it.
941
942 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
943 */
944     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
945
946 /*! \brief Closing the study
947
948     Closes a study.
949 */
950     void  Close(in Study aStudy);
951 /*! \brief Saving the study in a HDF file (or files).
952
953     Saves a study.
954
955     \param theMultiFile If this parameter is True the study will be saved in several files.
956
957 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
958
959 */
960     boolean  Save(in  Study aStudy, in boolean theMultiFile);
961 /*! \brief Saving a study in a ASCII file (or files).
962
963     Saves a study in an ASCII format file (or files).
964     \param theMultiFile If this parameter is True the study will be saved in several files.
965 */
966     boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
967 /*! \brief Saving the study in a specified HDF file (or files).
968
969     Saves the study in a specified file (or files).
970     \param aUrl The path to the definite file in whcih the study will be saved
971     \param aStudy The study which will be saved
972     \param theMultiFile If this parameter is True the study will be saved in several files.
973
974 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
975 */
976     boolean  SaveAs(in URL   aUrl, // if the file already exists
977                 in Study aStudy,
978                 in boolean theMultiFile); // overwrite (as option)
979 /*! \brief Saving the study in a specified ASCII file (or files).
980
981     Saves the study in a specified ASCII file (or files).
982
983     \param aUrl The path to the definite file in whcih the study will be saved
984     \param aStudy The study which will be saved
985     \param theMultiFile If this parameter is True the study will be saved in several files.
986 */
987     boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
988                       in Study aStudy,
989                       in boolean theMultiFile); // overwrite (as option)
990
991
992 /*! \brief List of open studies.
993
994 Gets the list of open studies
995
996     \return A list of open studies in the current session.
997 */
998     ListOfOpenStudies GetOpenStudies();
999
1000 /*! \brief Getting a particular %Study picked by name
1001
1002     Activates a particular %Study
1003     among the session collection picking it by name.
1004     \param aStudyName The name of the study
1005 */
1006     Study GetStudyByName  (in string aStudyName);
1007
1008 /*! \brief Getting a particular %Study picked by ID
1009
1010     Activates a particular %Study
1011     among the session collection picking it by ID.
1012     \param aStudyID The ID of the study
1013 */
1014     Study GetStudyByID  (in short aStudyID);
1015
1016     // copy/paste methods
1017
1018 /*!
1019     Returns True, if the given %SObject can be copied to the clipboard.
1020 */
1021     boolean CanCopy(in SObject theObject);
1022 /*!
1023     Returns True, if the given %SObject is copied to the clipboard.
1024     \param theObject The %SObject which will be copied
1025 */
1026     boolean Copy(in SObject theObject);
1027 /*!
1028     Returns True, if the object from the clipboard can be pasted to the given %SObject.
1029     \param theObject The %SObject stored in the clipboard.
1030 */
1031     boolean CanPaste(in SObject theObject);
1032 /*!
1033     Returns the %SObject in which the object from the clipboard was pasted to.
1034     \param theObject The %SObject which will be pasted
1035     \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
1036     an object into a study, which is protected for modifications.
1037 */
1038     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
1039
1040 /*! \brief Object conversion.
1041
1042     Converts an object into IOR.
1043     \return    IOR
1044 */
1045     string ConvertObjectToIOR(in Object theObject);
1046 /*! \brief Object conversion.
1047             
1048     Converts IOR into an object.
1049     \return    An object
1050 */
1051     Object ConvertIORToObject(in string theIOR); 
1052
1053 /*!
1054     Private method, returns an implementation of this StudyManager.
1055    \param theHostname is a hostname of the caller
1056    \param thePID is a process ID of the caller
1057    \param isLocal is set True if the StudyManager is launched locally with the caller
1058 */
1059     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
1060
1061 /*! \brief Returns the siman study based on the given study.
1062             
1063     Creates a new Siman study, or returns just a previously created.
1064     \return Siman study, or none if it is not siman mode
1065 */
1066     SimanStudy GetSimanStudy();
1067
1068   };
1069
1070
1071   //==========================================================================
1072 /*! \brief %SObject interface
1073
1074    The objects in the %study are built by the %StudyBuilder. The %SObject interface
1075    provides methods for elementary inquiries, like getting an object %ID or its attribuites.
1076  \note
1077  
1078    <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
1079    in the tree-type data structure.
1080    <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
1081    ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
1082 */
1083   //==========================================================================
1084
1085   interface SObject : SALOME::GenericObj
1086   {
1087 /*! Name of the %SObject
1088 */
1089     attribute string Name; // equivalent to setName() & getName()
1090
1091 /*! Returns true if the %SObject does not belong to any %Study
1092 */
1093     boolean IsNull();
1094
1095 /*! Gets an object %ID
1096    \return ID of the %SObject.
1097 */
1098     ID GetID();
1099
1100 /*!  Acquisition of the father %Component of the %SObject
1101   \return The father %Component of the %SObject.
1102 */
1103     SComponent GetFatherComponent();
1104
1105 /*! Acquisition of the father %SObject of the %SObject
1106    \return the father %SObject of the given %SObject.
1107 */
1108     SObject    GetFather();
1109
1110 /*! Gets the %tag of a %SObject
1111     \return the %tag of a %SObject.
1112 */
1113     short      Tag();
1114
1115 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
1116     Returns zero if this %SObject has no children.
1117 */
1118     short      GetLastChildTag();
1119
1120 /*! Gets the depth of a %SObject
1121     \return the depth of a %SObject.
1122 */
1123     short      Depth();
1124
1125 /*! Looks for subobjects of a given %SObject.
1126     \param atag Tag of the given %SObject
1127     \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1128 */
1129     boolean FindSubObject (in long atag, out SObject obj);
1130
1131 /*! Looks for attributes of a given %SObject
1132    \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1133    \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1134
1135 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1136 */
1137     boolean FindAttribute(out GenericAttribute anAttribute,
1138                                   in  string         aTypeOfAttribute);
1139
1140 /*! Looks for a %SObject which the given %SObject refers to.
1141     \return The object which the given %SObject refers to as well as True if it finds
1142     this object.
1143 */
1144     boolean ReferencedObject(out SObject obj); // A REVOIR
1145
1146 /*! Gets all attributes of a given %SObject
1147     \return The list of all attributes of the given %SObject.
1148
1149 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1150
1151 */
1152     ListOfAttributes     GetAllAttributes();
1153
1154 /*! Gets the study of a given %SObject.
1155     \return The study containing the given %SObject.
1156 */
1157     Study GetStudy();
1158
1159 /*! Gets the CORBA object by its own IOR attribute.
1160     Returns nil, if can't.
1161     \return The CORBA object of the %SObject.
1162 */
1163     Object GetObject();
1164
1165 /*!
1166     Returns the name attribute value of this SObject.
1167     Returns empty string if there is no name attribute.
1168 */
1169     string GetName();
1170
1171 /*!
1172     Returns the comment attribute value of this SObject.
1173     Returns empty string if there is no comment attribute.
1174 */
1175     string GetComment();
1176
1177 /*!
1178     Returns the IOR attribute value of this SObject.
1179     Returns empty string if there is no IOR attribute.
1180 */
1181     string GetIOR();
1182
1183 /*!
1184     Set an attribute value (of type string)
1185    \param name the name of the attribute
1186    \param value the value of the attribute
1187 */
1188     void SetAttrString(in string name, in string value);
1189
1190 /*!
1191     Private method, returns an implementation of this SObject.
1192    \param theHostname is a hostname of the caller
1193    \param thePID is a process ID of the caller
1194    \param isLocal is set True if the SObject is launched locally with the caller
1195 */
1196     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1197   };
1198
1199
1200   //==========================================================================
1201 /*! \brief %Generic attribute interface
1202
1203    %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1204 */
1205   //==========================================================================
1206   interface GenericAttribute : SALOME::GenericObj
1207   {
1208 /*! \brief Exception locking all changes
1209
1210     This exception locks all modifications in attributes.
1211 */
1212     exception LockProtection {};
1213 /*! \brief Method CheckLocked
1214
1215    Checks whether the %Study is protected for modifications.
1216
1217    \note <BR>This exception is raised only outside a transaction.
1218 */
1219     void CheckLocked() raises (LockProtection);
1220
1221     //! Get Type
1222     string Type();
1223
1224     //! Get the class type
1225     string GetClassType();      
1226         
1227     //! Get SObject
1228     SObject GetSObject();
1229
1230   //!  Private method, returns an implementation of this GenericAttribute.
1231 /*!
1232    \param theHostname is a hostname of the caller
1233    \param thePID is a process ID of the caller
1234    \param isLocal is set True if the GenericAttribute is launched locally with the caller
1235 */
1236     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1237   };
1238
1239
1240
1241   //==========================================================================
1242 /*! \brief %SComponent interface
1243
1244    The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1245    The %SComponent interface is a specialization of the %SObject interface.
1246    It inherits the most of its methods from the %SObject interface.
1247 */
1248   //==========================================================================
1249   interface SComponent : SObject
1250   {
1251 /*! \brief Gets the data type of the given %SComponent
1252
1253     \return The data type of this %SComponent.
1254 */
1255     string  ComponentDataType();
1256 /*! \brief Gets the IOR of the given component
1257
1258   \return True (if there is an instance of the given component) and its IOR.
1259 */
1260     boolean ComponentIOR (out ID theID); //returns True if there is an instance
1261                                          //In this case ID identifies this one
1262   };
1263
1264
1265   //==========================================================================
1266 /*! \brief %SComponentIterator interface
1267
1268   This interface contains the methods allowing to iterate over all components in the list.
1269   The search is started from the first %SComponent in the list.
1270 */
1271   //==========================================================================
1272   interface SComponentIterator : SALOME::GenericObj
1273   {
1274 /*!
1275 \brief Activates the %SComponentIterator.
1276 */
1277     void Init();
1278 /*!  \brief Method More
1279
1280    \return True if there is one more %SComponent in the list.
1281 */
1282     boolean More();
1283 /*!
1284 \brief Moves the iterator to the next %SComponent in the list.
1285 */
1286     void Next();
1287 /*!
1288     \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1289
1290 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1291
1292 */
1293     SComponent Value();
1294   };
1295
1296   //==========================================================================
1297 /*! \brief %ChildIterator interface
1298
1299     This interface contains methods which allow to iterate over all child
1300     levels.
1301 */
1302   //==========================================================================
1303   interface ChildIterator : SALOME::GenericObj
1304   {
1305 /*!
1306
1307 \brief Activates the %ChildIterator.
1308 */
1309     void Init();
1310 /*!
1311
1312 \brief Activates the %ChildIterator for all child levels.
1313
1314 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1315 */
1316     void InitEx(in boolean allLevels);
1317 /*! \brief Method More
1318
1319    \return True if there is one more %ChildIterator in the list.
1320 */
1321     boolean More();
1322 /*!
1323     \brief Passes the iterator to the next level.
1324 */
1325     void Next();
1326 /*!
1327     \brief Returns the %SObject corresponding to the current object found by the iterator.
1328 */
1329     SObject Value();
1330   };
1331
1332   //==========================================================================
1333   //==========================================================================
1334 /*! \brief Interface of the %UseCaseIterator.
1335
1336    This interface contains a set of methods used for iteration over the objects in the use case.
1337 */
1338   interface UseCaseIterator : SALOME::GenericObj
1339   {
1340 /*!
1341 Activates the %UseCaseIterator.
1342 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1343 */
1344     void Init(in boolean allLevels);
1345 /*! Method More
1346
1347     \return True if the %UseCaseIterator finds one more object.
1348 */
1349     boolean More();
1350 /*!
1351     Passes the iterator to the next object.
1352 */
1353     void Next();
1354 /*!
1355     Returns the %SObject corresponding to the current object found by the Iterator.
1356 */
1357     SObject Value();
1358   };
1359
1360   //==========================================================================
1361   //==========================================================================
1362 /*! \brief Interface of the %UseCaseBuilder
1363
1364    Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1365    The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1366 */
1367   interface UseCaseBuilder : SALOME::GenericObj
1368   {
1369 /*!
1370    Adds to the use case an object as a child of the current object of the use case.
1371
1372    \param theObject The added %SObject.
1373    \return True if this %SObject has been added in the use case.
1374 */
1375     boolean Append(in SObject theObject);
1376 /*!
1377    Removes an object from the use case.
1378
1379    \param theObject The deleted %SObject
1380    \return True if this %SObject has been deleted from the use case.
1381 */
1382     boolean Remove(in SObject theObject);
1383 /*!
1384    Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1385 */
1386     boolean AppendTo(in SObject theFather, in SObject theObject);
1387 /*!
1388     Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1389 */
1390     boolean InsertBefore(in SObject theFirst, in SObject theNext);
1391 /*!
1392     Sets the current object of the use case.
1393 */
1394     boolean SetCurrentObject(in SObject theObject);
1395 /*!
1396     Makes the root object to be the current object of the use case.
1397 */
1398     boolean SetRootCurrent();
1399 /*!
1400    Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1401 */
1402     boolean HasChildren(in SObject theObject);
1403 /*!
1404    Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1405 */
1406     boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1407 /*!
1408    Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1409 */
1410     SObject GetFather(in SObject theObject);
1411 /*!
1412    Sets the name of the use case.
1413 */
1414     boolean SetName(in string theName);
1415 /*!
1416    Gets the name of the use case.
1417 */
1418     string GetName();
1419 /*!
1420    Returns True if the given object <VAR>theObject</VAR> represents a use case.
1421 */
1422     boolean IsUseCase(in SObject theObject);
1423 /*!
1424    Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1425 */
1426     boolean IsUseCaseNode(in SObject theObject);
1427 /*!
1428     Gets the current object of the use case.
1429 */
1430     SObject GetCurrentObject();
1431 /*!
1432     Creates a new use case in the use case browser.
1433 */
1434     SObject AddUseCase(in string theName);
1435 /*!
1436     Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1437 */
1438     UseCaseIterator GetUseCaseIterator(in SObject theObject);
1439   };
1440   //==========================================================================
1441 /*! \brief %Driver interface
1442
1443 This class represents a common tool for all components integrated into SALOME application, that allows them to communicate with the study. It contains a set of methods which
1444 can be called by any component and which provide the following functionality:
1445 <ul>
1446     <li> publishing in the study of the objects created by a definite component
1447     <li> saving/loading of the data created by a definite component. These methods are called by the StudyManager when loading/saving a study containing the data created by a definite component.
1448     <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1449     <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1450 </ul>
1451
1452 */
1453   //==========================================================================
1454   interface Driver
1455   {
1456
1457     /*! \brief Saving the data produced by a definite component.
1458
1459         This method is called by the StudyManager when saving a study.
1460        \param theComponent    %SComponent corresponding to this Component
1461        \param theURL  The path to the file in which the data will be saved.
1462        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1463        \return A byte stream TMPFile that contains all saved data
1464
1465 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1466
1467      */
1468
1469
1470     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1471
1472 /*! \brief Saving the data in ASCII format produced by a definite component.
1473
1474         This method is called by the StudyManager when saving a study in ASCII format.
1475        \param theComponent    %SComponent corresponding to this Component
1476        \param theURL  The path to the file in which the data will be saved.
1477        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1478        \return A byte stream TMPFile that will contain all saved data
1479
1480 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1481
1482      */
1483     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1484
1485     /*! \brief Loading the data.
1486
1487        This method is called by the StudyManager when opening a study.
1488        \param theComponent      %SComponent corresponding to this Component
1489        \param theStream   The file which contains all data saved by the component on Save method
1490        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1491
1492      */
1493
1494     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1495
1496     /*! \brief Loading the data from files in ASCII format.
1497
1498        This method is called by the StudyManager when opening a study.
1499        \param theComponent      %SComponent corresponding to this Component
1500        \param theStream   The file which contains all data saved by the component on Save method
1501        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1502
1503      */
1504
1505     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1506
1507     /*! \brief Closing of the study
1508
1509       This method Close is called by the StudyManager when closing a study.
1510     \param aSComponent The according %SComponent
1511      */
1512
1513     void Close (in SComponent aSComponent);
1514     //void Close ( in string  aIORSComponent);
1515
1516     /*! Gets the type of the data
1517
1518         \return The type of data produced by the Component in the study.
1519      */
1520
1521      string ComponentDataType();
1522
1523     // Driver Transient -> persistent called for each object in study
1524 /*!
1525    Transforms IOR of a given %SObject into PersistentID. It is called for each
1526    object in the %study.
1527 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1528 study is saved these references are transformed into persintent IDs.
1529
1530    \param theSObject The given %SObject.
1531    \param IORString The IOR of the given %SObject.
1532    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1533    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1534
1535    \return The persistent ID of the given %SObject
1536
1537 */
1538     string IORToLocalPersistentID (in SObject theSObject,
1539                                    in string IORString,
1540                                    in boolean isMultiFile,
1541                                    in boolean isASCII);
1542 /*!
1543   Transforms PersistentID into IOR of the object. It is called for each
1544    object in the %study.
1545
1546    \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1547 study is open, these references are transformed into persintent IORs.
1548
1549    \param theSObject The given %SObject.
1550    \param IORString The IOR of the given %SObject.
1551    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1552    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1553
1554    \return The IOR of the given %SObject
1555
1556 */
1557     string LocalPersistentIDToIOR (in SObject theSObject,
1558                                    in string aLocalPersistentID,
1559                                    in boolean isMultiFile,
1560                                    in boolean isASCII)
1561       raises (SALOME::SALOME_Exception);
1562
1563     // Publishing in the study
1564 /*! Publishing in the study
1565
1566     \return True if the given %Component can publish a definite object with a given IOR in the %study.
1567     \param theIOR The IOR of a definite object
1568 */
1569     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1570 /*! \brief Publishing in the study
1571
1572    Publishes the given object in the %study, using the algorithm of this component.
1573     \param theStudy     The %study in which the object is published
1574     \param theSObject     If this parameter is null the object is published for the first time. Otherwise
1575     this parameter should contain a reference to the object published earlier
1576     \param theObject      The object which is published
1577     \param theName      The name of the published object. If this parameter is empty, the name is generated
1578     automatically by the component.
1579
1580     \return The published %SObject.
1581 */
1582     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1583
1584     // copy/paste methods
1585
1586 /*!
1587     Returns True, if the given %SObject can be copied to the clipboard.
1588
1589     \param theObject The given %SObject which should be copied.
1590 */
1591     boolean CanCopy(in SObject theObject);
1592 /*!
1593     Returns the object %ID and the %TMPFile of the object from the given %SObject.
1594 */
1595     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1596 /*!
1597     Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1598 */
1599     boolean CanPaste(in string theComponentName, in long theObjectID);
1600 /*!
1601     Returns the %SObject of the pasted object.
1602 */
1603     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
1604
1605   };
1606 };
1607
1608 #endif