00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.27 $ 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 _TCSITEMS_H_ 00031 #define _TCSITEMS_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 #include <osbid.h> 00039 00040 // + local headers 00041 #include "tolists.h" 00042 00043 // ************************************************************************ 00044 // class declarations 00045 namespace OSB_LIB { 00046 class TariffClass; 00047 class TcSystem; 00048 class TcsVersion; 00049 } 00050 00051 // ************************************************************************ 00052 // namespace extensions 00053 namespace OSB_GUI { 00054 00055 // ************************************************************************ 00056 // class definitions 00060 class TcItem : public ToItem 00061 { 00062 typedef OSB_LIB::Id<OSB_LIB::TariffClass> ObjId; 00063 public: 00064 TcItem( 00065 QListViewItem* parent, 00066 const OSB_LIB::TariffClass& tc 00067 ); 00068 private: 00069 long objId() const; 00070 void showObject() const; 00071 void editObject(); 00072 void delObject(); 00073 private: 00074 ObjId objId_; 00075 }; // class TcItem 00076 00080 class TcsItem : public ToGroupItem 00081 { 00082 typedef OSB_LIB::Id<OSB_LIB::TcSystem> ObjId; 00083 public: 00084 TcsItem( 00085 QListViewItem* parent, 00086 const OSB_LIB::TcSystem& tcs 00087 ); 00088 private: 00089 long objId() const; 00090 void add(const OSB_LIB::TcsVersion& tcsVs); 00091 void populate(); 00092 00099 bool setupMenu(ToMenu& toMenu); 00101 bool commandEvent(ToMenuCmd cmd); 00102 00103 void newVersion(); 00104 void copyVersion(); 00105 00106 void showObject() const; 00107 void editObject(); 00108 void delObject(); 00109 00110 private: 00111 ObjId objId_; 00112 }; // class TcsItem 00113 00117 class TcsVsItem : public ToVsItem { 00119 typedef OSB_LIB::Id2<OSB_LIB::TcsVersion> VsId; 00120 public: 00122 TcsVsItem( 00123 QListViewItem* parent, 00124 const OSB_LIB::TcsVersion& tcsVs 00125 ); 00126 private: 00128 long vsId() const; 00130 void showObject() const; 00132 void editObject(); 00134 void changeStatus(); 00136 void delObject(); 00137 private: 00139 VsId vsId_; 00140 }; 00141 00145 class TcList : public ToGroup { 00146 public: 00147 TcList( 00148 QListViewItem* parent, 00149 int key, 00150 const QString& label 00151 ); 00152 private: 00153 void add(const OSB_LIB::TariffClass& tc); 00154 void populate(); 00155 void newObject(); 00156 }; // class TcList 00157 00161 class TcsList : public ToGroup { 00162 public: 00163 TcsList( 00164 QListViewItem* parent, 00165 int key, 00166 const QString& label 00167 ); 00168 private: 00169 void add(const OSB_LIB::TcSystem& tcs); 00170 void populate(); 00171 void newObject(); 00172 }; // class TcsList 00173 } // namespace OSB_GUI 00174 #endif // #ifndef _TCSITEMS_H_