Salome HOME
Clear info panel when module is deactivated
[modules/gui.git] / src / LightApp / LightApp_Application.h
index cd9ce2e159e5633b75975d48701bdb29235e60e6..c6e43cf47ee0b550a4e22fcb3acf66c3f7d70a22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -40,6 +40,7 @@
 #include <QStringList>
 
 class LogWindow;
+class QtxInfoPanel;
 #ifndef DISABLE_PYCONSOLE
 class PyConsole_Console;
 class PyConsole_Interp;
@@ -75,6 +76,7 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application, public SUIT
 
 public:
   typedef enum { WT_ObjectBrowser,
+                WT_InfoPanel,
 #ifndef DISABLE_PYCONSOLE
                  WT_PyConsole,
 #endif
@@ -89,6 +91,7 @@ public:
          PreferencesId, MRUId, ModulesListId,
          NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId,
          NewQxSceneViewId, NewGraphicsViewId, NewPVViewId, NewPyViewerId, StyleId, FullScreenId,
+         WebSiteId, ForumId, VideosId, TutorialsId,
          UserID };
 
 protected:
@@ -110,6 +113,7 @@ public:
 
   LogWindow*                          logWindow();
   SUIT_DataBrowser*                   objectBrowser();
+  QtxInfoPanel*                       infoPanel();
 #ifndef DISABLE_PYCONSOLE
   PyConsole_Console*                  pythonConsole(const bool force = false);
 #endif
@@ -135,7 +139,7 @@ public:
   virtual SUIT_ViewManager*           createViewManager( const QString& vmType, QWidget* w );
   virtual SUIT_ViewManager*           createViewManager( SUIT_ViewModel* );
 
-  QWidget*                            getWindow( const int, const int = -1 );
+  QWidget*                            getWindow( const int );
   QWidget*                            dockWindow( const int ) const;
   void                                removeDockWindow( const int );
   void                                insertDockWindow( const int, QWidget* );
@@ -154,8 +158,6 @@ public:
 
   void                                setDefaultStudyName( const QString& theName );
 
-  static int                          studyId();
-
   virtual bool                        event( QEvent* );
 
   virtual bool                        checkDataObject( LightApp_DataObject* theObj );
@@ -180,9 +182,12 @@ public:
   void                                emitOperationFinished( const QString&, const QString&, const QStringList& );
 
   void                                updateVisibilityState( DataObjectList& theList,
-                                                             SUIT_ViewModel* theViewModel );  
+                                                             SUIT_ViewModel* theViewModel );
+
+  void                                updatePresentations( const QString& theComponent,
+                                                           const QStringList& theViewManagerTypes );
 
-  virtual bool                        checkExistingDoc();
+  virtual bool                        checkExistingDoc( bool = true );
 
 #ifndef DISABLE_PYCONSOLE
   PyConsole_Interp*                   getPyInterp();
@@ -210,6 +215,7 @@ public slots:
   virtual void                        onDockWindowVisibilityChanged( bool );
 
 protected:
+  void                                showHelp( const QString& );
   virtual void                        createActions();
   virtual void                        createActionForViewer( const int id,
                                                              const int parentId,
@@ -223,9 +229,12 @@ protected:
   virtual void                        setActiveStudy( SUIT_Study* );
   virtual void                        updateCommandsStatus();
 
+  virtual bool                        canOpenDoc( const QString& );
+
   virtual void                        beforeCloseDoc( SUIT_Study* );
   virtual void                        afterCloseDoc();
   virtual void                        moduleAdded( CAM_Module* );
+  virtual void                        moduleDeactivated( CAM_Module* );
   virtual bool                        activateModule( CAM_Module* = 0 );
 
   LightApp_Preferences*               preferences( const bool ) const;
@@ -248,7 +257,7 @@ protected slots:
   virtual void                        onWindowActivated( SUIT_ViewWindow* theViewWindow );
 
   void                                onNewWindow();
-  void                                onModuleActivation( const QString& );
+  virtual void                        onModuleActivation( const QString& );
   void                                onCloseView( SUIT_ViewManager* );
 
   virtual void                        onStudyCreated( SUIT_Study* );
@@ -265,6 +274,8 @@ protected slots:
 
   virtual void                        onDesktopMessage( const QString& );
 
+  virtual void                        onInfoPanelShown();
+
 private slots:
   void                                onSelection();
   void                                onRefresh();
@@ -308,12 +319,13 @@ protected:
   virtual bool                        openAction( const int, const QString& );
 
   void                                showPreferences( const QString& = QString() );
+  void                                showPreferences( const QStringList& );
 
 private:
   void                                emptyPreferences( const QString& );
   QList<QToolBar*>                    findToolBars( const QStringList& names = QStringList() );
-  
-  QByteArray                          processState(QByteArray& input, 
+
+  QByteArray                          processState(QByteArray& input,
                                                   const bool processWin,
                                                   const bool processTb,
                                                   const bool isRestoring,
@@ -341,7 +353,6 @@ protected:
 
   static LightApp_Preferences*        _prefs_;
 
-  static int                          lastStudyId;
   QStringList                         myUserWmTypes;
 
   friend void LightAppCleanUpAppResources();