Salome HOME
Merging with WPDev
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder_i.hxx
1 // Copyright (C) 2005  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 //  File   : SALOMEDS_StudyBuilder_i.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef __SALOMEDS_STUDYBUILDER_I_H__
25 #define __SALOMEDS_STUDYBUILDER_I_H__
26
27 #include "SALOMEDS_Defines.hxx"
28
29 // std C++ headers
30 #include <iostream>
31
32 // IDL headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SALOMEDS)
35 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
36
37 #include "SALOMEDSImpl_StudyBuilder.hxx"
38
39 // Cascade header
40 #include <TDocStd_Document.hxx>
41
42 class SALOMEDS_EXPORT SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder,
43                                public PortableServer::RefCountServantBase 
44 {
45 private:
46   CORBA::ORB_ptr                    _orb;
47   Handle(SALOMEDSImpl_StudyBuilder) _impl;  // OCAF Document
48 public:
49     
50   SALOMEDS_StudyBuilder_i(const Handle(SALOMEDSImpl_StudyBuilder), CORBA::ORB_ptr);
51
52   ~SALOMEDS_StudyBuilder_i();
53
54   //! NewComponent
55   /*!
56     \param ComponentDataType    
57     \return <ReturnValue>
58   */
59   virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
60
61   //! DefineComponentInstance
62   /*!
63     \param SComponent_ptr       
64     \param ComponentIOR 
65   */
66   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
67   
68   //! 
69   /*!
70     <long-description>
71
72     \param aComponent   
73   */
74   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
75
76   //! 
77   /*!
78     <long-description>
79
80     \param theFatherObject      
81     \return <ReturnValue>
82   */
83   virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
84   //! 
85   /*!
86     <long-description>
87
88     \param theFatherObject      
89     \param atag 
90     \return <ReturnValue>
91   */
92   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
93
94   /*!
95     The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
96   */
97   virtual void AddDirectory(const char* thePath);
98
99   virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
100     throw(SALOME::SALOME_Exception);
101   virtual void Load(SALOMEDS::SObject_ptr sco);
102
103   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
104   virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
105
106   virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
107   virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
108   virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
109
110   virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
111
112   virtual void RemoveReference(SALOMEDS::SObject_ptr me);
113
114   virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
115   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
116
117   virtual void NewCommand();
118   virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
119   virtual CORBA::Boolean HasOpenCommand();
120   virtual void AbortCommand();
121   virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
122   virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
123   CORBA::Boolean GetAvailableUndos();
124   CORBA::Boolean GetAvailableRedos();
125   CORBA::Boolean IsSaved();
126   CORBA::Boolean IsModified();
127   virtual CORBA::Long UndoLimit();
128   virtual void UndoLimit(CORBA::Long);
129
130   void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
131
132   virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
133   virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
134   virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
135 };
136 #endif