Salome HOME
This commit was generated by cvs2git to create tag 'V1_3_0'.
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 //
20 //
21 //
22 //  File   : SALOMEDS.idl
23 //  Author : Yves FRICAUD
24 //  $Header$
25
26 /*! \mainpage 
27     \image html Application-About.png    
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
40 /*!
41      This package contains the interfaces used for creation, managment
42      and modification of the %Study
43 */
44 module SALOMEDS
45 {
46 /*! \typedef URL
47     Name of the file in which the %Study is saved.
48
49 */
50   typedef string URL;
51
52 /*! Main identifier of an object in %SALOME application
53 */
54   typedef string ID;
55
56 /*! While saving the data, IOR is transformed into persistent reference
57 */
58   typedef string PersistentReference;
59
60 /*! IOR of the study in %SALOME application
61 */
62   typedef string SalomeReference;
63
64 /*! List of the names of studies which are currently open in this %SALOME session.
65 Since %SALOME is a multi-study application, it allows to open a lot of studies 
66 during each working session.
67 */
68   typedef sequence<string> ListOfOpenStudies;
69 /*! List of file names
70 */
71   typedef sequence<string> ListOfFileNames;
72 /*! List of modification dates of the study
73 */
74   typedef sequence<string> ListOfDates ;
75 /*! An unbounded sequence of strings
76 */
77   typedef sequence<string> ListOfStrings ;
78 /*! A byte stream which is used for binary data transfer between components
79 */
80   typedef sequence<octet> TMPFile;
81
82   // Reference to other objects is treated with function AddReference
83   // and ReferencedObject
84   // All other type of attributes defined in AttributeType enum are
85   // treated with AddAdttribute and GetAttribute
86   // The difference is made because Reference attribute don't contain
87   // strings but reference to ID of other objects
88
89   interface GenericAttribute;
90   interface Study;
91   interface StudyManager;
92   interface StudyBuilder;
93   interface SObject;
94   interface SComponent;
95   interface SComponentIterator;
96   interface ChildIterator;
97   interface Driver;
98   interface AttributeStudyProperties;
99   interface UseCaseIterator;
100   interface UseCaseBuilder;
101   interface Callback;
102
103 /*! List of attributes
104 */
105   typedef sequence<GenericAttribute> ListOfAttributes;
106
107 /*! Exception indicating that this feature hasn't been implemented. 
108 */
109   exception NotImplemented {};
110
111
112   //===========================================================================
113  /*! \brief %Study Interface
114
115     The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
116    Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
117    What is left in the %Study interface are elementary inquiries.
118    (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
119       and set methods.) A %Study is explored by a set of tools, mainly iterators
120     , which are described further. Nevertheless, the %Study
121      interface allows the search of an object by name or by ID.
122      \note
123      <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
124     In general it's a string of names of directories divided by a slash '/'.
125      <BR><VAR>The Context</VAR> is the current directory of an object.</P>
126 */
127
128   interface Study
129   {
130     exception StudyInvalidContext {};
131     exception StudyInvalidComponent {};
132 /*! Invalid directory of the %study exception
133 */
134     exception StudyInvalidDirectory {};
135 /*! Exception pointing that this name of the study has already been used.
136 */
137     exception StudyNameAlreadyUsed {};
138     exception StudyObjectAlreadyExists {};
139 /*! Invalid name of the %study exception
140 */
141     exception StudyNameError {};
142     exception StudyCommentError {};
143 /*! \brief The name of the %Study
144
145    This is equivalent to the methods setName() & getName()
146 */
147     attribute string     Name; // equivalent to setName() & getName()
148 /*! \brief The ID of the %Study
149
150    This is equivalent to the methods setID() & getID()
151 */
152     attribute short      StudyId;
153 /*! Sequence containing %SObjects
154 */
155     typedef sequence<SObject> ListOfSObject;
156 /*!
157   Gets the persistent reference to the %Study.
158 */
159     PersistentReference  GetPersistentReference();
160 /*!
161   Gets a transient reference to the %Study.
162 */
163     SalomeReference      GetTransientReference();
164
165 /*!
166     Returns True if the %Study is empty
167 */
168     boolean IsEmpty();
169 /*!
170     Allows to find a %SComponent by its name.
171    \param aComponentName    It's a string value in the Comment Attribute of the Component,
172     which is looked for, defining the data type of this Component.
173
174 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
175 */
176     SComponent FindComponent  (in string aComponentName);
177 /*!
178     Allows to find a %SComponent by ID of the according %SObject
179 */
180     SComponent FindComponentID(in ID aComponentID);
181 /*!
182     Allows to find a %SObject by the Name Attribute of this %SObject
183 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
184
185 */
186     SObject       FindObject      (in string anObjectName);
187 /*!
188     Allows to find a %SObject by its ID
189 */
190     SObject       FindObjectID    (in ID aObjectID);
191 /*!
192     Allows to find a %SObject by IOR of the object belonging to this %SObject.
193 */
194     SObject       FindObjectIOR   (in ID aObjectIOR);
195 /*!
196     Returns a list of %SObjects belonging to this %Component. The Name Attribute
197     of these %SObjects should correspond to <VAR>anObjectName</VAR>.
198 */
199     ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
200 /*!
201     Allows to find a %SObject by the path to it.
202 */
203     SObject FindObjectByPath(in string thePath);
204 /*!
205     Returns the path to the %SObject.
206 */
207     string  GetObjectPath(in Object theObject);
208
209 /*!
210     Sets the context of the %Study.
211 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
212
213 */
214     void SetContext(in string thePath);
215 /*!
216     Gets the context of the %Study
217 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
218
219 */
220     string GetContext();
221 /*!
222    Returns a list of names of objects corresponding to the context.
223    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
224 */
225     ListOfStrings GetObjectNames(in string theContext);
226 /*!
227    Returns a list of names of directories and subdirectories corresponding to the context.
228    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
229 */
230     ListOfStrings GetDirectoryNames(in string theContext);
231 /*!
232    Returns a list of names of Files corresponding to the context.
233     \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
234 */
235     ListOfStrings GetFileNames(in string theContext);
236 /*!
237    Returns a list of names of Components corresponding to the context.
238    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
239 */
240     ListOfStrings GetComponentNames(in string theContext);
241 /*! \brief Creation of a new iterator of child levels
242
243     Creates a new iterator of child levels of the %SObject
244 */
245     ChildIterator      NewChildIterator(in SObject aSO);
246 /*! \brief Creation of a new iterator of the %SComponent
247
248     Creates a new iterator of the %SComponent.
249 */
250     SComponentIterator NewComponentIterator();
251 /*! \brief Creation of a %StudyBuilder
252
253    Creates a new %StudyBuilder to add or modify an object in the study.
254 <BR><VAR>See also <A href=exemple/Example20.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
255
256 */
257     StudyBuilder NewBuilder() ;
258 /*! \brief Labels dependency
259
260     Updates the map with IOR attribute. It's an inner method used for optimization.
261 */
262     void UpdateIORLabelMap(in string anIOR, in string anEntry);
263
264 /*! \brief Getting properties of the study
265
266    Returns the attriubte, which contains the properties of this study.
267 <BR><VAR>See also <A href=exemple/Example20.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
268
269 */
270     AttributeStudyProperties GetProperties();
271 /*!
272    Determines whether the %study has been saved
273 */
274     attribute boolean IsSaved;
275 /*!
276   Returns True if the %study has been modified and not saved.
277 */
278     boolean IsModified();
279 /*!
280    Determines the file where the %study has been saved
281 */
282     attribute string  URL;
283
284 /*! \brief List of %SObjects
285
286     Returns the list of %SObjects which refers to %anObject.
287 */
288     ListOfSObject FindDependances(in SObject anObject);
289
290 /*! \brief The date of the last saving of the study
291
292     Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
293 */
294     string GetLastModificationDate();
295 /*! \brief The list of modification dates of the study
296
297     Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
298       Note : the first modification begins the list.
299 */
300     ListOfDates GetModificationsDate();
301 /*! \brief Object conversion.
302
303     Converts an object into IOR.
304     \return    IOR
305 */
306     string ConvertObjectToIOR(in Object theObject);
307 /*! \brief Object conversion.
308
309     Converts IOR into an object.
310     \return    An object
311 */
312     Object ConvertIORToObject(in string theIOR);
313 /*!
314     Gets a new %UseCaseBuilder.
315 */
316     UseCaseBuilder  GetUseCaseBuilder();
317
318 /*!
319     Closes the components in the study, removes itself from the %StudyManager.
320 */
321     void Close();
322
323 /*!
324     Enables(if isEnabled = True)/disables automatic addition of new %SObjects to the use case.
325 */
326     void EnableUseCaseAutoFilling(in boolean isEnabled);
327   };
328
329   //==========================================================================
330 /*! \brief %Study Builder Interface
331
332   The purpose of the Builder is to add and/or remove objects and attributes.
333   A %StudyBuilder is linked to a %Study. A
334   command management is provided for the undo/redo functionalities.
335   \note
336   <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
337   item's position in the tree-type structure of the browser. In general it has the following
338   form: <TT>0:2:1:1</TT>
339 */
340   //==========================================================================
341
342   interface StudyBuilder
343   {
344 /*! \brief %LockProtection Exception
345
346     This exception is raised while attempting to modify a locked %study.
347 */
348     exception LockProtection {};
349 /*! \brief Creation of a new %SComponent.
350
351    Creates a new %SComponent
352    \param ComponentDataType    Data type of the %SComponent which will be created.
353
354 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
355
356 */
357     SComponent NewComponent(in string ComponentDataType);
358 /*! \brief Definition of the instance to the %SComponent
359
360     Defines the instance to the %SComponent.
361 */
362     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR);
363 /*! \brief Deletion of the %SComponent
364
365   Removes the %SComponent.
366 */
367     void       RemoveComponent(in SComponent aComponent);
368
369 /*! \brief Creation of a new %SObject
370
371    Creates a new %SObject.
372 <BR><VAR>See also <A href=exemple/Example18.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
373
374 */
375     SObject NewObject      (in SObject theFatherObject);
376 /*! \brief Creation of a new %SObject with a definite %tag
377
378    Creates a new %SObject with a definite %tag.
379 */
380     SObject NewObjectToTag (in SObject theFatherObject, in long atag);
381 /*! \brief Deletion of the %SObject
382
383   Removes a %SObject from the %StudyBuilder.
384 */
385     void    RemoveObject   (in SObject anObject);
386 /*! \brief Deletion of the %SObject with all his child objects.
387
388   Removes the %SObject with all his child objects.
389 */
390     void    RemoveObjectWithChildren(in SObject anObject);
391
392 /*!
393    Loads a %SComponent.
394 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
395
396 */
397     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
398 /*!
399    Loads a %SObject.
400 */
401     void  Load (in SObject sco);
402
403 /*! \brief Looking for or creating an attribute assigned to the %SObject
404
405     Allows to find or create an attribute of a specific type which is assigned to the object.
406     \param anObject        The %SObject corresponding to the attribute which is looked for.
407     \param aTypeOfAttribute     Type of the attribute.
408
409   <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
410 */
411
412     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
413                                          in  string         aTypeOfAttribute);
414
415 /*! \brief Looking for an attribute assigned to %SObject
416
417     Allows to find an attribute of a specific type which is assigned to the object.
418     \param anObject        The %SObject corresponding to the attribute which is looked for.
419     \param aTypeOfAttribute     Type of the attribute.
420     \param anAttribute       Where the attribute is placed if it's found.
421     \return True if it finds an attribute.
422  */
423
424     boolean FindAttribute(in  SObject        anObject,
425                                  out GenericAttribute anAttribute,
426                                  in  string         aTypeOfAttribute);
427 /*! \brief Deleting the attribute assigned to the %SObject
428
429     Removes the attribute of a specific type which is assigned to the object.
430     \param anObject        The %SObject corresponding to the attribute.
431     \param aTypeOfAttribute     Type of the attribute.
432
433 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
434 */
435     void RemoveAttribute(in  SObject        anObject,
436                                 in  string         aTypeOfAttribute);
437 /*! \brief Addition of a reference
438
439     Adds a reference between %anObject and %theReferencedObject.
440 */
441
442     void Addreference(in SObject anObject,
443                       in SObject theReferencedObject) ;
444 /*!
445    Adds a directory in the %Study.
446 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
447
448 */
449     void AddDirectory(in string theName);
450
451 /*! \brief Identification of the %SObject's substructure.
452
453       Identification of the %SObject's substructure by GUID.
454       It has the following format "00000000-0000-0000-0000-000000000000"
455 */
456
457      void SetGUID(in SObject anObject, in string theGUID);
458 /*!
459
460    Returns True if the %SObject has GUID.
461 */
462      boolean IsGUID(in SObject anObject, in string theGUID);
463
464 /*! \brief Creation of a new command
465
466    Creates a new command which can contain several different actions.
467 <BR><VAR>See also <A href=exemple/Example3.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
468
469 */
470     void NewCommand(); // command management
471 /*! \brief Execution of the command
472
473    Commits all actions declared within this command.
474 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
475
476 */
477     void CommitCommand() raises(LockProtection); // command management
478 /*!
479     Returns True if at this moment there is a command under execution.
480 */
481     boolean HasOpenCommand();
482 /*! \brief Cancelation of the command
483
484     Cancels all actions declared within the command.
485 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
486 */
487     void AbortCommand(); // command management
488 /*! \brief Undolimit
489
490     The number of actions which can be undone
491 */
492     attribute long  UndoLimit;
493 /*! \brief Undo method
494
495     Cancels all actions of the last command.
496 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
497
498 */
499     void Undo() raises (LockProtection);
500 /*! \brief Redo method
501
502     Redoes all actions of the last command.
503  <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
504
505 */
506     void Redo() raises (LockProtection);
507 /*!
508     Returns True if at this moment there are any actions which can be canceled.
509    <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
510
511 */
512     boolean GetAvailableUndos();
513 /*!
514     Returns True if at this moment there are any actions which can be redone.
515    <BR><VAR>See also <A href=exemple/Example3.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
516
517 */
518     boolean GetAvailableRedos();
519 /*!
520     Sets the callback for addition of the given %SObject. Returns the previous callback.
521 */
522     Callback SetOnAddSObject(in Callback theCallback);
523 /*!
524     Sets the callback for removal of the given %SObject. Returns the previous callback.
525 */
526     Callback SetOnRemoveSObject(in Callback theCallback);
527
528   };
529
530   //==========================================================================
531 /*! \brief %Study Manager interface
532
533     The purpose of the Manager is to manipulate the %Studies. You will find in this
534     interface the methods to create, open,
535     close, and save a %Study. Since a %SALOME session is multi-document, you will
536     also find the methods allowing to navigate
537     through the collection of studies present in a session.
538 */
539   //==========================================================================
540
541   interface StudyManager
542   {
543 /*!
544     Determines whether the server has already been loaded or not.
545 */
546     void ping();
547
548 /*! \brief Creation of a new %Study
549
550      Creates a new %Study with a definite name.
551 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
552
553 */
554     Study NewStudy(in string study_name);
555
556 /*! \brief Open a study
557
558      Reads and activates the structure of the study %Objects.
559     \warning This method doesn't activate the corba objects. Only a component can do it.
560 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
561 */
562     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
563
564 /*! \brief Closing the study
565
566     Closes the study.
567 */
568     void  Close(in Study aStudy);
569 /*! \brief Saving the study in a HDF file (or files).
570
571     Saves the study.
572     \param theMultiFile If this parameter is True the study will be saved in several files.
573 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
574
575 */
576     void  Save(in  Study aStudy, in boolean theMultiFile);
577 /*! \brief Saving the study in a ASCII file (or files).
578
579     Saves the study in a ASCII format.
580     \param theMultiFile If this parameter is True the study will be saved in several files.
581 */
582     void  SaveASCII(in  Study aStudy, in boolean theMultiFile);
583 /*! \brief Saving the study in a specified HDF file (or files).
584
585     Saves the study in a specified file (or files).
586     \param theMultiFile If this parameter is True the study will be saved in several files.
587
588  <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
589 */
590     void  SaveAs(in URL   aUrl, // if the file already exists
591                 in Study aStudy,
592                 in boolean theMultiFile); // overwrite (as option)
593 /*! \brief Saving the study in a specified ASCII file (or files).
594
595     Saves the study in a specified ASCII file (or files).
596     \param theMultiFile If this parameter is True the study will be saved in several files.
597 */
598     void  SaveAsASCII(in URL   aUrl, // if the file already exists
599                       in Study aStudy,
600                       in boolean theMultiFile); // overwrite (as option)
601
602
603 /*! \brief List of open studies.
604
605     Returns the list of open studies in the current session.
606 */
607     ListOfOpenStudies GetOpenStudies();
608
609 /*! \brief Getting a particular %Study picked by name
610
611     Activates a particular %Study
612     amongst the session collection picking it by name.
613 */
614     Study GetStudyByName  (in string aStudyName);
615
616 /*! \brief Getting a particular %Study picked by ID
617
618     Activates a particular %Study
619     amongst the session collection picking it by ID.
620 */
621     Study GetStudyByID  (in short aStudyID);
622
623     // copy/paste methods
624
625 /*!
626     Returns True, if the given %SObject can be copied to the clipboard.
627 */
628     boolean CanCopy(in SObject theObject);
629 /*!
630     Returns True, if the given %SObject is copied to the clipboard.
631 */
632     boolean Copy(in SObject theObject);
633 /*!
634     Returns True, if the object from the clipboard can be pasted to the given %SObject.
635 */
636     boolean CanPaste(in SObject theObject);
637 /*!
638     Returns the %SObject in which the object from the clipboard was pasted to.
639 */
640     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
641   };
642
643
644   //==========================================================================
645 /*! \brief %SObject interface
646
647    The objects in the %study are built by the %StudyBuilder. The %SObject interface
648    provides methods for elementary inquiries, like getting an object %ID or its attribuites.
649  \note
650    <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
651    in the tree-type data structure.
652    <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
653    ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
654 */
655   //==========================================================================
656
657   interface SObject
658   {
659 /*! Name of the %SObject
660 */
661     attribute string Name; // equivalent to setName() & getName()
662 /*! \brief Getting an object %ID
663
664    Returns ID of the %SObject.
665 */
666     ID GetID();
667 /*! \brief Acquisition of the father %Component of the %SObject
668
669   Returns the father %Component of the %SObject.
670 */
671     SComponent GetFatherComponent();
672 /*! \brief Acquisition of the father %SObject of the %SObject
673
674    Returns the father %SObject of the given %SObject.
675 */
676     SObject    GetFather();
677 /*! \brief %Tag of %SObject
678
679     Returns the %tag of the %SObject.
680 */
681     short      Tag();
682 /*! \brief Looking for subobjects of an object.
683
684     Returns True if it finds a subobject of the %SObject with a definite tag.
685 */
686
687     boolean FindSubObject (in long atag, out SObject obj);
688 /*! \brief Looking for attributes of the %SObject
689
690    Returns True if it finds an attribute of a definite type of the %SObject.
691 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
692 */
693     boolean FindAttribute(out GenericAttribute anAttribute,
694                                   in  string         aTypeOfAttribute);
695 /*!
696     Returns the object which this %SObject refers to. It also returns True if it finds
697     this object.
698 */
699     boolean ReferencedObject(out SObject obj); // A REVOIR
700 /*! \brief Getting all attributes of the %SObject
701
702     Returns the list of all attributes of the %SObject.
703 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
704
705 */
706     ListOfAttributes     GetAllAttributes();
707 /*! \brief Returning the study
708
709     Returns the study containing the given %SObject.
710 */
711     Study GetStudy();
712   };
713
714
715   //==========================================================================
716 /*! \brief %Generic attribute interface
717
718    %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
719 */
720   //==========================================================================
721   interface GenericAttribute
722   {
723 /*! \brief Exception locking all changes
724
725     This exception locks all modifications in attributes.
726 */
727     exception LockProtection {};
728 /*! \brief Method CheckLocked
729
730    Checks whether the %Study is protected for modifications.
731    \note <BR>This exception is raised only outside the transaction.
732 */
733     void CheckLocked() raises (LockProtection);
734   };
735
736
737
738   //==========================================================================
739 /*! \brief %SComponent interface
740
741    The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
742    The %SComponent interface is a specialization of the %SObject interface.
743    It inherits the most of its methods from the %SObject interface.
744 */
745   //==========================================================================
746   interface SComponent : SObject
747   {
748 /*! \brief Data type of the %SComponent
749
750     Returns the data type of the %SComponent.
751 */
752     string  ComponentDataType();
753 /*!
754   Returns IOR of the according component.
755 */
756     boolean ComponentIOR (out ID theID); //returns True if there is an instance
757                                          //In this case ID identifies this one
758   };
759
760
761   //==========================================================================
762 /*! \brief %SComponentIterator interface
763
764   This interface contains the methods allowing to iterate over all components in the list.
765   The search is started from the first %SComponent in the list.
766 */
767   //==========================================================================
768   interface SComponentIterator
769   {
770 /*! \brief Initialization of the Iterator
771
772 Activates the %SComponentIterator.
773 */
774     void Init();
775 /*! \brief Method More
776
777    Returns True if there is one more %SComponent in the list.
778 */
779     boolean More();
780 /*! \brief Moving the iterator to the next %SComponent
781
782 Moves the iterator to the next %SComponent in the list.
783 */
784     void Next();
785 /*!
786     Returns the %SComponent corresponding to the current %SComponent found by the iterator.
787  <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
788
789 */
790     SComponent Value();
791   };
792
793   //==========================================================================
794 /*! \brief %ChildIterator interface
795
796     This interface contains methods which allow to iterate over all child
797     levels.
798 */
799   //==========================================================================
800   interface ChildIterator
801   {
802 /*! \brief Initialization of the Iterator.
803
804 Activates the %ChildIterator.
805 */
806     void Init();
807 /*! \brief Initialization of the Iterator for all child levels.
808
809 Activates the %ChildIterator (if True) for all child levels.
810 */
811     void InitEx(in boolean allLevels);
812 /*! \brief Method More
813
814     Returns True if the %ChildIterator finds one more child level.
815 */
816     boolean More();
817 /*!
818     Passes the iterator to the next level.
819 */
820     void Next();
821 /*!
822     Returns the %SObject corresponding to the current object found by the iterator.
823 */
824     SObject Value();
825   };
826
827   //==========================================================================
828   //==========================================================================
829 /*! \brief Interface of the %UseCaseIterator.
830
831    This interface contains a set of methods used for iteration over the objects in the use case.
832 */
833   interface UseCaseIterator
834   {
835 /*! \brief Initialization of the Iterator.
836
837 Activates the %UseCaseIterator. If <VAR>allLevels</VAR> is True the Iterator is activated for all subobjects.
838 */
839     void Init(in boolean allLevels);
840 /*! \brief Method More
841
842     Returns True if the %UseCaseIterator finds one more object.
843 */
844     boolean More();
845 /*!
846     Passes the iterator to the next object.
847 */
848     void Next();
849 /*!
850     Returns the %SObject corresponding to the current object found by the Iterator.
851 */
852     SObject Value();
853   };
854
855   //==========================================================================
856   //==========================================================================
857 /*! \brief Interface of the %UseCaseBuilder
858
859    Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
860    The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
861 */
862   interface UseCaseBuilder
863   {
864 /*!
865    Adds to the use case an object <VAR>theObject</VAR> as a child of the current object of the use case.
866 */
867     boolean Append(in SObject theObject);
868 /*!
869    Removes an object <VAR>theObject</VAR> from the use case.
870 */
871     boolean Remove(in SObject theObject);
872 /*!
873    Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
874 */
875     boolean AppendTo(in SObject theFather, in SObject theObject);
876 /*!
877     Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
878 */
879     boolean InsertBefore(in SObject theFirst, in SObject theNext);
880 /*!
881     Sets the current object of the use case.
882 */
883     boolean SetCurrentObject(in SObject theObject);
884 /*!
885     Makes the root object to be the current object of the use case.
886 */
887     boolean SetRootCurrent();
888 /*!
889    Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
890 */
891     boolean HasChildren(in SObject theObject);
892 /*!
893    Sets the name of the use case.
894 */
895     boolean SetName(in string theName);
896 /*!
897    Gets the name of the use case.
898 */
899     string GetName();
900 /*!
901    Returns True if the given object <VAR>theObject</VAR> represents a use case.
902 */
903     boolean IsUseCase(in SObject theObject);
904 /*!
905     Gets the current object of the use case.
906 */
907     SObject GetCurrentObject();
908 /*!
909     Creates a new use case in the use case browser.
910 */
911     SObject AddUseCase(in string theName);
912 /*!
913     Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
914 */
915     UseCaseIterator GetUseCaseIterator(in SObject theObject);
916   };
917   //==========================================================================
918   //==========================================================================
919 /*! \brief The callback interface
920
921   The %StudyBuilder can be created with the method <VAR>NewBuilder</VAR>. While invocation of this method a new object of the class <VAR>Callback</VAR> is created
922   and this object is assigned to the newly created Builder as callback which should be called when adding and removing of the ojects.
923 */
924   interface Callback
925   {
926 /*!
927      Invokes the corresponding method <VAR>Append</VAR> of the %UseCaseBuilder.
928 */
929      void OnAddSObject(in SObject theObject);
930 /*!
931      Invokes the corresponding method <VAR>Remove</VAR> of the %UseCaseBuilder.
932 */
933      void OnRemoveSObject(in SObject theObject);
934   };
935
936   //==========================================================================
937 /*! \brief %Driver interface
938
939     This interface contains a set of methods used for the management
940      of the object produced in the %study by a component.
941 */
942   //==========================================================================
943   interface Driver
944   {
945
946     /*! \brief Saving the data.
947
948         This method is called by the StudyManager when saving a study.
949        \param theComponent    %SComponent corresponding to this Component
950        \return A byte stream TMPFile that contains all saved data
951
952 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
953
954      */
955
956
957     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
958
959     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
960
961     /*! \brief Loading the data.
962
963        This method is called by the StudyManager when opening a study.
964        \param theComponent      %SComponent corresponding to this Component
965        \param theStream   The file which contains all data saved by the component on Save method
966      */
967
968     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
969
970     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
971
972     /*! \brief Closing of the study
973
974       This method Close is called by the StudyManager when closing a study.
975
976      */
977
978     void Close (in SComponent aSComponent);
979     //void Close ( in string  aIORSComponent);
980
981     /*! \brief The type of the data
982
983         Returns the type of data produced by the Component in the study.
984      */
985
986      string ComponentDataType();
987
988     // Driver Transient -> persistent called for each object in study
989 /*!
990    Transforms IOR into PersistentID of the object. It is called for each
991    object in the %study.
992 */
993     string IORToLocalPersistentID (in SObject theSObject,
994                                    in string IORString,
995                                    in boolean isMultiFile,
996                                    in boolean isASCII);
997 /*!
998   Transforms PersistentID into IOR of the object. It is called for each
999    object in the %study.
1000 */
1001     string LocalPersistentIDToIOR (in SObject theSObject,
1002                                    in string aLocalPersistentID,
1003                                    in boolean isMultiFile,
1004                                    in boolean isASCII)
1005       raises (SALOME::SALOME_Exception);
1006
1007     // Publishing in the study
1008 /*! \brief Publishing in the study
1009
1010     Returns True if the given %Component can publish the %object in the %study.
1011 */
1012     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1013 /*! \brief Publishing in the study
1014
1015    Publishes the given object in the %study, using the algorithm of this component.
1016     \param theStudy     The %study in which the object is published
1017     \param theSObject     If this parameter is null the object is published for the first time. Otherwise
1018     this parameter should contain a reference to the object published earlier
1019     \param theObject      The object which is published
1020     \param theName      The name of the published object. If this parameter is empty, the name is generated
1021     automatically by the component.
1022 */
1023     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1024
1025     // copy/paste methods
1026
1027 /*!
1028     Returns True, if the given %SObject can be copied to the clipboard.
1029 */
1030     boolean CanCopy(in SObject theObject);
1031 /*!
1032     Returns the object %ID and the %TMPFile of the object from the given %SObject.
1033 */
1034     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1035 /*!
1036     Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1037 */
1038     boolean CanPaste(in string theComponentName, in long theObjectID);
1039 /*!
1040     Returns the %SObject of the pasted object.
1041 */
1042     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
1043
1044   };
1045 };
1046
1047 #endif