00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.5.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 _RATINGCFGLV_H_ 00031 #define _RATINGCFGLV_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 #include <qlistview.h> 00039 00040 #include <osbid.h> 00041 #include <usagetype.h> 00042 00043 // + local headers 00044 00045 // + class declarations 00046 namespace OSB_LIB { 00047 class RpEvalMgr; 00048 class RatedParty; 00049 class RatedPartyEval; 00050 class NetworkElement; 00051 class UsageType; 00052 } 00053 00054 // ************************************************************************ 00055 // namespace extensions 00056 namespace OSB_GUI { 00057 00058 // ************************************************************************ 00059 // forward declarations 00060 class RpEvalItem; 00061 00062 // ************************************************************************ 00063 // type definitions 00064 00065 // ************************************************************************ 00066 // class definitions 00070 class LvRatingCfg : public QListView { 00071 public: 00073 explicit LvRatingCfg( 00074 QWidget* parent, 00075 const char* name = 0, 00076 WFlags flags = 0 00077 ); 00078 public: 00080 void languageChange(); 00081 00083 void populate( 00084 const OSB_LIB::RpEvalMgr& rpEvalMgr, 00085 const OSB_LIB::Id2<OSB_LIB::NetworkElement> neId 00086 ); 00093 void select( 00094 const OSB_LIB::UsageType& usgType, 00095 const OSB_LIB::TypeId<OSB_LIB::RatedParty>& rpType 00096 ); 00103 void remove( 00104 const OSB_LIB::UsageType& usgType, 00105 const OSB_LIB::TypeId<OSB_LIB::RatedParty>& rpType 00106 ); 00107 00114 const OSB_LIB::UsageType usageType() const; 00121 const OSB_LIB::TypeId<OSB_LIB::RatedParty> rpType() const; 00122 private: 00128 RpEvalItem* curRpEval(); 00134 const RpEvalItem* curRpEval() const; 00144 RpEvalItem* find( 00145 const OSB_LIB::UsageType& usgType, 00146 const OSB_LIB::TypeId<OSB_LIB::RatedParty>& rpType 00147 ); 00148 }; // class LvRatingCfg 00149 00153 class RpEvalItem : public QListViewItem { 00155 typedef OSB_LIB::TypeId<OSB_LIB::RatedParty> RpType; 00156 public: 00158 RpEvalItem( 00159 const OSB_LIB::UsageType& usgType, // ToDo: usage type as parent? 00160 const OSB_LIB::RatedPartyEval& rpEval, 00161 QListView* parent 00162 ); 00163 public: 00165 const OSB_LIB::UsageType& usageType() const; 00167 const OSB_LIB::TypeId<OSB_LIB::RatedParty>& rpType() const; 00168 private: 00170 void setup(); 00171 private: 00173 OSB_LIB::UsageType usageType_; 00175 RpType rpType_; 00176 }; // class RpEvalItem 00177 } // namespace OSB_GUI 00178 00179 // ************************************************************************ 00180 // inline definitions 00181 namespace OSB_GUI { 00182 } // namespace OSB_GUI 00183 #endif // #ifndef _RATINGCFGLV_H_