Salome HOME
Increment version: 7.5.0
[modules/kernel.git] / idl / SALOMEDS.idl
1 // Copyright (C) 2007-2014  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
1097    \return ID of the %SObject.
1098 */
1099     ID GetID();
1100 /*!  Acquisition of the father %Component of the %SObject
1101
1102   \return The father %Component of the %SObject.
1103 */
1104     SComponent GetFatherComponent();
1105 /*! Acquisition of the father %SObject of the %SObject
1106
1107    \return the father %SObject of the given %SObject.
1108 */
1109     SObject    GetFather();
1110 /*! Gets the %tag of a %SObject
1111
1112     \return the %tag of a %SObject.
1113 */
1114     short      Tag();
1115 /*! Gets the depth of a %SObject
1116
1117     \return the depth of a %SObject.
1118 */
1119     short      Depth();
1120 /*! Looks for subobjects of a given %SObject.
1121
1122     \param atag Tag of the given %SObject
1123     \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1124 */
1125
1126     boolean FindSubObject (in long atag, out SObject obj);
1127 /*! Looks for attributes of a given %SObject
1128
1129    \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1130    \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1131
1132 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1133 */
1134     boolean FindAttribute(out GenericAttribute anAttribute,
1135                                   in  string         aTypeOfAttribute);
1136 /*! Looks for a %SObject which the given %SObject refers to.
1137
1138     \return The object which the given %SObject refers to as well as True if it finds
1139     this object.
1140 */
1141     boolean ReferencedObject(out SObject obj); // A REVOIR
1142 /*! Gets all attributes of a given %SObject
1143
1144     \return The list of all attributes of the given %SObject.
1145
1146 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1147
1148 */
1149     ListOfAttributes     GetAllAttributes();
1150 /*! Gets the study of a given %SObject.
1151
1152     \return The study containing the given %SObject.
1153 */
1154     Study GetStudy();
1155
1156 /*! Gets the CORBA object by its own IOR attribute.
1157     Returns nil, if can't.
1158
1159     \return The CORBA object of the %SObject.
1160 */
1161     Object GetObject();
1162
1163 /*!
1164     Returns the name attribute value of this SObject.
1165     Returns empty string if there is no name attribute.
1166 */
1167     string GetName();
1168
1169 /*!
1170     Returns the comment attribute value of this SObject.
1171     Returns empty string if there is no comment attribute.
1172 */
1173     string GetComment();
1174
1175 /*!
1176     Returns the IOR attribute value of this SObject.
1177     Returns empty string if there is no IOR attribute.
1178 */
1179     string GetIOR();
1180
1181 /*!
1182     Set an attribute value (of type string)
1183    \param name the name of the attribute
1184    \param value the value of the attribute
1185 */
1186     void SetAttrString(in string name, in string value);
1187
1188 /*!
1189     Private method, returns an implementation of this SObject.
1190    \param theHostname is a hostname of the caller
1191    \param thePID is a process ID of the caller
1192    \param isLocal is set True if the SObject is launched locally with the caller
1193 */
1194     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1195   };
1196
1197
1198   //==========================================================================
1199 /*! \brief %Generic attribute interface
1200
1201    %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1202 */
1203   //==========================================================================
1204   interface GenericAttribute : SALOME::GenericObj
1205   {
1206 /*! \brief Exception locking all changes
1207
1208     This exception locks all modifications in attributes.
1209 */
1210     exception LockProtection {};
1211 /*! \brief Method CheckLocked
1212
1213    Checks whether the %Study is protected for modifications.
1214
1215    \note <BR>This exception is raised only outside a transaction.
1216 */
1217     void CheckLocked() raises (LockProtection);
1218
1219     //! Get Type
1220     string Type();
1221
1222     //! Get the class type
1223     string GetClassType();      
1224         
1225     //! Get SObject
1226     SObject GetSObject();
1227
1228   //!  Private method, returns an implementation of this GenericAttribute.
1229 /*!
1230    \param theHostname is a hostname of the caller
1231    \param thePID is a process ID of the caller
1232    \param isLocal is set True if the GenericAttribute is launched locally with the caller
1233 */
1234     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1235   };
1236
1237
1238
1239   //==========================================================================
1240 /*! \brief %SComponent interface
1241
1242    The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1243    The %SComponent interface is a specialization of the %SObject interface.
1244    It inherits the most of its methods from the %SObject interface.
1245 */
1246   //==========================================================================
1247   interface SComponent : SObject
1248   {
1249 /*! \brief Gets the data type of the given %SComponent
1250
1251     \return The data type of this %SComponent.
1252 */
1253     string  ComponentDataType();
1254 /*! \brief Gets the IOR of the given component
1255
1256   \return True (if there is an instance of the given component) and its IOR.
1257 */
1258     boolean ComponentIOR (out ID theID); //returns True if there is an instance
1259                                          //In this case ID identifies this one
1260   };
1261
1262
1263   //==========================================================================
1264 /*! \brief %SComponentIterator interface
1265
1266   This interface contains the methods allowing to iterate over all components in the list.
1267   The search is started from the first %SComponent in the list.
1268 */
1269   //==========================================================================
1270   interface SComponentIterator : SALOME::GenericObj
1271   {
1272 /*!
1273 \brief Activates the %SComponentIterator.
1274 */
1275     void Init();
1276 /*!  \brief Method More
1277
1278    \return True if there is one more %SComponent in the list.
1279 */
1280     boolean More();
1281 /*!
1282 \brief Moves the iterator to the next %SComponent in the list.
1283 */
1284     void Next();
1285 /*!
1286     \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1287
1288 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1289
1290 */
1291     SComponent Value();
1292   };
1293
1294   //==========================================================================
1295 /*! \brief %ChildIterator interface
1296
1297     This interface contains methods which allow to iterate over all child
1298     levels.
1299 */
1300   //==========================================================================
1301   interface ChildIterator : SALOME::GenericObj
1302   {
1303 /*!
1304
1305 \brief Activates the %ChildIterator.
1306 */
1307     void Init();
1308 /*!
1309
1310 \brief Activates the %ChildIterator for all child levels.
1311
1312 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1313 */
1314     void InitEx(in boolean allLevels);
1315 /*! \brief Method More
1316
1317    \return True if there is one more %ChildIterator in the list.
1318 */
1319     boolean More();
1320 /*!
1321     \brief Passes the iterator to the next level.
1322 */
1323     void Next();
1324 /*!
1325     \brief Returns the %SObject corresponding to the current object found by the iterator.
1326 */
1327     SObject Value();
1328   };
1329
1330   //==========================================================================
1331   //==========================================================================
1332 /*! \brief Interface of the %UseCaseIterator.
1333
1334    This interface contains a set of methods used for iteration over the objects in the use case.
1335 */
1336   interface UseCaseIterator : SALOME::GenericObj
1337   {
1338 /*!
1339 Activates the %UseCaseIterator.
1340 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1341 */
1342     void Init(in boolean allLevels);
1343 /*! Method More
1344
1345     \return True if the %UseCaseIterator finds one more object.
1346 */
1347     boolean More();
1348 /*!
1349     Passes the iterator to the next object.
1350 */
1351     void Next();
1352 /*!
1353     Returns the %SObject corresponding to the current object found by the Iterator.
1354 */
1355     SObject Value();
1356   };
1357
1358   //==========================================================================
1359   //==========================================================================
1360 /*! \brief Interface of the %UseCaseBuilder
1361
1362    Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1363    The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1364 */
1365   interface UseCaseBuilder : SALOME::GenericObj
1366   {
1367 /*!
1368    Adds to the use case an object as a child of the current object of the use case.
1369
1370    \param theObject The added %SObject.
1371    \return True if this %SObject has been added in the use case.
1372 */
1373     boolean Append(in SObject theObject);
1374 /*!
1375    Removes an object from the use case.
1376
1377    \param theObject The deleted %SObject
1378    \return True if this %SObject has been deleted from the use case.
1379 */
1380     boolean Remove(in SObject theObject);
1381 /*!
1382    Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1383 */
1384     boolean AppendTo(in SObject theFather, in SObject theObject);
1385 /*!
1386     Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1387 */
1388     boolean InsertBefore(in SObject theFirst, in SObject theNext);
1389 /*!
1390     Sets the current object of the use case.
1391 */
1392     boolean SetCurrentObject(in SObject theObject);
1393 /*!
1394     Makes the root object to be the current object of the use case.
1395 */
1396     boolean SetRootCurrent();
1397 /*!
1398    Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1399 */
1400     boolean HasChildren(in SObject theObject);
1401 /*!
1402    Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1403 */
1404     boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1405 /*!
1406    Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1407 */
1408     SObject GetFather(in SObject theObject);
1409 /*!
1410    Sets the name of the use case.
1411 */
1412     boolean SetName(in string theName);
1413 /*!
1414    Gets the name of the use case.
1415 */
1416     string GetName();
1417 /*!
1418    Returns True if the given object <VAR>theObject</VAR> represents a use case.
1419 */
1420     boolean IsUseCase(in SObject theObject);
1421 /*!
1422    Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1423 */
1424     boolean IsUseCaseNode(in SObject theObject);
1425 /*!
1426     Gets the current object of the use case.
1427 */
1428     SObject GetCurrentObject();
1429 /*!
1430     Creates a new use case in the use case browser.
1431 */
1432     SObject AddUseCase(in string theName);
1433 /*!
1434     Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1435 */
1436     UseCaseIterator GetUseCaseIterator(in SObject theObject);
1437   };
1438   //==========================================================================
1439 /*! \brief %Driver interface
1440
1441 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
1442 can be called by any component and which provide the following functionality:
1443 <ul>
1444     <li> publishing in the study of the objects created by a definite component
1445     <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.
1446     <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1447     <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1448 </ul>
1449
1450 */
1451   //==========================================================================
1452   interface Driver
1453   {
1454
1455     /*! \brief Saving the data produced by a definite component.
1456
1457         This method is called by the StudyManager when saving a study.
1458        \param theComponent    %SComponent corresponding to this Component
1459        \param theURL  The path to the file in which the data will be saved.
1460        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1461        \return A byte stream TMPFile that contains all saved data
1462
1463 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1464
1465      */
1466
1467
1468     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1469
1470 /*! \brief Saving the data in ASCII format produced by a definite component.
1471
1472         This method is called by the StudyManager when saving a study in ASCII format.
1473        \param theComponent    %SComponent corresponding to this Component
1474        \param theURL  The path to the file in which the data will be saved.
1475        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1476        \return A byte stream TMPFile that will contain all saved data
1477
1478 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1479
1480      */
1481     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1482
1483     /*! \brief Loading the data.
1484
1485        This method is called by the StudyManager when opening a study.
1486        \param theComponent      %SComponent corresponding to this Component
1487        \param theStream   The file which contains all data saved by the component on Save method
1488        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1489
1490      */
1491
1492     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1493
1494     /*! \brief Loading the data from files in ASCII format.
1495
1496        This method is called by the StudyManager when opening a study.
1497        \param theComponent      %SComponent corresponding to this Component
1498        \param theStream   The file which contains all data saved by the component on Save method
1499        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1500
1501      */
1502
1503     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1504
1505     /*! \brief Closing of the study
1506
1507       This method Close is called by the StudyManager when closing a study.
1508     \param aSComponent The according %SComponent
1509      */
1510
1511     void Close (in SComponent aSComponent);
1512     //void Close ( in string  aIORSComponent);
1513
1514     /*! Gets the type of the data
1515
1516         \return The type of data produced by the Component in the study.
1517      */
1518
1519      string ComponentDataType();
1520
1521     // Driver Transient -> persistent called for each object in study
1522 /*!
1523    Transforms IOR of a given %SObject into PersistentID. It is called for each
1524    object in the %study.
1525 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1526 study is saved these references are transformed into persintent IDs.
1527
1528    \param theSObject The given %SObject.
1529    \param IORString The IOR of the given %SObject.
1530    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1531    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1532
1533    \return The persistent ID of the given %SObject
1534
1535 */
1536     string IORToLocalPersistentID (in SObject theSObject,
1537                                    in string IORString,
1538                                    in boolean isMultiFile,
1539                                    in boolean isASCII);
1540 /*!
1541   Transforms PersistentID into IOR of the object. It is called for each
1542    object in the %study.
1543
1544    \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1545 study is open, these references are transformed into persintent IORs.
1546
1547    \param theSObject The given %SObject.
1548    \param IORString The IOR of the given %SObject.
1549    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1550    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1551
1552    \return The IOR of the given %SObject
1553
1554 */
1555     string LocalPersistentIDToIOR (in SObject theSObject,
1556                                    in string aLocalPersistentID,
1557                                    in boolean isMultiFile,
1558                                    in boolean isASCII)
1559       raises (SALOME::SALOME_Exception);
1560
1561     // Publishing in the study
1562 /*! Publishing in the study
1563
1564     \return True if the given %Component can publish a definite object with a given IOR in the %study.
1565     \param theIOR The IOR of a definite object
1566 */
1567     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1568 /*! \brief Publishing in the study
1569
1570    Publishes the given object in the %study, using the algorithm of this component.
1571     \param theStudy     The %study in which the object is published
1572     \param theSObject     If this parameter is null the object is published for the first time. Otherwise
1573     this parameter should contain a reference to the object published earlier
1574     \param theObject      The object which is published
1575     \param theName      The name of the published object. If this parameter is empty, the name is generated
1576     automatically by the component.
1577
1578     \return The published %SObject.
1579 */
1580     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1581
1582     // copy/paste methods
1583
1584 /*!
1585     Returns True, if the given %SObject can be copied to the clipboard.
1586
1587     \param theObject The given %SObject which should be copied.
1588 */
1589     boolean CanCopy(in SObject theObject);
1590 /*!
1591     Returns the object %ID and the %TMPFile of the object from the given %SObject.
1592 */
1593     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1594 /*!
1595     Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1596 */
1597     boolean CanPaste(in string theComponentName, in long theObjectID);
1598 /*!
1599     Returns the %SObject of the pasted object.
1600 */
1601     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
1602
1603   };
1604 };
1605
1606 #endif