dlgtcsmapping.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 _DLGTCSMAPPING_H_
00031 #define _DLGTCSMAPPING_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <osbtype.h>
00039 
00040 // + local headers
00041 #include "dlgtovs.h"
00042 #include "dlgtcsvs.h"
00043 #include "ui/tcsmappinggui.h"
00044 
00045 // ************************************************************************
00046 // class declarations
00047 namespace OSB_LIB {
00048     class Cdr;
00049     class CpMapper;
00050     class MappingDistTcs;
00051     class UsageType;
00052 }
00053 
00054 namespace OSB_GUI {
00055     template<typename T> class ValueCombo;
00056     template<typename T> class LeValueCombo;
00057 }
00058 class QLineEdit;
00059 
00060 // ************************************************************************
00061 // namespace extensions
00062 namespace OSB_GUI {
00063 
00064 // ************************************************************************
00065 // forward declarations
00066     class TcsMapping;
00067     class CmbCpm;
00068 
00069 // ************************************************************************
00070 // type definitions
00071 
00072 // ************************************************************************
00073 // class definitions
00077     class DlgMappingTcs : public DlgTcsVs, private DlgToVs {
00078     public:
00080         DlgMappingTcs(
00081                   QWidget* parent,
00082             const char*    name  = "DlgMappingTcs",
00083                   bool     modal = false,
00084                   WFlags   fl    = 0
00085         );
00086     public:
00088         int showTcsVs(
00089             const OSB_LIB::TcsVersion& tcsVs
00090         );
00092         int editTcsVs(
00093             OSB_LIB::TcsVersion* tcsVs
00094         );
00095     private:
00096         // documentation from base class
00097         void languageChange();
00098         // documentation from base class
00099         void addGeneralInfo(
00100             QVBoxLayout* dlgLayout,
00101             ToVsHead*    generalInfo
00102         );
00109         void display(
00110             const OSB_LIB::MappingDistTcs& tcs,
00111                   bool                     showOnly
00112         );
00113     private:
00115         TcsMapping* cfg_;
00116     };                                  // class DlgMappingTcs
00117 
00121     class TcsMapping : public TcsMappingGui {
00122     private:
00124         typedef OSB_LIB::TypeId<OSB_LIB::CpMapper> CpmType;
00126         typedef LeValueCombo<CpmType> LineEdit;
00128         typedef OSB_LIB::TypeId<OSB_LIB::Cdr, 1> CdrUsgType;
00130         struct Row {
00131             CdrUsgType type_;
00132             LineEdit*  leOrigin_;
00133             LineEdit*  leDest_;
00134             Row() : leOrigin_(0), leDest_(0) {}
00135         };
00137         typedef std::list<Row> MappingDefs;
00138     public:
00140         explicit TcsMapping(
00141                   QWidget* parent,
00142             const char*    name = "tcsMapping_",
00143             WFlags         fl   = 0
00144         );
00146         void languageChange();
00148         void allowEdit(bool allow);
00150         void resetMappings();
00157         void display(
00158             const OSB_LIB::MappingDistTcs& tcs,
00159                   bool                     showOnly
00160         );
00166         void populate(
00167             OSB_LIB::MappingDistTcs* tcs
00168         ) const;
00169     private:
00171         void addRow(
00172             const OSB_LIB::UsageType& type,
00173                   int                 pos,
00174                   QLabel*             buddy = 0
00175         );
00177         Row* findRow(const OSB_LIB::UsageType& type);
00178     private:
00180         CmbCpm*   cmbCpm_;
00182         MappingDefs mappings_;
00183     };                                  // class TcsMapping
00184 }                                       // namespace OSB_GUI
00185 
00186 // ************************************************************************
00187 // inline definitions
00188 namespace OSB_GUI {
00189 }                                       // namespace OSB_GUI
00190 #endif                                  // #ifndef _DLGTCSMAPPING_H_

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