Salome HOME
Support both 5.5 and 5.6 version of ParaView
[modules/gui.git] / src / TOOLSGUI / ToolsGUI_RegWidget.h
index 1c9b3d5492055098a73b9bdaff83ed2dc1ad1d35..3432f0b56a6bdbec58642d6d9e7a13ea10d72e75 100755 (executable)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
+// 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 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, 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.
+// 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
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// 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
-//
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//  File   : ToolsGUI_RegWidget.h
-//  Author : Pascale NOYRET, EDF
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef TOOLSGUI_REGWIDGET_H
 #define TOOLSGUI_REGWIDGET_H
 
 #include "ToolsGUI.h"
 
 #include <QMainWindow>
+#include <QMap>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Registry)
 
-class QTabWidget;
 class QTreeWidget;
 class QTreeWidgetItem;
-class QWidget;
 class QTimer;
-class QCloseEvent;
 class QAction;
+class QTextEdit;
 
 class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
 {
   Q_OBJECT
 
-  class HelpWindow;
-  class IntervalWindow;
-  class InfoWindow;
+  enum { Refresh, Interval, Close };
+  enum { Clients, History };
 
-  ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
+  ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent = 0 );
 
 public:
   ~ToolsGUI_RegWidget();
 
-  void                       SetListe();
-  void                       SetListeHistory();
-  void                       InfoReg();
-  void                       InfoHistory();
-
-  bool                       eventFilter( QObject* object, QEvent* event );
+  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb, 
+                                           QWidget* parent = 0 );
 
-  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb, 
-                                          QWidget* parent = 0 );
+private slots:
+  void                       refresh();
+  void                       showDetails( QTreeWidgetItem*, int );
+  void                       refreshInterval();
 
-  virtual QMenu*             createPopupMenu();
-
-public slots:
-  void                       slotHelp();
-  void                       slotListeSelect();
-  void                       slotClientChanged( QTreeWidgetItem*, int );
-  void                       slotHistoryChanged( QTreeWidgetItem*, int );
-  void                       slotSelectRefresh();
-  void                       slotIntervalOk();
-
-protected:  
-  static QString             setlongText( const Registry::Infos& c_info );
-  int                        numitem( const QString& name, 
-                                     const QString& pid, 
-                                     const QString& machine, 
-                                     const Registry::AllInfos* clistclient );
-  void                       closeEvent( QCloseEvent* e );
+private:  
+  static QString             getDetails( const Registry::Infos& c_info );
    
-protected :
-  QTreeWidget*         _clients;
-  QTreeWidget*         _history;
-  QWidget*             _parent;
-  QTabWidget*          _tabWidget;
-  QAction*             _refresh;
-  QAction*             _interval;
-  QAction*             _close;
-  QTimer*              _counter;
-  Registry::AllInfos*  _serverhistory;
-  Registry::AllInfos*  _serverclients;
-  InfoWindow*          myInfoWindow;
-  HelpWindow*          myHelpWindow;
-  IntervalWindow*      myIntervalWindow;
-  int                  myRefreshInterval;
-
 private:
-  const Registry::Components_var _VarComponents;
-  static ToolsGUI_RegWidget*     myRegWidgetPtr;
+  static ToolsGUI_RegWidget* myRegWidgetPtr;
+
+  CORBA::ORB_var             myOrb;
+  QMap<int, Registry::AllInfos*> myData;
+  QMap<int, QAction*>        myActions;
+  QMap<int, QTreeWidget*>    myViews;
+  QTextEdit*                 myDetails;
+  QTimer*                    myTimer;
 };
 
 #endif // TOOLSGUI_REGWIDGET_H