Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.git] / src / TOOLSGUI / ToolsGUI_RegWidget.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME RegistryDisplay : GUI for Registry server implementation
23 //  File   : ToolsGUI_RegWidget.h
24 //  Author : Pascale NOYRET, EDF
25 //
26 #ifndef TOOLSGUI_REGWIDGET_H
27 #define TOOLSGUI_REGWIDGET_H
28
29 #include "ToolsGUI.h"
30
31 #include <QMainWindow>
32
33 #include <SALOMEconfig.h>
34 #include CORBA_CLIENT_HEADER(SALOME_Registry)
35
36 class QTabWidget;
37 class QTreeWidget;
38 class QTreeWidgetItem;
39 class QWidget;
40 class QTimer;
41 class QCloseEvent;
42 class QAction;
43
44 class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
45 {
46   Q_OBJECT
47
48   class HelpWindow;
49   class IntervalWindow;
50   class InfoWindow;
51
52   ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
53
54 public:
55   ~ToolsGUI_RegWidget();
56
57   void                       SetListe();
58   void                       SetListeHistory();
59   void                       InfoReg();
60   void                       InfoHistory();
61
62   bool                       eventFilter( QObject* object, QEvent* event );
63
64   static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb, 
65                                            QWidget* parent = 0 );
66
67   virtual QMenu*             createPopupMenu();
68
69 public slots:
70   void                       slotHelp();
71   void                       slotListeSelect();
72   void                       slotClientChanged( QTreeWidgetItem*, int );
73   void                       slotHistoryChanged( QTreeWidgetItem*, int );
74   void                       slotSelectRefresh();
75   void                       slotIntervalOk();
76
77 protected:  
78   static QString             setlongText( const Registry::Infos& c_info );
79   int                        numitem( const QString& name, 
80                                       const QString& pid, 
81                                       const QString& machine, 
82                                       const Registry::AllInfos* clistclient );
83   void                       closeEvent( QCloseEvent* e );
84    
85 protected :
86   QTreeWidget*         _clients;
87   QTreeWidget*         _history;
88   QWidget*             _parent;
89   QTabWidget*          _tabWidget;
90   QAction*             _refresh;
91   QAction*             _interval;
92   QAction*             _close;
93   QTimer*              _counter;
94   Registry::AllInfos*  _serverhistory;
95   Registry::AllInfos*  _serverclients;
96   InfoWindow*          myInfoWindow;
97   HelpWindow*          myHelpWindow;
98   IntervalWindow*      myIntervalWindow;
99   int                  myRefreshInterval;
100
101 private:
102   const Registry::Components_var _VarComponents;
103   static ToolsGUI_RegWidget*     myRegWidgetPtr;
104 };
105
106 #endif // TOOLSGUI_REGWIDGET_H