tzcfgview.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.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 _TZCFGVIEW_H_
00031 #define _TZCFGVIEW_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <tcdist.h>
00039 #include <qlistview.h>
00040 
00041 // + local headers
00042 #include <tomenu.h>
00043 #include "tautils.h"
00044 
00045 // ************************************************************************
00046 // class declarations
00047 
00048 // ************************************************************************
00049 // namespace extensions
00050 namespace OSB_GUI {
00051 
00052 // ************************************************************************
00053 // forward declarations
00054 
00055 // ************************************************************************
00056 // type definitions
00057 
00058 // ************************************************************************
00059 // class definitions
00060 
00064     class LvTzConfig : public QListView {
00065         Q_OBJECT                        // for vim ->;
00066     public:
00068         enum Col {
00070             colTz = 0,
00072             colOrigin = 1,
00074             colDest = 2,
00076             colStatus = 3,
00078             colStart = 4,
00080             colEnd = 5
00081         };
00082     public:
00084         explicit LvTzConfig(
00085                   QWidget* parent = 0,
00086             const char*    name   = "lvTzConfig_",
00087                   WFlags   flags  = 0
00088         );
00089     public:
00091         void languageChange();
00102         void display(
00103             const OSB_LIB::TariffZone::Oid& tzId,
00104                   bool                      allTz,
00105                   bool                      readOnly
00106         );
00108         ToMenu* cfgMenu();
00109     private:
00111         void add(const OSB_LIB::TzConfig& cfg);
00113         void newCfg();
00114     private slots:
00116         void setupMenu();
00118         void showCfgMenu(
00119                   QListViewItem* item,
00120             const QPoint&        pos,
00121                   int            col
00122         );
00124         void commandEvent(ToMenuCmd cmd);
00125     private:
00131         OSB_LIB::TariffZone::Oid tzId_;
00133         bool allTz_;
00135         bool readOnly_;
00137         ToMenu* cfgMenu_;
00138     };                                  // class LvTzConfig
00139 
00143     class TzConfigItem : public QListViewItem {
00144     public:
00146         explicit TzConfigItem(
00147                   LvTzConfig*        parent,
00148             const OSB_LIB::TzConfig& tzConfig,
00149             const std::string&       tzName,
00150             const std::string&       originName,
00151             const std::string&       destName
00152         );
00154         int compare(
00155             QListViewItem* item,
00156             int            col,
00157             bool           asc
00158         ) const;
00160         const QPixmap* pixmap(int col) const;
00162         void setupMenu(
00163             ToMenu& menu,
00164             bool    readOnly
00165         ) const;
00167         void showCfg();
00169         void changeStatus();
00171         void delCfg();
00172     private:
00174         OSB_LIB::TzConfig tzConfig_;
00175     };                                  // class TzConfigItem
00176 
00181     class TzCfgStatusProxy : public ToCfgTsStatusProxy {
00182     public:
00188         explicit TzCfgStatusProxy(
00189             OSB_LIB::TzConfig& tzCfg
00190         );
00192         TzCfgStatusProxy& operator=(const TzCfgStatusProxy&);
00193     public:
00195         OSB_LIB::ToCfgTsBase& toCfgTs();
00200         void setStatus(
00201             OSB_LIB::CfgStatus  newStatus,
00202             OSB_LIB::OsbErrors& errors
00203         );
00204         // documentation from base
00205         bool setReleaseTs(
00206             const OSB_LIB::DateTime&  ts,
00207                   OSB_LIB::OsbErrors& errors
00208         );
00209     private:
00211         OSB_LIB::TzConfig& tzCfg_;
00212     };                                  // class TzCfgStatusProxy
00213 }                                       // namespace OSB_GUI
00214 
00215 // ************************************************************************
00216 // inline definitions
00217 namespace OSB_GUI {
00218 }                                       // namespace OSB_GUI
00219 #endif                                  // #ifndef _TZCFGVIEW_H_

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