scsutils.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 _SCSUTILS_H_
00031 #define _SCSUTILS_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 "tautils.h"
00043 #include "ui/scsvsgui.h"
00044 
00045 // ************************************************************************
00046 // class declarations
00047 namespace OSB_LIB {
00048     class RatedService;
00049     class ServiceClass;
00050     class ScsVersion;
00051 }
00052 
00053 // ************************************************************************
00054 // namespace extensions
00055 namespace OSB_GUI {
00056 
00057 // ************************************************************************
00058 // forward declarations
00059 
00060 // ************************************************************************
00061 // type definitions
00062 
00063 // ************************************************************************
00064 // class definitions
00069     class ScsVsStatusProxy : public ToCfgTsStatusProxy {
00070     public:
00076         explicit ScsVsStatusProxy(
00077             OSB_LIB::ScsVersion& scsVs
00078         );
00079     private:
00081         ScsVsStatusProxy& operator=(const ScsVsStatusProxy&);
00082     public:
00084         OSB_LIB::ToCfgTsBase& toCfgTs();
00089         void setStatus(
00090             OSB_LIB::CfgStatus  newStatus,
00091             OSB_LIB::OsbErrors& errors
00092         );
00093         // documentation from base class
00094         bool setReleaseTs(
00095             const OSB_LIB::DateTime&  ts,
00096                   OSB_LIB::OsbErrors& errors
00097         );
00098     private:
00100         OSB_LIB::ScsVersion& scsVs_;
00101     };                                  // class ScsVsStatusProxy
00102 
00106     class ScsConfig : public ScsConfigGui {
00107         Q_OBJECT                        // for vim ->;
00108     public:
00110         class ScItem;
00112         class RsItem;
00113     public:
00115         explicit ScsConfig(
00116                   QWidget* parent,
00117             const char*    name   = "scsConfig_",
00118                   WFlags   flags  = 0
00119         );
00121         void languageChange();
00128         void display(
00129             const OSB_LIB::ScsVersion& scsVs,
00130                   bool                 showOnly
00131         );
00137         void populate(
00138             OSB_LIB::ScsVersion* scsVs
00139         ) const;
00140     private:
00142         void arrangeWidgets(bool showOnly);
00143     private slots:
00145         void setPbs();
00147         void removeCfg();
00149         void addSc();
00151         void addRs();
00152     };                                  // class ScsConfig
00153 
00157     class ScsConfig::ScItem : public QListViewItem {
00158     private:
00160         typedef OSB_LIB::Id<OSB_LIB::ServiceClass> ScId;
00161     public:
00163         ScItem(
00164                   QListView*             parent,
00165             const OSB_LIB::ServiceClass& sc
00166         );
00168         const OSB_LIB::Id<OSB_LIB::ServiceClass> scId() const;
00169     private:
00171         int compare(
00172             QListViewItem* item,
00173             int            col,
00174             bool           asc
00175         ) const;
00176     private:
00178         ScId scId_;
00179     };                                  // class ScsConfig::ScItem
00180 
00184     class ScsConfig::RsItem : public QListViewItem {
00185     private:
00187         typedef OSB_LIB::Id<OSB_LIB::RatedService> RsId;
00188     public:
00190         RsItem(
00191                   QListView*             parent,
00192             const OSB_LIB::RatedService& rs
00193         );
00195         RsItem(
00196                   QListViewItem*         parent,
00197             const OSB_LIB::RatedService& rs
00198         );
00200         const OSB_LIB::Id<OSB_LIB::RatedService> rsId() const;
00201     private:
00203         int compare(
00204             QListViewItem* item,
00205             int            col,
00206             bool           asc
00207         ) const;
00208     private:
00210         RsId rsId_;
00211     };                                  // class ScsConfig::RsItem
00212 }                                       // namespace OSB_GUI
00213 
00214 // ************************************************************************
00215 // inline definitions
00216 namespace OSB_GUI {
00217 }                                       // namespace OSB_GUI
00218 #endif                                  // #ifndef _SCSUTILS_H_

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