Salome HOME
PR: lib forgotten in case without ihm
[modules/yacs.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 // IDL headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SALOMEDS)
35 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
36
37 // Cascade header
38 #include <TDocStd_Document.hxx>
39
40 class SALOMEDS_Study_i;
41 class SALOMEDS_Callback_i;
42
43 class SALOMEDS_StudyBuilder_i: public virtual POA_SALOMEDS::StudyBuilder,
44                                public virtual PortableServer::RefCountServantBase 
45 {
46   SALOMEDS_StudyBuilder_i(); // Not implemented
47   void operator=(const SALOMEDS_StudyBuilder_i&); // Not implemented
48
49   SALOMEDS_Study_i*        _study;
50   Handle(TDocStd_Document) _doc;  // OCAF Document
51
52   void OnAddSObject(SALOMEDS::SObject_ptr theObject);
53   void OnRemoveSObject(SALOMEDS::SObject_ptr theObject);
54
55 public:
56   SALOMEDS_StudyBuilder_i(SALOMEDS_Study_i* theStudy,
57                           const Handle(TDocStd_Document)& theDocument);
58
59   ~SALOMEDS_StudyBuilder_i();
60
61   CORBA::ORB_var GetORB() const;
62   PortableServer::POA_var GetPOA() const;
63
64   //! NewComponent
65   /*!
66     \param ComponentDataType    
67     \return <ReturnValue>
68   */
69   virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
70
71   //! DefineComponentInstance
72   /*!
73     \param SComponent_ptr       
74     \param ComponentIOR 
75   */
76   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
77   
78   //! 
79   /*!
80     <long-description>
81
82     \param aComponent   
83   */
84   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
85
86   //! 
87   /*!
88     <long-description>
89
90     \param theFatherObject      
91     \return <ReturnValue>
92   */
93   virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
94   //! 
95   /*!
96     <long-description>
97
98     \param theFatherObject      
99     \param atag 
100     \return <ReturnValue>
101   */
102   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
103
104   /*!
105     The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
106   */
107   virtual void AddDirectory(const char* thePath);
108
109   virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
110     throw(SALOME::SALOME_Exception);
111   virtual void Load(SALOMEDS::SObject_ptr sco);
112
113   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
114   virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
115
116   virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
117   virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
118   virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
119
120   virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
121
122   virtual void RemoveReference(SALOMEDS::SObject_ptr me);
123
124   virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
125   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
126
127   virtual void NewCommand();
128   virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
129   virtual CORBA::Boolean HasOpenCommand();
130   virtual void AbortCommand();
131   virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
132   virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
133   CORBA::Boolean GetAvailableUndos();
134   CORBA::Boolean GetAvailableRedos();
135   CORBA::Boolean IsSaved();
136   CORBA::Boolean IsModified();
137   virtual CORBA::Long UndoLimit();
138   virtual void UndoLimit(CORBA::Long);
139
140   void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
141
142   virtual SALOMEDS::Callback_ptr SetOnAddSObject(SALOMEDS::Callback_ptr theCallback);
143   virtual SALOMEDS::Callback_ptr SetOnRemoveSObject(SALOMEDS::Callback_ptr theCallback);
144
145   virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
146   virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
147   virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
148 };
149 #endif