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