Salome HOME
Copyright update 2022
[modules/gui.git] / src / SalomeApp / SalomeApp_Study.h
index ef5c127fd11caa68c3007ae77ed3723351d8ab8f..7df65abc0e39a074c829ec4c557ffbfac6f88997 100644 (file)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2022  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
+//
 // 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 
+// 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 
+// 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
 //
+
 #ifndef SALOMEAPP_STUDY_H
 #define SALOMEAPP_STUDY_H
 
 #include "SalomeApp.h"
 
 #include <LightApp_Study.h>
-#include <string>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 
 #include "SALOMEDSClient.hxx"
 
-class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
+class SALOMEAPPIMPL_EXPORT SalomeApp_Study : public LightApp_Study
 {
   Q_OBJECT
 
+  class Observer_i;
+
 public:
   SalomeApp_Study( SUIT_Application* );
   virtual ~SalomeApp_Study();
 
-  virtual int         id() const;
+  virtual QString     studyName() const;
 
-  virtual void        createDocument();
+  virtual bool        createDocument( const QString& );
   virtual bool        openDocument( const QString& );
   virtual bool        loadDocument( const QString& );
 
@@ -49,8 +54,11 @@ public:
 
   virtual void        closeDocument(bool permanently = true);
 
+  virtual bool        dump( const QString&, bool, bool, bool );
+
   virtual bool        isSaved()  const;
   virtual bool        isModified() const;
+  virtual void        Modified();
 
   virtual void        addComponent   ( const CAM_DataModel* dm);
 
@@ -66,37 +74,52 @@ public:
   virtual bool        isComponent( const QString& ) const;
   virtual void        children( const QString&, QStringList& ) const;
   virtual void        components( QStringList& ) const;
+  virtual QString     centry( const QString& ) const;
 
   std::vector<int>    getSavePoints();
   void                removeSavePoint(int savePoint);
   QString             getNameOfSavePoint(int savePoint);
   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
-  virtual std::string getVisualComponentName();
+
+  virtual void        restoreState(int savePoint);
+#ifndef DISABLE_PYCONSOLE
+  void                updateFromNotebook(const QString&, bool);
+#endif
+
+  virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
+
+  virtual void        RemoveTemporaryFiles ( const char*, bool, bool = false );
 
 protected:
-  virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
-  virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
-  virtual bool        saveStudyData  (  const QString& theFileName );
-  virtual bool        openStudyData  ( const QString& theFileName );
+  virtual void        saveModuleData ( QString theModuleName, int type, QStringList theListOfFiles );
+  virtual void        openModuleData ( QString theModuleName, int type, QStringList& theListOfFiles );
+  virtual bool        saveStudyData  (  const QString& theFileName, int type );
+  virtual bool        openStudyData  ( const QString& theFileName, int type );
 
-  virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName ) const;
-  virtual void        SetListOfFiles ( const char* theModuleName,
+  virtual std::vector<std::string> GetListOfFiles ( const char* theModuleName, int type ) const;
+  virtual void        SetListOfFiles ( const char* theModuleName, int type,
                                        const std::vector<std::string> theListOfFiles);
-  virtual void        RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile) const;
 
 protected:
   virtual void        dataModelInserted( const CAM_DataModel* );
   virtual bool        openDataModel( const QString&, CAM_DataModel* );
-  void                setStudyDS(const _PTR(Study)& s );
 
+  virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, 
+                                                SUIT_DataObject* theParent ) const;
 protected slots:
   virtual void        updateModelRoot( const CAM_DataModel* );
-
-private:
-  QString             newStudyName() const;
+#ifndef DISABLE_PYCONSOLE
+  void                onNoteBookVarUpdate( QString theVarName );
+#endif
 
 private:
   _PTR(Study)         myStudyDS;
+  Observer_i*         myObserver;
+
+#ifndef DISABLE_PYCONSOLE
+ signals:
+  void                notebookVarUpdated( QString theVarName );
+#endif
 };
 
 #ifdef WIN32