ratingcfgutil.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.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 _RATINGCFGUTIL_H_
00031 #define _RATINGCFGUTIL_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <qcombobox.h>
00039 
00040 #include <osbtype.h>
00041 
00042 // + local headers
00043 #include "osbcombos.h"
00044 
00045 // + class declarations
00046 namespace OSB_LIB {
00047     class RatedParty;
00048     class RatedPartyEval;
00049     class RpEvalType;
00050     class RatedPartyTypes;
00051     class UsageType;
00052 }
00053 
00054 // ************************************************************************
00055 // namespace extensions
00056 namespace OSB_GUI {
00057 
00058 // ************************************************************************
00059 // class definitions
00061     typedef ValueCombo<OSB_LIB::UsageType> CmbUsageTypeBase;
00062 
00064     class CmbUsageType : public CmbUsageTypeBase {
00065     public:
00067         CmbUsageType(
00068                   QWidget* parent,
00069             const char*    name
00070         );
00072         void populate();
00073     private:
00075         int add(const OSB_LIB::UsageType& usgType);
00076     };                                  // class CmbUsageType
00077 
00079     typedef ValueCombo<
00080         OSB_LIB::TypeId<OSB_LIB::RatedParty>
00081     > CmbRpTypeBase;
00082 
00084     class CmbRpType : public CmbRpTypeBase {
00085     public:
00087         CmbRpType(
00088                   QWidget* parent,
00089             const char*    name
00090         );
00096         void populate(const OSB_LIB::RatedPartyTypes& types);
00097     };                                  // class CmbRpType
00098 
00100     typedef ValueCombo<
00101         OSB_LIB::TypeId<OSB_LIB::RatedPartyEval>
00102     > CmbRpEvalBase;
00103 
00105     class CmbRpEval : public CmbRpEvalBase {
00106         Q_OBJECT                        // for vim ->;
00107     private:
00109         typedef OSB_LIB::TypeId<OSB_LIB::RatedPartyEval> RpEvalType;
00110     public:
00112         CmbRpEval(
00113                   QWidget* parent,
00114             const char*    name
00115         );
00117         void populate();
00118     signals:
00125         void rpEvalSelected();
00126     private slots:
00132         void activated();
00133     private:
00135         int add(const OSB_LIB::RpEvalType& rpeType);
00136     private:
00143         RpEvalType rpEvalType_;
00144     };                                  // class CmbRpEval
00145 
00146 // ************************************************************************
00147 // free functions
00149     std::string strUsageType(const OSB_LIB::UsageType& usgType);
00151     std::string strRpType(const OSB_LIB::TypeId<OSB_LIB::RatedParty> rpType);
00153     std::string strRpEvalType(const OSB_LIB::RpEvalType rpeType);
00155     std::string strRpEvalParam(
00156         const OSB_LIB::RpEvalType rpeType,
00157               int                 index
00158     );
00159 }                                       // namespace OSB_GUI
00160 
00161 // ************************************************************************
00162 // inline definitions
00163 namespace OSB_GUI {
00164 }                                       // namespace OSB_GUI
00165 #endif                                  // #ifndef _RATINGCFGUTIL_H_

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