Salome HOME
2fa72b754b762eb34f34188a648740778b148f1b
[modules/gui.git] / src / TOOLSGUI / ToolsGUI_RegWidget.h
1 //  SALOME RegistryDisplay : GUI for Registry server implementation
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : RegWidget.h
25 //  Author : Pascale NOYRET, EDF
26 //  Module : SALOME
27 //  $Header$
28
29 # ifndef __REGWIDGET_H__
30 # define __REGWIDGET_H__
31 # include <qapplication.h>
32 # include <qmainwindow.h>
33
34 #include <SALOMEconfig.h>
35 #include CORBA_CLIENT_HEADER(SALOME_Registry)
36
37 class QTabWidget;
38 class QListView;
39 class QListViewItem;
40 class QWidget;
41 class QTimer;
42 class QCloseEvent;
43 class QTextView;
44 #if QT_VERSION > 300
45 class QPushButton;
46 #endif
47
48 class ToolsGUI_HelpWindow;
49 class ToolsGUI_IntervalWindow;
50
51 class ToolsGUI_InfoWindow : public QMainWindow {
52 public:
53   ToolsGUI_InfoWindow( QWidget* parent = 0, const char* name = 0);
54
55   void setText( const QString& text );
56   QTextView* textView() const { return myTextView; }
57
58 protected:
59   void keyPressEvent( QKeyEvent * e );
60
61 private:
62   QTextView* myTextView;
63 };
64
65 class ToolsGUI_RegWidget : public QMainWindow
66 {
67   
68   Q_OBJECT
69
70 public:
71   ToolsGUI_RegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
72   ~ToolsGUI_RegWidget();
73   void       SetListe();
74   void       SetListeHistory();
75   void       InfoReg();
76   void       InfoHistory();
77
78   bool       eventFilter( QObject* object, QEvent* event );
79
80   static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
81
82 public slots:
83   void       slotHelp();
84   void       slotListeSelect();
85   void       slotClientChanged( QListViewItem* );
86   void       slotHistoryChanged( QListViewItem* );
87   void       slotSelectRefresh();
88   void       slotIntervalOk();
89 protected:  
90   static QString setlongText( const Registry::Infos &c_info );
91   int            numitem( const QString& name, const QString& pid, const QString& machine, const Registry::AllInfos* c_info );
92   void           closeEvent( QCloseEvent *e);
93    
94 protected :
95   QListView*               _clients;
96   QListView*               _history;
97   QWidget*                 _parent;
98   QTabWidget*              _tabWidget;
99   QPushButton*             _refresh;
100   QPushButton*             _interval;
101   QPushButton*             _close;
102   QTimer*                  _counter;
103   Registry::AllInfos*      _serverhistory;
104   Registry::AllInfos*      _serverclients;
105   ToolsGUI_InfoWindow*     myInfoWindow;
106   ToolsGUI_HelpWindow*     myHelpWindow;
107   ToolsGUI_IntervalWindow* myIntervalWindow;
108   int                      myRefreshInterval;
109
110 private:
111   const      Registry::Components_var _VarComponents;
112   static     ToolsGUI_RegWidget* myRegWidgetPtr;
113 };
114
115 # endif         /* # ifndef __REGWIDGET_H__ */
116
117
118
119
120
121
122
123
124