Salome HOME
Merge branch 'occ/shaper2smesh'
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Study_i.hxx
index 2b596f40ff54be97ca93aa6c266e80bae7c2f89c..330f54b7c1f9f62560c051a4184d491298bbd5a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // 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.
+// 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
 #include "SALOMEDS_StudyBuilder_i.hxx"
 #include "SALOMEDS_SObject_i.hxx"
 #include "SALOMEDS_UseCaseBuilder_i.hxx"
+#include "SALOMEDS_Driver_i.hxx"
 
 #include "SALOMEDSImpl_Study.hxx"
 #include "SALOMEDSImpl_AttributeIOR.hxx"
 
-class Notifier;
-
 class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study
 {
 private:
+
+  void                            NameChanged();
   CORBA::ORB_var                 _orb;
   SALOMEDSImpl_Study*            _impl;  
   SALOMEDS_StudyBuilder_i*       _builder;    
-  static std::map<SALOMEDSImpl_Study*, SALOMEDS_Study_i*> _mapOfStudies;
-  Notifier*                      _notifier;
+  SALOMEDSImpl_AbstractCallback* _notifier;
+  SALOMEDSImpl_AbstractCallback* _genObjRegister;
+  SALOMEDS_DriverFactory_i*      _factory;
+  bool                           _closed;
 
 public:
 
   //! standard constructor
-  SALOMEDS_Study_i(SALOMEDSImpl_Study*, CORBA::ORB_ptr);
+  SALOMEDS_Study_i(CORBA::ORB_ptr);
   
   //! standard destructor
-  virtual ~SALOMEDS_Study_i(); 
-  
+
+  virtual ~SALOMEDS_Study_i();
+
+  virtual PortableServer::POA_ptr _default_POA();
+
+  virtual void Init();
+  virtual void Clear();
+
+  //! method to open a Study
+  /*!
+    \param char* arguments, the study URL
+    \return bool arguments
+  */
+  virtual bool Open(const wchar_t* aStudyUrl) throw (SALOME::SALOME_Exception);
+
+  //! method to check that a Study can be opened
+  /*!
+    \param char* arguments, the study URL
+    \return bool arguments
+  */
+  virtual bool CanOpen(const wchar_t* aStudyUrl);
+
+  //! method to save a Study
+  virtual CORBA::Boolean Save(CORBA::Boolean theMultiFile, CORBA::Boolean theASCII);
+
+  //! method to save a Study to the persistent reference aUrl
+  /*!
+    \param char* arguments, the new URL of the study
+  */
+  virtual CORBA::Boolean SaveAs(const wchar_t* aUrl, CORBA::Boolean theMultiFile, CORBA::Boolean theASCII);
+
+  //! method to copy the object
+  /*!
+    \param theObject object to copy
+  */
+  virtual CORBA::Boolean Copy(SALOMEDS::SObject_ptr theObject);
+  virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
+  //! method to paste the object in study
+  /*!
+    \param theObject object to paste
+  */
+  virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection);
+  virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject);
+
   //! method to Get persistent reference of study (idem URL())
   /*!
     \sa URL()
@@ -72,13 +117,6 @@ public:
   */  
   virtual char* GetPersistentReference();
 
-
-  //! method to Get transient reference of study
-  /*!
-    \return char* arguments, the transient reference of the study
-  */  
-  virtual char* GetTransientReference();
-
   //! method to detect if a study is empty
   /*!
     \return bool arguments, true if study is empty
@@ -151,36 +189,6 @@ public:
   */
   virtual char* GetObjectPath(CORBA::Object_ptr theObject);
 
-  //! method to set a context: root ('/') is UserData component
-  /*!
-  */
-  virtual void SetContext(const char* thePath);
-
-  //! method to get a context
-  /*!
-  */
-  virtual char* GetContext();  
-
-  //! method to get all object names in the given context (or in the current context, if 'theContext' is empty)
-  /*!
-  */
-  virtual SALOMEDS::ListOfStrings* GetObjectNames(const char* theContext);
-
-  //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
-  /*!
-  */
-  virtual SALOMEDS::ListOfStrings* GetDirectoryNames(const char* theContext);
-
-  //! method to get all file names in the given context (or in the current context, if 'theContext' is empty)
-  /*!
-  */
-  virtual SALOMEDS::ListOfStrings* GetFileNames(const char* theContext);
-
-  //! method to get all components names
-  /*!
-  */
-  virtual SALOMEDS::ListOfStrings* GetComponentNames(const char* theContext);
-
   //! method to Create a ChildIterator from an SObject 
   /*!
     \param aSO  SObject_ptr arguments
@@ -204,13 +212,13 @@ public:
   /*!
     \return char* arguments, the study name
   */
-  virtual char* Name();
+  virtual wchar_t* Name();
 
   //! method to set study name
   /*!
     \param name char* arguments, the study name
   */
-  virtual void  Name(const char* name);
+  virtual void Name(const wchar_t* name);
 
   //! method to get if study has been saved
   /*!
@@ -237,19 +245,13 @@ public:
   /*!
     \return char* arguments, the study URL 
   */
-  virtual char* URL();
+  virtual wchar_t* URL();
 
  //! method to set URL of the study
   /*!
     \param url char* arguments, the study URL
   */
-  virtual void  URL(const char* url);
-
-  virtual CORBA::Short StudyId();
-  virtual void  StudyId(CORBA::Short id);
-
-  static SALOMEDS::Study_ptr GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb);
-  static SALOMEDS_Study_i* GetStudyServant(SALOMEDSImpl_Study*, CORBA::ORB_ptr orb);
+  virtual void URL(const wchar_t* url);
 
   static void IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute);
 
@@ -268,8 +270,6 @@ public:
 
   virtual SALOMEDS::UseCaseBuilder_ptr GetUseCaseBuilder();
 
-  virtual void Close();
-
   void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled); 
 
   // postponed destroying of CORBA object functionality
@@ -277,17 +277,10 @@ public:
 
   virtual void AddCreatedPostponed(const char* theIOR);
 
-#ifndef WIN32
-  virtual void RemovePostponed(const CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
-                                                        // if theUndoLimit==0, removes all
-  virtual void UndoPostponed(const CORBA::Long theWay); // theWay = 1: resurrect objects,
-                                                // theWay = -1: get back to the list of postponed
-#else
   virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
                                                         // if theUndoLimit==0, removes all
   virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects,
                                                 // theWay = -1: get back to the list of postponed
-#endif
 
   virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
   virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID, 
@@ -347,11 +340,22 @@ public:
                                    CORBA::Boolean isPublished,
                                    CORBA::Boolean isMultiFile);
 
+  virtual char* GetDumpPath();
+
   virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
 
   virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
 
-  virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify);
+  static void SetThePOA(PortableServer::POA_ptr);
+  static PortableServer::POA_ptr GetThePOA();
 
+  void ping(){};
+  CORBA::Long getPID();
+  void ShutdownWithExit();
+
+  void Shutdown();
+
+  virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify);
+  virtual void detach(SALOMEDS::Observer_ptr theObs);
 };
 #endif