00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.10.2.1 $ 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 _DLGRPCFG_H_ 00031 #define _DLGRPCFG_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 #include <memory> 00037 00038 // + libraries 00039 #include <qdialog.h> 00040 00041 #include <osbtype.h> 00042 00043 // + local headers 00044 00045 // + class declarations 00046 class QComboBox; 00047 class QFrame; 00048 class QGridLayout; 00049 class QGroupBox; 00050 class QHBoxLayout; 00051 class QLabel; 00052 class QPushButton; 00053 class QSpacerItem; 00054 class QVBoxLayout; 00055 class QWidget; 00056 class QWidgetStack; 00057 class QVBoxLayout; 00058 00059 namespace OSB_LIB { 00060 class RatedPartyEval; 00061 class RatedPartyTypes; 00062 class UsageType; 00063 } 00064 00065 namespace OSB_GUI { 00066 class CmbUsageType; 00067 class CmbRpEval; 00068 class CmbRpType; 00069 } 00070 00071 // ************************************************************************ 00072 // namespace extensions 00073 namespace OSB_GUI { 00074 00075 // ************************************************************************ 00076 // forward declarations 00077 class RpConfigBase; 00078 00079 // ************************************************************************ 00080 // type definitions 00081 00082 // ************************************************************************ 00083 // class definitions 00084 00094 class DlgRpConfig : public QDialog 00095 { 00096 Q_OBJECT // for vim ->; 00097 private: 00099 typedef OSB_LIB::TypeId<OSB_LIB::RatedPartyEval> RpEvalType; 00100 public: 00102 explicit DlgRpConfig( 00103 QWidget* parent = 0, 00104 const char* name = "dlgRpConfig_", 00105 bool modal = true, 00106 WFlags flags = 0 00107 ); 00108 00110 ~DlgRpConfig(); 00111 00112 private: 00114 DlgRpConfig(const DlgRpConfig&); 00116 DlgRpConfig& operator=(const DlgRpConfig&); 00117 00118 public: 00125 void showRpEval( 00126 const OSB_LIB::UsageType& usgType, 00127 const OSB_LIB::RatedPartyEval& rpEval 00128 ); 00129 00139 std::auto_ptr<OSB_LIB::RatedPartyEval> creRpEval(); 00140 00141 OSB_LIB::UsageType usageType() const; 00142 00143 public slots: 00145 virtual void languageChange(); 00146 00147 private: 00149 int exec(); 00151 void enable(bool on); 00153 void creRpEvalConfig(const RpEvalType& rpeType); 00154 00155 private slots: 00157 void creRpEvalConfig(); 00158 00159 private: // widgets 00161 QLabel* tlUsgType_; 00163 CmbUsageType* cmbUsgType_; 00165 QLabel* tlRatedParty_; 00167 CmbRpType* cmbRatedParty_; 00169 QLabel* tlRpEval_; 00171 CmbRpEval* cmbRpEval_; 00172 00174 QFrame* linePb_; 00176 QPushButton* pbOk_; 00178 QPushButton* pbCancel_; 00180 QSpacerItem* spPb_; 00182 QHBoxLayout* loPb_; 00183 00185 RpConfigBase* config_; 00187 QGridLayout* loConfig_; 00189 QSpacerItem* spConfig_; 00190 00192 QVBoxLayout* layout_; 00193 }; // class DlgRpConfig 00194 00203 class RpConfigBase { 00204 public: 00206 typedef OSB_LIB::TypeId<OSB_LIB::RatedPartyEval> RpEvalType; 00207 00208 public: 00216 RpConfigBase( 00217 QWidget* parent, 00218 QGridLayout* layout, 00219 int* row 00220 ); 00221 00223 virtual ~RpConfigBase(); 00224 00225 private: 00227 RpConfigBase(const RpConfigBase&); 00229 RpConfigBase& operator=(const RpConfigBase&); 00230 00231 public: 00233 virtual void enable(bool on) = 0; 00235 virtual void showRpEval( 00236 const OSB_LIB::RatedPartyEval& rpEval 00237 ) = 0; 00239 virtual void setRpEval( 00240 OSB_LIB::RatedPartyEval* rpEval 00241 ) = 0; 00243 virtual QWidget* fristFocusWidget() = 0; 00244 private: 00246 QLabel* tlConfig_; 00248 QFrame* lineConfig_; 00249 }; // class RpConfigBase 00250 } // namespace OSB_GUI 00251 00252 // ************************************************************************ 00253 // inline definitions 00254 namespace OSB_GUI { 00255 } // namespace OSB_GUI 00256 #endif // #ifndef _DLGRPCFG_H_