00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.11 $ 00012 00013 License 00014 OSB rating and billing library for communication networks 00015 Copyright (C) 2004, 2005, 2006 OSB systems 00016 00017 This file may be distributed and/or modify under the terms of the 00018 GNU General Public License (GPL) as published by the Free Software 00019 Foundation which is provided in the file LICENSE.GPL included in the 00020 packaging of this file. 00021 00022 The file is distributed in the hope that it will be useful, but WITHOUT 00023 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00024 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00025 for more details. 00026 00027 Holders of a OSB Commercial License may use this file under the terms 00028 and conditions of this commercial license. 00029 */ 00030 #ifndef _ADMINWIDGET_H_ 00031 #define _ADMINWIDGET_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 #include <qwidget.h> 00039 #include <qworkspace.h> // needed for Qt:WFlags 00040 #include <osbid.h> 00041 00042 // + local headers 00043 00044 // + class declarations 00045 class QListBoxItem; 00046 class QPopupMenu; 00047 class QSizeGrip; 00048 00049 // ************************************************************************ 00050 // namespace extensions 00051 namespace OSB_GUI { 00052 00053 // ************************************************************************ 00054 // forward declarations 00055 class AdminCtrl; 00056 00057 // ************************************************************************ 00058 // type definitions 00069 typedef OSB_LIB::Id<AdminCtrl> AdminType; 00070 00071 // ************************************************************************ 00072 // class definitions 00073 00083 class AdminWidget : public QWidget { 00084 Q_OBJECT // for vim ->; 00085 public: 00090 AdminWidget( 00091 AdminType type, 00092 QWidget* parent, 00093 const char* name = 0, 00094 WFlags flags = 0 00095 ); 00097 virtual ~AdminWidget(); 00098 00099 public slots: 00101 virtual void languageChange() = 0; 00102 00103 public: 00116 virtual void activated(bool minimized); 00117 00124 virtual std::string menuTitle() const = 0; 00135 virtual QPopupMenu* menu() = 0; 00136 00145 virtual void clearMenuAccels() = 0; 00146 00148 AdminType type() const; 00149 00150 signals: 00152 void statusMessage( 00153 const QString& msg = "", 00154 int ms = -1 00155 ); 00156 00157 protected: 00159 virtual bool eventFilter(QObject* o, QEvent* e); 00161 virtual void resizeEvent(QResizeEvent*); 00162 00163 private: 00165 AdminType type_; 00167 QSizeGrip* sizeGrip_; 00168 }; // class AdminWidget 00169 00187 class AdminCtrl { 00192 static long nextType_; 00193 00194 public: 00196 AdminCtrl(); 00198 virtual ~AdminCtrl(); 00199 00200 private: 00202 AdminCtrl(const AdminCtrl&); 00204 AdminCtrl& operator=(const AdminCtrl&); 00205 00206 public: 00208 AdminType type() const; 00209 00217 virtual QListBoxItem* item() = 0; 00218 00220 virtual void languageChange() = 0; 00221 00235 virtual AdminWidget* creWidget( 00236 QWorkspace* parent, 00237 Qt::WFlags flags 00238 ) = 0; 00239 00240 private: 00242 AdminType type_; 00243 }; // class AdminItem 00244 } // namespace OSB_GUI 00245 00246 // ************************************************************************ 00247 // inline definitions 00248 namespace OSB_GUI { 00249 } // namespace OSB_GUI 00250 #endif // #ifndef _ADMINWIDGET_H_