privmodacs.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.2 $
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 _PRIVMODACS_H_
00031 #define _PRIVMODACS_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <osbid.h>
00039 
00040 #include <qlistview.h>
00041 
00042 // + local headers
00043 
00044 // + class declarations
00045 namespace OSB_LIB {
00046     class ModAccessMap;
00047     class ModAccess;
00048 }
00049 
00050 namespace OSB_GUI {
00051     class CmbOsbModule;
00052 }
00053 
00054 class QHBoxLayout;
00055 class QHBoxLayout;
00056 class QLabel;
00057 class QPushButton;
00058 class QPushButton;
00059 class QPushButton;
00060 class QSpacerItem;
00061 class QVBoxLayout;
00062 
00063 // ************************************************************************
00064 // namespace extensions
00065 namespace OSB_GUI {
00066 
00067 // ************************************************************************
00068 // forward declarations
00069     class LvModAccess;
00070     class ModAccessItem;
00071 
00072 // ************************************************************************
00073 // type definitions
00074 
00075 // ************************************************************************
00076 // class definitions
00080     class WdgtModAccess : public QWidget {
00081         Q_OBJECT                        // for vim ->;
00082     public:
00084         WdgtModAccess(
00085                   QWidget* parent,
00086             const char*    name    = 0,
00087                   WFlags   flags   = 0
00088         );
00089     private:
00091         WdgtModAccess(const WdgtModAccess&);
00093         WdgtModAccess& operator=(const WdgtModAccess&);
00094 
00095     public slots:
00097         void languageChange();
00098 
00099     public:
00106         void populate();
00113         const OSB_LIB::ModuleId curModule() const;
00114 
00115     private slots:
00117         void modChanged();
00122         void addSibling();
00127         void addChild();
00131         void editAccess();
00135         void delAccess();
00137         void enablePbs();
00138 
00139     private:                            // utils
00147         void  addAccess(
00148             bool addSibling
00149         );
00150 
00151     private:                            // data
00153         OSB_LIB::ModuleId curModule_;
00154 
00155     private:                            // widgets
00157         QVBoxLayout* layout_;
00158 
00160         QLabel* tlModule_;
00162         CmbOsbModule* cmbModule_;
00164         QHBoxLayout* loHead_;
00165 
00167         LvModAccess* lvAccess_;
00168 
00170         QFrame* linePb_;
00172         QPushButton* pbSibling_;
00174         QPushButton* pbChild_;
00176         QPushButton* pbEdit_;
00178         QPushButton* pbDel_;
00179 
00181         QHBoxLayout* loPb_;
00183         QSpacerItem* spPb_;
00184     };                                  // class WdgtModAccess
00185 
00189     class LvModAccess : public QListView {
00190         Q_OBJECT                        // for vim ->;
00191     public:
00193         LvModAccess(
00194                   QWidget* parent,
00195             const char*    name    = 0,
00196                   WFlags   flags   = 0
00197         );
00198 
00199     public slots:
00201         void languageChange();
00202 
00203     public:
00209         void populate(
00210             const OSB_LIB::ModAccessMap& accessMap
00211         );
00219         void select(
00220             const OSB_LIB::Id<OSB_LIB::ModAccess> modId
00221         );
00228         const OSB_LIB::ModAccess* modAccess() const;
00229     private:
00231         void populate(
00232                   QListViewItem*                  parent,
00233             const OSB_LIB::ModAccessMap&          accessMap,
00234             const OSB_LIB::Id<OSB_LIB::ModAccess> modParent
00235         );
00236     };                                  // class LvModAccess
00237 
00241     class ModAccessItem : public QListViewItem {
00242     public:
00244         ModAccessItem(
00245             const OSB_LIB::ModAccess& access,
00246                   QListView*          parent
00247         );
00249         ModAccessItem(
00250             const OSB_LIB::ModAccess& access,
00251                   QListViewItem*      parent
00252         );
00254         ~ModAccessItem();
00255 
00256     private:
00258         ModAccessItem(const ModAccessItem&);
00260         ModAccessItem& operator=(const ModAccessItem&);
00261 
00262     public:
00264         const OSB_LIB::ModAccess& modAccess() const;
00265 
00266     private:
00268         void setup();
00270         void setTexts();
00271     private:
00273         OSB_LIB::ModAccess* modAccess_;
00274     };                                  // class ModAccessItem
00275 }                                       // namespace OSB_GUI
00276 
00277 // ************************************************************************
00278 // inline definitions
00279 namespace OSB_GUI {
00280 }                                       // namespace OSB_GUI
00281 #endif                                  // #ifndef _PRIVMODACS_H_

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