00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 #ifndef TOOLSGUI_REGWIDGET_H 00024 #define TOOLSGUI_REGWIDGET_H 00025 00026 #include "ToolsGUI.h" 00027 00028 #include <QMainWindow> 00029 #include <QMap> 00030 00031 #include <SALOMEconfig.h> 00032 #include CORBA_CLIENT_HEADER(SALOME_Registry) 00033 00034 class QTreeWidget; 00035 class QTreeWidgetItem; 00036 class QTimer; 00037 class QAction; 00038 class QTextEdit; 00039 00040 class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow 00041 { 00042 Q_OBJECT 00043 00044 enum { Refresh, Interval, Close }; 00045 enum { Clients, History }; 00046 00047 ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent = 0 ); 00048 00049 public: 00050 ~ToolsGUI_RegWidget(); 00051 00052 static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb, 00053 QWidget* parent = 0 ); 00054 00055 private slots: 00056 void refresh(); 00057 void showDetails( QTreeWidgetItem*, int ); 00058 void refreshInterval(); 00059 00060 private: 00061 static QString getDetails( const Registry::Infos& c_info ); 00062 00063 private: 00064 static ToolsGUI_RegWidget* myRegWidgetPtr; 00065 00066 CORBA::ORB_var myOrb; 00067 QMap<int, Registry::AllInfos*> myData; 00068 QMap<int, QAction*> myActions; 00069 QMap<int, QTreeWidget*> myViews; 00070 QTextEdit* myDetails; 00071 QTimer* myTimer; 00072 }; 00073 00074 #endif // TOOLSGUI_REGWIDGET_H