tcsdistutils.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.11 $
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 _TCSDISTUTILS_H_
00031 #define _TCSDISTUTILS_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <osbid.h>
00039 #include <qlistview.h>
00040 
00041 // + local headers
00042 #include "ui/tcsdistgui.h"
00043 
00044 // ************************************************************************
00045 // class declarations
00046 namespace OSB_LIB {
00047     class DistTcs;
00048     class TariffClass;
00049     class TariffZone;
00050 }
00051 
00052 // ************************************************************************
00053 // namespace extensions
00054 namespace OSB_GUI {
00055 
00056 // ************************************************************************
00057 // forward declarations
00058 
00059     class TcListView;
00060 // ************************************************************************
00061 // type definitions
00062 
00063 // ************************************************************************
00064 // class definitions
00065 
00069     class DistTcsCfg : public DistTcsGui {
00070         Q_OBJECT                        // for vim ->;
00071     public:
00073         class TcItem;
00075         class TzItem;
00076     public:
00078         explicit DistTcsCfg(
00079                   QWidget* parent,
00080             const char*    name   = "distTcsCfg_",
00081                   WFlags   flags  = 0
00082         );
00084         void languageChange();
00091         void display(
00092             const OSB_LIB::DistTcs& distTcs,
00093                   bool              showOnly
00094         );
00100         void populate(
00101             OSB_LIB::DistTcs* distTcs
00102         ) const;
00103     private:
00105         void arrangeWidgets(bool showOnly);
00106     private slots:
00108         void setPbs();
00110         void removeCfg();
00112         void addTc();
00114         void addTz();
00115     };                                  // class DistTcsCfg
00116 
00120     class DistTcsCfg::TcItem : public QListViewItem {
00121     private:
00123         typedef OSB_LIB::Id<OSB_LIB::TariffClass> TcId;
00124     public:
00126         TcItem(
00127                   QListView*            parent,
00128             const OSB_LIB::TariffClass& tc
00129         );
00131         const OSB_LIB::Id<OSB_LIB::TariffClass> tcId() const;
00132     private:
00134         int compare(
00135             QListViewItem* item,
00136             int            col,
00137             bool           asc
00138         ) const;
00139     private:
00141         TcId tcId_;
00142     };                                  // class DistTcsCfg::TcItem
00143 
00147     class DistTcsCfg::TzItem : public QListViewItem {
00148     private:
00150         typedef OSB_LIB::Id<OSB_LIB::TariffZone> TzId;
00151     public:
00153         TzItem(
00154                   QListView*           parent,
00155             const OSB_LIB::TariffZone& tz
00156         );
00158         TzItem(
00159                   QListViewItem*       parent,
00160             const OSB_LIB::TariffZone& tz
00161         );
00163         const OSB_LIB::Id<OSB_LIB::TariffZone> tzId() const;
00164     private:
00166         int compare(
00167             QListViewItem* item,
00168             int            col,
00169             bool           asc
00170         ) const;
00171     private:
00173         TzId tzId_;
00174     };                                  // class DistTcsCfg::TzItem
00175 }                                       // namespace OSB_GUI
00176 
00177 // ************************************************************************
00178 // inline definitions
00179 namespace OSB_GUI {
00180 }                                       // namespace OSB_GUI
00181 #endif                                  // #ifndef _TCSDISTUTILS_H_

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