Salome HOME
DCQ : Merge with Ecole_ete_a6.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder_i.hxx
1 //  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOMEDS_StudyBuilder_i.hxx
25 //  Author : Yves FRICAUD
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef __SALOMEDS_STUDYBUIlDER_I_H__
30 #define __SALOMEDS_STUDYBUILDER_I_H__
31
32
33 // std C++ headers
34 #include <iostream.h>
35
36 // IDL headers
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SALOMEDS)
39 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
40
41 #include "SALOMEDS_AttributeComment_i.hxx"
42 #include "SALOMEDS_AttributePersistentRef_i.hxx"
43 #include "SALOMEDS_AttributeIOR_i.hxx"
44 #include "SALOMEDS_AttributeReal_i.hxx"
45 #include "SALOMEDS_AttributeInteger_i.hxx"
46 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
47 #include "SALOMEDS_AttributeName_i.hxx"
48 #include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
49 #include "SALOMEDS_Callback_i.hxx"
50
51 // Cascade header
52 #include <TDocStd_Document.hxx>
53
54 class SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder,
55                           public PortableServer::RefCountServantBase {
56 private:
57   CORBA::ORB_ptr           _orb;
58   Handle(TDocStd_Document) _doc;  // OCAF Document
59   SALOMEDS::Callback_var   _callbackOnAdd;
60   SALOMEDS::Callback_var   _callbackOnRemove;
61 public:
62     
63   SALOMEDS_StudyBuilder_i(const Handle(TDocStd_Document), CORBA::ORB_ptr);
64
65   ~SALOMEDS_StudyBuilder_i();
66
67   //! NewComponent
68   /*!
69     \param ComponentDataType    
70     \return <ReturnValue>
71   */
72   virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
73
74   //! DefineComponentInstance
75   /*!
76     \param SComponent_ptr       
77     \param ComponentIOR 
78   */
79   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
80   
81   //! 
82   /*!
83     <long-description>
84
85     \param aComponent   
86   */
87   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
88
89   //! 
90   /*!
91     <long-description>
92
93     \param theFatherObject      
94     \return <ReturnValue>
95   */
96   virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
97   //! 
98   /*!
99     <long-description>
100
101     \param theFatherObject      
102     \param atag 
103     \return <ReturnValue>
104   */
105   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
106
107   /*!
108     The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
109   */
110   virtual void AddDirectory(const char* thePath);
111
112   virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
113     throw(SALOME::SALOME_Exception);
114   virtual void Load(SALOMEDS::SObject_ptr sco);
115
116   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
117   virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
118
119   virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
120   virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
121   virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
122
123   virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
124
125   virtual void RemoveReference(SALOMEDS::SObject_ptr me);
126
127   virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
128   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
129
130   virtual void NewCommand();
131   virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
132   virtual CORBA::Boolean HasOpenCommand();
133   virtual void AbortCommand();
134   virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
135   virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
136   CORBA::Boolean GetAvailableUndos();
137   CORBA::Boolean GetAvailableRedos();
138   CORBA::Boolean IsSaved();
139   CORBA::Boolean IsModified();
140   virtual CORBA::Long UndoLimit();
141   virtual void UndoLimit(CORBA::Long);
142
143   void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
144
145   virtual SALOMEDS::Callback_ptr SetOnAddSObject(SALOMEDS::Callback_ptr theCallback);
146   virtual SALOMEDS::Callback_ptr SetOnRemoveSObject(SALOMEDS::Callback_ptr theCallback);
147
148   virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
149   virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
150   virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
151 };
152 #endif