sditems.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 $
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 _SDITEMS_H_
00031 #define _SDITEMS_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <osbid.h>
00039 
00040 // + local headers
00041 #include "tolists.h"
00042 #include "tomenu.h"
00043 
00044 // ************************************************************************
00045 // class declarations
00046 namespace OSB_LIB {
00047     class DayClass;
00048     class SpecialDate;
00049 }
00050 namespace OSB_GUI {
00051     class DlgDc;
00052 }
00053 
00054 // ************************************************************************
00055 // namespace extensions
00056 namespace OSB_GUI {
00057 
00058 // ************************************************************************
00059 // class definitions
00063     class SdItem : public QListViewItem {
00064         typedef OSB_LIB::Id<OSB_LIB::SpecialDate> ObjId;
00065         typedef OSB_LIB::CfgStatus Status;
00066     public:
00068         enum Col {
00069             colFirst = 0,
00070             colName = colFirst,
00071             colId,
00072             colDate,
00073             colAnnual,
00074             colStatus,
00075             colLast = colStatus
00076         };
00077     public:
00078         SdItem(
00079                   QListView*            parent,
00080             const OSB_LIB::SpecialDate& sd
00081         );
00083         void destroy() const;
00084     private:
00086         ~SdItem();
00087     public:
00088         void showObject() const;
00089         void editObject();
00090         void changeStatus();
00091         bool delObject();
00093         void setupMenu(ToMenu& sdMenu) const;
00094     private:
00095         virtual int compare(QListViewItem* i, int col, bool asc) const;
00096         virtual const QPixmap* pixmap(int col) const;
00097 
00098         void set(const OSB_LIB::SpecialDate& sd);
00099         int objId() const;
00100     private:
00101         ObjId  objId_;
00102         Status status_;
00103         QDate  date_;
00104         bool   annual_;
00105     };                                  // class SdItem
00106 
00110     class SdList : public QListView {
00111         Q_OBJECT                        // for vim ->;
00113         typedef OSB_LIB::Id<OSB_LIB::DayClass> DcId;
00115         friend class DlgDc;
00116     public:
00118         explicit SdList(
00119                   QWidget* parent,
00120             const char*    name   = 0,
00121                   WFlags   f      = 0
00122         );
00123     private:
00125         SdList(const SdList&);
00127         SdList& operator=(const SdList&);
00128     public:
00129         const SdItem* add(const OSB_LIB::SpecialDate& sd);
00130     public:
00132         void languageChange();
00133     private:                            // for DlgDc only
00140         void setup(
00141             const DcId& dcId,
00142                   bool  showOnly
00143         );
00145         ToMenu* sdMenu();
00146     public slots:
00148         bool setupMenu();
00150         void commandEvent(ToMenuCmd cmd);
00156         void rightClickEvent(QListViewItem*, const QPoint& pt, int);
00157     private:
00159         void newSd();
00160     private:
00162         DcId dcId_;
00164         bool showOnly_;
00166         ToMenu* sdMenu_;
00167     };                                  // class SdList
00168 }                                       // namespace OSB_GUI
00169 #endif                                  // #ifndef _SDITEMS_H_

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