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