00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.8 $ 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 _E164ITEM_H_ 00031 #define _E164ITEM_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 00039 // + local headers 00040 #include "resource.h" 00041 #include "resourceitem.h" 00042 00043 // + class declarations 00044 namespace OSB_LIB { 00045 class E164Resource; 00046 } 00047 00048 // ************************************************************************ 00049 // namespace extensions 00050 namespace OSB_LIB { 00051 00052 // ************************************************************************ 00053 // forward declarations 00054 00055 // ************************************************************************ 00056 // type definitions 00057 00058 // ************************************************************************ 00059 // class definitions 00060 00061 // ***************************************************************** 00062 // class PersE164Item 00066 class PersE164Item : public PersResource { 00067 public: 00069 static const Type type_; 00070 00071 // documentation from base class 00072 typedef std::auto_ptr<PersE164Item> AutoPtr; 00073 00074 public: 00076 PersE164Item(const Oid& oid = Oid()); 00077 00079 PersE164Item(const PersE164Item& rhs); 00080 00082 PersE164Item& operator=(const PersE164Item& rhs); 00083 00085 ~PersE164Item(); 00086 00087 public: 00088 // documentation from base class 00089 Type type() const; 00090 // documentation from base class 00091 AutoPtr clone() const; 00092 00093 private: 00094 // documentation from base class 00095 PersProductItem* clone_() const; 00096 00097 public: 00104 std::string personalization() const; 00111 bool canConfig() const; 00112 00114 void assign(const E164Resource& e164); 00115 00116 // documentation from base class 00117 const Resource* resource() const; 00118 00119 // documentation from base class 00120 const Resource* oldResource() const; 00121 00127 const E164Resource* e164Resource() const; 00128 00129 private: 00130 // documentation from base class 00131 Resource* resource(); 00132 // documentation from base class 00133 Resource* oldResource(); 00134 00135 // documentation from base class 00136 Resource* createResource( 00137 const Resource::Oid& resourceId 00138 ); 00139 00149 00150 bool readSpecific( 00151 const OSB_DB::Session& session 00152 ); 00153 00155 bool insSpecific( 00156 const OSB_DB::Session& session 00157 ); 00158 00160 bool updSpecific( 00161 const OSB_DB::Session& session 00162 ); 00163 00165 bool delSpecific( 00166 const OSB_DB::Session& session 00167 ); 00169 00170 private: 00172 E164Resource* pE164_; 00174 E164Resource* pOldE164_; 00175 }; // class PersE164Item 00176 00177 // ***************************************************************** 00178 // class E164Item 00182 class E164Item : public ResourceItem { 00183 public: 00185 static const Type type_; 00186 00187 // documentation from base class 00188 typedef std::auto_ptr<E164Item> AutoPtr; 00189 00197 E164Item( 00198 const Oid& oid, 00199 const std::string& name = "", 00200 const std::string& des = "" 00201 ); 00202 00203 public: 00204 // documentation from base class 00205 Type type() const; 00206 // documentation from base class 00207 AutoPtr clone() const; 00208 00209 private: 00210 // documentation from base class 00211 ProductItem* clone_() const; 00212 00213 public: 00220 ProductItem::CfgType canConfigure() const; 00221 00228 ProductItem::DefPersType canDefPers() const; 00229 00231 CfgPersType canPersonalize() const; 00232 00234 const PersProductItem* defPersItem() const; 00235 00242 std::auto_ptr<PersProductItem> crePersProductItem() const; 00243 00244 private: 00252 00253 bool readSpecific( 00254 const OSB_DB::Session& session 00255 ); 00256 00258 bool insSpecific( 00259 const OSB_DB::Session& session 00260 ); 00261 00263 bool updSpecific( 00264 const OSB_DB::Session& session 00265 ); 00266 00268 bool delSpecific( 00269 const OSB_DB::Session& session 00270 ); 00272 }; // class E164Item 00273 } // namespace OSB_LIB 00274 00275 // ************************************************************************ 00276 // inline definitions 00277 namespace OSB_LIB { 00278 } // namespace OSB_LIB 00279 #endif // #ifndef _E164ITEM_H_