dlgrfsc.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.6 $
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 _DLGRFSC_H_
00031 #define _DLGRFSC_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 
00039 // + local headers
00040 #include "ui/rfscgui.h"
00041 #include "dlgrf.h"
00042 #include "osblineedits.h"
00043 
00044 // ************************************************************************
00045 // class declarations
00046 namespace OSB_GUI {
00047     class LeDecimal;
00048 }
00049 
00050 namespace OSB_LIB {
00051     class Unit;
00052     class RfStairCase;
00053 }
00054 
00055 // ************************************************************************
00056 // namespace extensions
00057 namespace OSB_GUI {
00058 
00059 // ************************************************************************
00060 // forward declarations
00061     class RfScCharges;
00062 
00063 // ************************************************************************
00064 // class definitions
00065 
00069     class DlgRfSc : public DlgRfBase {
00070     public:
00072         DlgRfSc(
00073                   QWidget* parent,
00074             const char*    name  = "DlgRfSc",
00075                   bool     modal = false,
00076                   WFlags   fl    = 0
00077         );
00078     public:
00079         // documentation from base class
00080         int showRf(
00081             const OSB_LIB::RatingFn&     rf,
00082             const OSB_LIB::ChargeTraits& ct
00083         );
00084         // documentation from base class
00085         int editRf(
00086             OSB_LIB::RatingFn*     rf,
00087             OSB_LIB::ChargeTraits* ct
00088         );
00089         // documentation from base class
00090         void languageChange();
00091     private:
00092         // documentation from base class
00093         const OSB_LIB::RatingFn* getRf() const;
00102         void display(
00103             const OSB_LIB::RfStairCase&  rf,
00104             const OSB_LIB::ChargeTraits& ct,
00105                   bool                   showOnly
00106         );
00107     private:
00109         const OSB_LIB::RfStairCase* rfShown_;
00110         // Widget for the charges of the rating function.
00111         RfScCharges* chargeTab_;
00112     };                                  // class DlgRfSc
00113 
00117     class RfScCharges : public RfScChargesGui {
00118         Q_OBJECT                        // for vim ->;
00119     public:
00120         // forward declaration, defined below.
00121         class Charge;
00122     private:
00124         typedef std::list<Charge*> Charges;
00125     public:
00127         RfScCharges(
00128                   QWidget* parent,
00129             const char*    name = "rfSlotCharges_"
00130         );
00132         ~RfScCharges();
00133     public:
00135         void languageChange();
00137         void setEnabled(bool on);
00139         void setCharges(const OSB_LIB::RfStairCase& rf);
00141         void writeCharges(OSB_LIB::RfStairCase* rf);
00142     public slots:
00144         void setUnit(const OSB_LIB::Unit& u);
00145     private:
00147         void buildCharges();
00149         void setTabs();
00151         void setUnitText();
00152     private slots:
00154         void insertEmpty();
00161         void cleanCharges();
00162     private:
00164         std::string units_;
00166         Charges charges_;
00168         Charge* lastCharge_;
00169     };                                  // class RfScCharges
00170 
00172     class RfScCharges::Charge {
00173     public:
00175         typedef RangeLineEdit<long> LeLong;
00176     public:
00182         explicit Charge(QWidget* parent);
00184         void destroy() const;
00185     private:
00187         ~Charge();
00188     private:
00190         Charge(const Charge&);
00192         Charge& operator=(const Charge&);
00193     public:
00195         void setEnabled(bool on);
00197         bool empty() const;
00198     public:
00199         QLabel* tlSeq_;
00201         LeDecimal* leVol_;
00203         LeLong* leRepeat_;
00205         LeDecimal* leRate_;
00206     };                                  // class RfScCharges
00207 }                                       // namespace OSB_GUI
00208 #endif                                  // #ifndef _DLGRFSC_H_

Generated on Sat Sep 2 14:17:36 2006 for OSB Library by  doxygen 1.4.7