Salome HOME
*** empty log message ***
[modules/gui.git] / src / RegistryDisplay / 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 #include <IntervalWindow.hxx>
38
39 class QTabWidget;
40 class QListView;
41 class QListViewItem;
42 class QWidget;
43 class QTimer;
44 class QCloseEvent;
45 class QTextView;
46 #if QT_VERSION > 300
47 class QPushButton;
48 #endif
49 class HelpWindow;
50 class InfoWindow;
51
52 class RegWidget : public QMainWindow
53 {
54   
55   Q_OBJECT
56
57 public:
58    RegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
59   ~RegWidget();
60   void       SetListe();
61   void       SetListeHistory();
62   void       InfoReg();
63   void       InfoHistory();
64
65   bool       eventFilter( QObject* object, QEvent* event );
66
67   static RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
68
69 public slots:
70   void       slotHelp();
71   void       slotListeSelect();
72   void       slotClientChanged( QListViewItem* );
73   void       slotHistoryChanged( QListViewItem* );
74   void       slotSelectRefresh();
75   void       slotIntervalOk();
76 protected:  
77   static QString setlongText( const Registry::Infos &c_info );
78   int            numitem( const QString& name, const QString& pid, const QString& machine, const Registry::AllInfos* c_info );
79   void           closeEvent( QCloseEvent *e);
80    
81 protected :
82   QListView*          _clients;
83   QListView*          _history;
84   QWidget*            _parent;
85   QTabWidget*         _tabWidget;
86   QPushButton*        _refresh;
87   QPushButton*        _interval;
88   QPushButton*        _close;
89   QTimer*             _counter;
90   Registry::AllInfos* _serverhistory;
91   Registry::AllInfos* _serverclients;
92   InfoWindow*         myInfoWindow;
93   HelpWindow*         myHelpWindow;
94   IntervalWindow*     myIntervalWindow;
95   int                 myRefreshInterval;
96
97 private:
98   const      Registry::Components_var _VarComponents;
99   static     RegWidget* myRegWidgetPtr;
100 };
101
102 class InfoWindow : public QMainWindow {
103 public:
104   InfoWindow( QWidget* parent = 0, const char* name = 0);
105
106   void setText( const QString& text );
107   QTextView* textView() const { return myTextView; }
108
109 protected:
110   void keyPressEvent( QKeyEvent * e );
111
112 private:
113   QTextView* myTextView;
114
115 };
116
117 # endif         /* # ifndef __REGWIDGET_H__ */
118
119
120
121
122
123
124
125
126