00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.36 $ 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 _DLGTPSVS_H_ 00031 #define _DLGTPSVS_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 #include <map> 00037 #include <set> 00038 00039 // + libraries 00040 #include <osbid.h> 00041 #include <chrono.h> 00042 00043 // + local headers 00044 #include "dlgtovs.h" 00045 #include "guiutils.h" 00046 00047 // ************************************************************************ 00048 // class declarations 00049 namespace OSB_LIB { 00050 class OsbErrors; 00051 class DayClass; 00052 class TariffPeriod; 00053 class TpsVersion; 00054 } 00055 namespace OSB_GUI { // all in tpscfg.h 00056 class DcInfoGroup; 00057 class DcMenu; 00058 class StMenu; 00059 struct SwitchTimeCmd; 00060 class SwitchTimeEvent; 00061 class SwitchTimeInfo; 00062 class TpInfoGroup; 00063 class TpMenu; 00064 } 00065 00066 // ************************************************************************ 00067 // namespace extensions 00068 namespace OSB_GUI { 00069 00070 // ************************************************************************ 00071 // forward declarations 00072 class TpsCfg; 00073 00074 // ************************************************************************ 00075 // class definitions 00079 class DlgTpsVs : private DlgToVs { 00080 Q_OBJECT // for vim ->; 00081 public: 00083 explicit DlgTpsVs( 00084 QWidget* parent, 00085 const char* name = "DlgTpsVs", 00086 bool modal = true, 00087 WFlags fl = 0 00088 ); 00090 bool dirty() const; 00092 bool tpsDirty() const; 00094 bool cfgDirty() const; 00096 int showTpsVs( 00097 const OSB_LIB::TpsVersion& tpsVs 00098 ); 00100 int editTpsVs( 00101 OSB_LIB::TpsVersion* tpsVs 00102 ); 00103 // documentation from base class 00104 void languageChange(); 00105 private: 00106 // documentation from base class 00107 void addGeneralInfo( 00108 QVBoxLayout* dlgLayout, 00109 ToVsHead* generalInfo 00110 ); 00117 void display( 00118 const OSB_LIB::TpsVersion& tpsVs, 00119 bool showOnly 00120 ); 00122 void populateTpMenu( 00123 const OSB_LIB::TpsVersion& tpsVs 00124 ); 00126 void populateDcMenu(); 00128 void showCfg( 00129 const OSB_LIB::TpsVersion& tpsVs 00130 ); 00131 private slots: 00133 void cfgStMenu(); 00135 void setTpMenu(); 00137 void setDcMenu(); 00138 private: 00140 TpsCfg* cfg_; 00142 StMenu* stMenu_; 00144 QPushButton* pbStMenu_; 00146 TpMenu* tpMenu_; 00148 QPushButton* pbTpMenu_; 00150 DcMenu* dcMenu_; 00152 QPushButton* pbDcMenu_; 00153 }; // class DlgTpsVs 00154 00158 class TpsCfg : public QWidget { 00159 Q_OBJECT // for vim ->; 00160 private: 00161 // Short-hand for a tariff period object id. 00162 typedef OSB_LIB::Id<OSB_LIB::TariffPeriod> TpId; 00163 // Short-hand for a day class object id. 00164 typedef OSB_LIB::Id<OSB_LIB::DayClass> DcId; 00165 public: 00167 explicit TpsCfg( 00168 QWidget* parent, 00169 const char* name = "tpsCfg_" 00170 ); 00171 public: 00173 bool dirty() const; 00175 void languageChange(); 00181 void setup(bool showOnly); 00183 void populate(OSB_LIB::TpsVersion* tpsVs) const; 00190 void cfgStMenu( 00191 StMenu& stMenu, 00192 QPushButton* pb 00193 ); 00195 void setTpMenu(TpMenu& tpMenu); 00197 void setDcMenu(DcMenu& dcMenu); 00198 public slots: 00207 void switchTimeEvent(const SwitchTimeEvent& event); 00208 private slots: 00210 void switchTimeCmd(const SwitchTimeCmd& cmd); 00212 void tpMenuCmd(TpId tpId); 00214 void dcMenuCmd(DcId dcId); 00215 public: 00217 bool dirty_; 00219 DcInfoGroup* gbDc_; 00221 TpInfoGroup* gbTp_; 00223 SwitchTimeInfo* gbSt_; 00225 QGridLayout* layout_; 00226 }; 00227 } // namespace OSB_GUI 00228 #endif // #ifndef _DLGTPSVS_H_