Salome HOME
[EDF29150] : oops
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder_i.hxx
index b2bddafa5903ee0ab6ed71089a04dc0c9f1b32d6..613ab971c8c442e33f1d37efa696ec548f66abc0 100644 (file)
@@ -1,65 +1,54 @@
-//  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 //  File   : SALOMEDS_StudyBuilder_i.hxx
-//  Author : Yves FRICAUD
+//  Author : Sergey RUIN
 //  Module : SALOME
-//  $Header$
-
-#ifndef __SALOMEDS_STUDYBUIlDER_I_H__
+//
+#ifndef __SALOMEDS_STUDYBUILDER_I_H__
 #define __SALOMEDS_STUDYBUILDER_I_H__
 
+// std C++ headers
+#include <iostream>
+
 // IDL headers
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
 
-// Cascade header
-#include <TDocStd_Document.hxx>
-
-class SALOMEDS_Study_i;
-class SALOMEDS_Callback_i;
+#include "SALOMEDSImpl_StudyBuilder.hxx"
 
-class SALOMEDS_StudyBuilder_i: public virtual POA_SALOMEDS::StudyBuilder,
-                              public virtual PortableServer::RefCountServantBase 
+class SALOMEDS_StudyBuilder_i: public POA_SALOMEDS::StudyBuilder
 {
-  SALOMEDS_StudyBuilder_i(); // Not implemented
-  void operator=(const SALOMEDS_StudyBuilder_i&); // Not implemented
-
-  SALOMEDS_Study_i*        _study;
-  Handle(TDocStd_Document) _doc;  // OCAF Document
-
-  void OnAddSObject(SALOMEDS::SObject_ptr theObject);
-  void OnRemoveSObject(SALOMEDS::SObject_ptr theObject);
-
+private:
+  CORBA::ORB_var                    _orb;
+  SALOMEDSImpl_StudyBuilder*        _impl;  
 public:
-  SALOMEDS_StudyBuilder_i(SALOMEDS_Study_i* theStudy,
-                         const Handle(TDocStd_Document)& theDocument);
+    
+  SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder*, CORBA::ORB_ptr);
 
   ~SALOMEDS_StudyBuilder_i();
 
-  CORBA::ORB_var GetORB() const;
-  PortableServer::POA_var GetPOA() const;
+  virtual PortableServer::POA_ptr _default_POA();
 
   //! NewComponent
   /*!
@@ -71,7 +60,7 @@ public:
   //! DefineComponentInstance
   /*!
     \param SComponent_ptr       
-    \param ComponentIOR        
+    \param ComponentIOR 
   */
   virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
   
@@ -79,7 +68,7 @@ public:
   /*!
     <long-description>
 
-    \param aComponent  
+    \param aComponent   
   */
   virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
 
@@ -101,13 +90,7 @@ public:
   */
   virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag);
 
-  /*!
-    The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
-  */
-  virtual void AddDirectory(const char* thePath);
-
-  virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine)
-    throw(SALOME::SALOME_Exception);
+  virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine); 
   virtual void Load(SALOMEDS::SObject_ptr sco);
 
   virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
@@ -125,11 +108,11 @@ public:
   virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID);
 
   virtual void NewCommand();
-  virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection);
+  virtual void CommitCommand();
   virtual CORBA::Boolean HasOpenCommand();
   virtual void AbortCommand();
-  virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection);
-  virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection);
+  virtual void Undo();
+  virtual void Redo();
   CORBA::Boolean GetAvailableUndos();
   CORBA::Boolean GetAvailableRedos();
   CORBA::Boolean IsSaved();
@@ -137,13 +120,13 @@ public:
   virtual CORBA::Long UndoLimit();
   virtual void UndoLimit(CORBA::Long);
 
-  void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection);
+  void CheckLocked();
+
+  virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue);
+  virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue);
+  virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue);
 
-  virtual SALOMEDS::Callback_ptr SetOnAddSObject(SALOMEDS::Callback_ptr theCallback);
-  virtual SALOMEDS::Callback_ptr SetOnRemoveSObject(SALOMEDS::Callback_ptr theCallback);
+  SALOMEDSImpl_StudyBuilder* GetImpl() { return _impl; }
 
-  virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
-  virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
-  virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection);
 };
 #endif