distitems.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.13.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 _DISTITEMS_H_
00031 #define _DISTITEMS_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <osbid.h>
00039 #include <nwaddress.h>
00040 
00041 // + local headers
00042 #include "tolists.h"
00043 
00044 // ************************************************************************
00045 // class declarations
00046 namespace OSB_LIB {
00047     class ConnectionPt;
00048     class E164;
00049     class TariffZone;
00050 }
00051 
00052 // ************************************************************************
00053 // namespace extensions
00054 namespace OSB_GUI {
00055 
00056 // ************************************************************************
00057 // forward declarations
00058     class E164List;
00059     class E164Item;
00060 
00061 // ************************************************************************
00062 // type definitions
00063 
00064 // ************************************************************************
00065 // class definitions
00069     class CpList : public ToGroup {
00070     public:
00072         CpList(
00073                   QListViewItem* parent,
00074                   int            key,
00075             const QString&       label
00076         );
00077 
00078     public:
00080         void gotoCp();
00081 
00082     private:
00089         void add(
00090             const OSB_LIB::ConnectionPt& cp,
00091                   bool                   hasChildren
00092         );
00094         void populate();
00096         void newObject();
00098         void selectCp(const OSB_LIB::ConnectionPt& cp);
00099 
00101         bool setupMenu(ToMenu& toMenu);
00103         bool commandEvent(ToMenuCmd cmd);
00104     };                                  // class CpList
00105 
00109     class CpItem : public ToCfgTsItem
00110     {
00112         typedef OSB_LIB::Id<OSB_LIB::ConnectionPt> CpId;
00114         static const int cmdAddChild_;
00115     public:
00123         CpItem(
00124                   QListViewItem*         parent,
00125             const OSB_LIB::ConnectionPt& cp,
00126                   bool                   hasChildren
00127         );
00128     public:
00130         CpId cpId() const;
00131     private:
00133         long objId() const;
00134 
00136 
00137 
00138         void showObject() const;
00140         void editObject();
00142         void changeStatus();
00144         void delObject();
00146         void addChild();
00148         void gotoCp();
00150 
00159         CpItem* add(
00160             const OSB_LIB::ConnectionPt& cp,
00161                   bool                   hasChildren
00162         );
00164         void setOpen(bool open);
00166         void selectCp(const OSB_LIB::ConnectionPt& cp);
00168         bool setupMenu(ToMenu& toMenu);
00170         bool commandEvent(ToMenuCmd cmd);
00171     private:
00173         CpId objId_;
00174     };                                  // class CpItem
00175 
00179     class E164List : public ToGroup {
00180     public:
00182         E164List(
00183                   QListViewItem* parent,
00184                   int            key,
00185             const QString&       label
00186         );
00187     private:
00189         static const int cmdTest_;
00190 
00192         void add(const OSB_LIB::E164& e164);
00194         void populate();
00196         void newObject();
00197 
00199         bool setupMenu(ToMenu& toMenu);
00201         bool commandEvent(ToMenuCmd cmd);
00202 
00204         E164Item* find(
00205                   OSB_LIB::NwAddress::Ton ton,
00206             const std::string&            value
00207         );
00208     };                                  // class E164List
00209 
00213     class E164Item : public ToCfgTsItem
00214     {
00216         typedef OSB_LIB::Id<OSB_LIB::E164> ObjId;
00218         friend class E164List;
00219     public:
00226         E164Item(
00227                   QListViewItem* parent,
00228             const OSB_LIB::E164& e164
00229         );
00230     private:
00232         void set(const OSB_LIB::E164& e164);
00234         long objId() const;
00235 
00237 
00238 
00239         void showObject() const;
00241         void editObject();
00243         void changeStatus();
00245         void delObject();
00247 
00248         /* Incomplete code!
00249           @brief Add another E.164 as item.
00250 
00251           @em e164 is a child of @em this if the TON is the same
00252           and the digits are lexicographically higher. <br>
00253           Else @em e164 is the parent of @em this.
00254          */
00255 //        void add(const OSB_LIB::E164& e164);
00256     private:
00258         ObjId objId_;
00260         OSB_LIB::NwAddress::Ton ton_;
00262         std::string value_;
00263     };                                  // class E164Item
00264 
00268     class TzList : public ToGroup {
00269     public:
00271         TzList(
00272                   QListViewItem* parent,
00273                   int            key,
00274             const QString&       label
00275         );
00276     private:
00282         void add(const OSB_LIB::TariffZone& tz);
00284         void populate();
00286         void newObject();
00287     };                                  // class TzList
00288 
00292     class TzItem : public ToItem
00293     {
00295         typedef OSB_LIB::Id<OSB_LIB::TariffZone> ObjId;
00296     public:
00303         TzItem(
00304                   QListViewItem*       parent,
00305             const OSB_LIB::TariffZone& tz
00306         );
00307     private:
00309         long objId() const;
00310 
00312 
00313 
00314         void showObject() const;
00316         void editObject();
00318         void delObject();
00320     private:
00322         ObjId objId_;
00323     };                                  // class TzItem
00324 }                                       // namespace OSB_GUI
00325 
00326 // ************************************************************************
00327 // inline definitions
00328 namespace OSB_GUI {
00329 }                                       // namespace OSB_GUI
00330 #endif                                  // #ifndef _DISTITEMS_H_

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