Salome HOME
NRI : Remove dependence with VISU.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder_i.hxx
1 //  File      : SALOMEDS_StudyBuilder_i.hxx
2 //  Created   : Wed Nov 28 16:26:50 2001
3 //  Author    : Yves FRICAUD
4
5 //  Project   : SALOME
6 //  Module    : SALOMEDS
7 //  Copyright : Open CASCADE 2001
8 //  $Header$
9
10 #ifndef __SALOMEDS_STUDYBUIlDER_I_H__
11 #define __SALOMEDS_STUDYBUILDER_I_H__
12
13
14 // std C++ headers
15 #include <iostream.h>
16
17 // IDL headers
18 #include <SALOMEconfig.h>
19 #include CORBA_SERVER_HEADER(SALOMEDS)
20 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
21
22 #include "SALOMEDS_AttributeComment_i.hxx"
23 #include "SALOMEDS_AttributePersistentRef_i.hxx"
24 #include "SALOMEDS_AttributeIOR_i.hxx"
25 #include "SALOMEDS_AttributeReal_i.hxx"
26 #include "SALOMEDS_AttributeInteger_i.hxx"
27 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
28 #include "SALOMEDS_AttributeName_i.hxx"
29 #include "SALOMEDS_AttributeSequenceOfReal_i.hxx"
30 #include "SALOMEDS_Callback_i.hxx"
31
32 // Cascade header
33 #include <TDocStd_Document.hxx>
34
35 class SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder,
36                           public PortableServer::RefCountServantBase {
37 private:
38   CORBA::ORB_ptr           _orb;
39   Handle(TDocStd_Document) _doc;  // OCAF Document
40   SALOMEDS::Callback_var   _callbackOnAdd;
41   SALOMEDS::Callback_var   _callbackOnRemove;
42 public:
43     
44   SALOMEDS_StudyBuilder_i(const Handle(TDocStd_Document), CORBA::ORB_ptr);
45
46   ~SALOMEDS_StudyBuilder_i();
47
48   //! NewComponent
49   /*!
50     \param ComponentDataType    
51     \return <ReturnValue>
52   */
53   virtual SALOMEDS::SComponent_ptr NewComponent(const char* ComponentDataType);
54
55   //! DefineComponentInstance
56   /*!
57     \param SComponent_ptr       
58     \param ComponentIOR 
59   */
60   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
61   
62   //! 
63   /*!
64     <long-description>
65
66     \param aComponent   
67   */
68   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
69
70   //! 
71   /*!
72     <long-description>
73
74     \param theFatherObject      
75     \return <ReturnValue>
76   */
77   virtual SALOMEDS::SObject_ptr NewObject(SALOMEDS::SObject_ptr theFatherObject);
78   //! 
79   /*!
80     <long-description>
81
82     \param theFatherObject      
83     \param atag 
84     \return <ReturnValue>
85   */
86   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
87
88   /*!
89     The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
90   */
91   virtual void AddDirectory(const char* thePath);
92
93   virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
94     throw(SALOME::SALOME_Exception);
95   virtual void Load(SALOMEDS::SObject_ptr sco);
96
97   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
98   virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
99
100   virtual SALOMEDS::GenericAttribute_ptr FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
101   virtual CORBA::Boolean FindAttribute(SALOMEDS::SObject_ptr anObject, SALOMEDS::GenericAttribute_out anAttribute, const char* aTypeOfAttribute);
102   virtual void RemoveAttribute(SALOMEDS::SObject_ptr anObject, const char* aTypeOfAttribute);
103
104   virtual void Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr thereferencedObject);
105
106   virtual void SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
107   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
108
109   virtual void NewCommand();
110   virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
111   virtual CORBA::Boolean HasOpenCommand();
112   virtual void AbortCommand();
113   virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
114   virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
115   CORBA::Boolean GetAvailableUndos();
116   CORBA::Boolean GetAvailableRedos();
117   CORBA::Boolean IsSaved();
118   CORBA::Boolean IsModified();
119   virtual CORBA::Long UndoLimit();
120   virtual void UndoLimit(CORBA::Long);
121
122   virtual SALOMEDS::Callback_ptr SetOnAddSObject(SALOMEDS::Callback_ptr theCallback);
123   virtual SALOMEDS::Callback_ptr SetOnRemoveSObject(SALOMEDS::Callback_ptr theCallback);
124 };
125 #endif