Salome HOME
merge from branch BR_V5_DEV
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder_i.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SALOMEDS_StudyBuilder_i.hxx
23 //  Author : Sergey RUIN
24 //  Module : SALOME
25 //
26 #ifndef __SALOMEDS_STUDYBUILDER_I_H__
27 #define __SALOMEDS_STUDYBUILDER_I_H__
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 class SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder
40 {
41 private:
42   CORBA::ORB_ptr                    _orb;
43   SALOMEDSImpl_StudyBuilder*        _impl;  
44 public:
45     
46   SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder*, CORBA::ORB_ptr);
47
48   ~SALOMEDS_StudyBuilder_i();
49
50   //! NewComponent
51   /*!
52     \param ComponentDataType    
53     \return <ReturnValue>
54   */
55   virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
56
57   //! DefineComponentInstance
58   /*!
59     \param SComponent_ptr       
60     \param ComponentIOR 
61   */
62   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
63   
64   //! 
65   /*!
66     <long-description>
67
68     \param aComponent   
69   */
70   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
71
72   //! 
73   /*!
74     <long-description>
75
76     \param theFatherObject      
77     \return <ReturnValue>
78   */
79   virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
80   //! 
81   /*!
82     <long-description>
83
84     \param theFatherObject      
85     \param atag 
86     \return <ReturnValue>
87   */
88   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
89
90   /*!
91     The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
92   */
93   virtual void AddDirectory(const char* thePath);
94
95   virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
96     throw(SALOME::SALOME_Exception);
97   virtual void Load(SALOMEDS::SObject_ptr sco);
98
99   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
100   virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
101
102   virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
103   virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
104   virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
105
106   virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
107
108   virtual void RemoveReference(SALOMEDS::SObject_ptr me);
109
110   virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
111   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
112
113   virtual void NewCommand();
114   virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
115   virtual CORBA::Boolean HasOpenCommand();
116   virtual void AbortCommand();
117   virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
118   virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
119   CORBA::Boolean GetAvailableUndos();
120   CORBA::Boolean GetAvailableRedos();
121   CORBA::Boolean IsSaved();
122   CORBA::Boolean IsModified();
123   virtual CORBA::Long UndoLimit();
124   virtual void UndoLimit(CORBA::Long);
125
126   void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
127
128   virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
129   virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
130   virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
131
132   SALOMEDSImpl_StudyBuilder* GetImpl() { return _impl; }
133
134 };
135 #endif