Salome HOME
Merge from V6_main 11/02/2013
[modules/gui.git] / src / SalomeApp / SalomeApp_Study.h
index 9034b13338165c4baa06da46ec3840e8c231b574..7d53b75b8429cc7647da44864c9765003bbca39b 100644 (file)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  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 
+// 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 
+//
+// 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/
+// 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 )
@@ -34,13 +37,16 @@ class SALOMEAPP_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 +55,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,12 +75,17 @@ 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);
+  void                updateFromNotebook(const QString&, bool);
+
+  virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
 
 protected:
   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
@@ -88,15 +102,21 @@ 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* );
+  void                onNoteBookVarUpdate( QString theVarName );
 
 private:
   QString             newStudyName() const;
 
 private:
   _PTR(Study)         myStudyDS;
+  Observer_i*         myObserver;
+
+ signals:
+  void                notebookVarUpdated( QString theVarName );
 };
 
 #ifdef WIN32