Salome HOME
Removed includes and libraries of OCC
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_StudyBuilder.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   : SALOMEDSImpl_StudyBuilder.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef __SALOMEDSImpl_STUDYBUILDER_H__
25 #define __SALOMEDSImpl_STUDYBUILDER_H__
26
27 // std C++ headers
28 #include <iostream>
29 #include <string>
30 #include <vector>
31  
32 #include "SALOMEDSImpl_Callback.hxx"
33 #include "SALOMEDSImpl_Driver.hxx"
34
35 class SALOMEDSImpl_Study;
36
37 class SALOMEDSImpl_StudyBuilder
38 {
39 private:
40   DF_Document*             _doc;
41   SALOMEDSImpl_Study*      _study;  
42   SALOMEDSImpl_Callback*   _callbackOnAdd;
43   SALOMEDSImpl_Callback*   _callbackOnRemove;
44   std::string              _errorCode;
45
46 public:
47     
48   Standard_EXPORT SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner);
49
50   Standard_EXPORT ~SALOMEDSImpl_StudyBuilder();
51
52   Standard_EXPORT virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType);
53
54   Standard_EXPORT virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR);
55   
56   Standard_EXPORT virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent);
57
58   Standard_EXPORT virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject);
59
60   Standard_EXPORT virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, 
61                                                        const int theTag);
62
63   //! The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
64   Standard_EXPORT virtual bool AddDirectory(const std::string& thePath);
65
66   Standard_EXPORT virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine);
67   Standard_EXPORT virtual bool Load(const SALOMEDSImpl_SObject& sco);
68
69   Standard_EXPORT virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject);
70   Standard_EXPORT virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject);
71
72   Standard_EXPORT virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, 
73                                                               const std::string& aTypeOfAttribute);
74   Standard_EXPORT virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject, 
75                                              DF_Attribute*& anAttribute, 
76                                              const std::string& aTypeOfAttribute);
77
78   Standard_EXPORT virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute);
79
80   Standard_EXPORT virtual bool Addreference(const SALOMEDSImpl_SObject& me, 
81                                             const SALOMEDSImpl_SObject& thereferencedObject);
82
83   Standard_EXPORT virtual bool RemoveReference(const SALOMEDSImpl_SObject& me);
84
85   Standard_EXPORT virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID);
86   Standard_EXPORT virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID);
87
88   Standard_EXPORT virtual void NewCommand();
89   Standard_EXPORT virtual void CommitCommand();
90   Standard_EXPORT virtual bool HasOpenCommand();
91   Standard_EXPORT virtual void AbortCommand();
92   Standard_EXPORT virtual void Undo();
93   Standard_EXPORT virtual void Redo();
94   Standard_EXPORT bool GetAvailableUndos();
95   Standard_EXPORT bool GetAvailableRedos();
96   Standard_EXPORT bool IsSaved();
97   Standard_EXPORT bool IsModified();
98   Standard_EXPORT virtual int UndoLimit();
99   Standard_EXPORT virtual void UndoLimit(const int);
100
101   Standard_EXPORT void CheckLocked();
102
103   Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback);
104   Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback);
105
106   Standard_EXPORT virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
107
108   Standard_EXPORT virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
109
110   Standard_EXPORT virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue);
111
112   Standard_EXPORT virtual std::string GetErrorCode() { return _errorCode; }
113   Standard_EXPORT virtual bool IsError() { return _errorCode != ""; }
114
115   Standard_EXPORT virtual SALOMEDSImpl_Study* GetOwner() { return _study; }
116 };
117 #endif