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