Salome HOME
0023299: [CEA] Finalize multi-study removal
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_Study.hxx
index a4a07b9055804daeb6d0032b5b7cebaf1114a757..bd8f55faf9b491937c06c28a5e69d892c6adf346 100644 (file)
@@ -51,7 +51,7 @@
 #include "SALOMEDSImpl_ChildIterator.hxx" 
 #include "SALOMEDSImpl_GenericVariable.hxx"
 
-class SALOMEDSImpl_StudyManager;
+class HDFgroup;
 class SALOMEDSImpl_GenericAttribute;
 
 
@@ -59,10 +59,11 @@ class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Study
 {
 private:
   std::string              _name;  
+  DF_Application*          _appli;
   DF_Document*             _doc;  // Document
+  DF_Document*             _clipboard;
   bool                     _Saved; // True if the Study is saved
   std::string              _URL; //URL of the persistent reference of the study
-  int                      _StudyId; 
   DF_Label                 _current;
   bool                     _autoFill; 
   std::string              _errorCode;
@@ -98,11 +99,58 @@ public:
   static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute);
 
    //! standard constructor
-   SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name);
+   SALOMEDSImpl_Study();
   
   //! standard destructor
   virtual ~SALOMEDSImpl_Study(); 
   
+  virtual void Init();
+  virtual void Clear();
+
+  //! method to Open a Study from it's persistent reference
+  virtual bool Open(const std::string& aStudyUrl);
+
+  //! method to save a Study
+  virtual bool Save(SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile);
+
+  virtual bool SaveASCII(SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile);
+
+  //! method to save a Study to the persistent reference aUrl
+  virtual bool SaveAs(const std::string& aUrl,
+                      SALOMEDSImpl_DriverFactory* aFactory,
+                      bool theMultiFile);
+
+  virtual bool SaveAsASCII(const std::string& aUrl,
+                           SALOMEDSImpl_DriverFactory* aFactory,
+                           bool theMultiFile);
+
+  bool CopyLabel(SALOMEDSImpl_Driver* theEngine,
+                 const int theSourceStartDepth,
+                 const DF_Label& theSource,
+                 const DF_Label& theDestinationMain);
+
+  DF_Label PasteLabel(SALOMEDSImpl_Driver* theEngine,
+                      const DF_Label& theSource,
+                      const DF_Label& theDestinationStart,
+                      const bool isFirstElement);
+
+  virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
+  virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
+  virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
+  virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine);
+
+  // _SaveAs private function called by Save and SaveAs
+  virtual bool Impl_SaveAs(const std::string& aUrl,
+                           SALOMEDSImpl_DriverFactory* aFactory,
+                           bool theMultiFile,
+                           bool theASCII);
+
+  // _SaveObject private function called by _SaveAs
+  virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype);
+
+  virtual bool Impl_SaveProperties(HDFgroup *hdf_group);
+
+
   //! method to Get persistent reference of study (idem URL())
   virtual std::string GetPersistentReference();
 
@@ -174,9 +222,6 @@ public:
  
   //! method to get study name
   virtual std::string Name();
-
-  //! method to set study name
-  virtual void  Name(const std::string& name);
   
   //! method to get if study has been saved
   virtual bool IsSaved();
@@ -195,10 +240,6 @@ public:
 
   virtual bool IsLocked();
   
-  virtual int StudyId();
-
-  virtual void  StudyId(int id);
-  
   virtual void DeleteIORLabelMapItem(const std::string& anIOR);
   virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel);
   
@@ -212,8 +253,6 @@ public:
   
   virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder();
   
-  virtual void Close();
-  
   void EnableUseCaseAutoFilling(bool isEnabled);
   
   virtual std::string GetErrorCode() { return _errorCode; }
@@ -326,7 +365,6 @@ public:
   static void UnRegisterGenObj(const std::string& theIOR, DF_Label label);
   void setGenObjRegister(SALOMEDSImpl_AbstractCallback* theRegister);
 
-  friend class SALOMEDSImpl_StudyManager;    
   friend class SALOMEDSImpl_GenericAttribute;
   friend class SALOMEDSImpl_GenericVariable;
 };