asn1guiutil.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 _ASN1GUIUTIL_H_
00031 #define _ASN1GUIUTIL_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <qlistview.h>
00039 
00040 #include <asn1.h>
00041 
00042 // + local headers
00043 #include "asn1cfggui.h"
00044 
00045 // + class declarations
00046 namespace OSB_LIB {
00047     class Asn1Info;
00048     class Asn1InputInfo;
00049     class Asn1TagDes;
00050 }
00051 // Qt
00052 class QCheckBox;
00053 
00054 // ************************************************************************
00055 // namespace extensions
00056 namespace OSB_GUI {
00057 
00058 // ************************************************************************
00059 // forward declarations
00060     class Asn1Item;
00061 
00062 // ************************************************************************
00063 // type definitions
00064 
00065 // ************************************************************************
00066 // class definitions
00070     class LvAsn1 : public QListView {
00071     public:
00073         LvAsn1(
00074                   QWidget*  parent,
00075             const char*     name   = 0,
00076                   WFlags    flags  = 0
00077         );
00078     public:
00080         void languageChange();
00082         void populate(
00083             const OSB_LIB::Asn1InputInfo& tagInfos,
00084                   OSB_LIB::Asn1Info&      info,
00085                   bool                    showTags
00086         );
00088         void showNesting(int level);
00089     private:
00091         void populate(
00092             const OSB_LIB::Asn1InputInfo& tagInfos,
00093                   OSB_GUI::Asn1Item*      parent,
00094                   OSB_LIB::Asn1Info&      info,
00095                   bool                    showTags
00096         );
00098         void openTags(
00099             QListViewItem* item,
00100             int            level
00101         );
00102     private:
00104         std::list<OSB_LIB::Asn1Tag> tagStack_;
00105     };                                   // class LvAsn1
00106 
00110     class Asn1Item : public QListViewItem {
00111     public:
00113         Asn1Item(
00114                   QListView*           parent,
00115                   QListViewItem*       after,
00116             const OSB_LIB::Asn1Info&   asn1,
00117             const OSB_LIB::Asn1TagDes* tagDes,
00118                   bool                 showTag
00119         );
00121         Asn1Item(
00122                   QListViewItem*       parent,
00123                   QListViewItem*       after,
00124             const OSB_LIB::Asn1Info&   asn1,
00125             const OSB_LIB::Asn1TagDes* tagDes,
00126                   bool                 showTag
00127         );
00128     private:
00130         void setup();
00131 
00133         void showAsn1(
00134             const OSB_LIB::Asn1Info&   asn1,
00135             const OSB_LIB::Asn1TagDes* tagDes,
00136                   bool                 showTag
00137         );
00138     };                                  // class Asn1Item
00139 
00143     struct Asn1BrowserCfg {
00144     public:
00156         Asn1BrowserCfg();
00157     public:
00159         std::list<std::string> desPaths_;
00160 
00162         std::string desName_;
00164         std::string desDir_;
00165 
00167         size_t blkSize_;
00169         OSB_LIB::Asn1Byte blkFiller_;
00170 
00172         bool allDes_;
00174         bool mergeDes_;
00176         bool showTags_;
00178         bool autoConfig_;
00180         int indentLevel_;
00181 
00182     public:
00184         std::string desPath() const;
00186         void setDesPath(
00187             const std::string& desPath
00188         );
00189     };                                  // struct Asn1BrowserCfg
00190 
00194     class DlgAsn1Cfg : public DlgAsn1CfgGui {
00195         Q_OBJECT                        // for vim ->;
00196     public:
00198         DlgAsn1Cfg(
00199                   QWidget* parent,
00200             const char*    name   = 0,
00201                   WFlags   flags  = 0
00202         );
00203 
00204     public:
00206         void languageChange();
00212         int exec(Asn1BrowserCfg& config);
00213 
00215         bool haveBlkSize() const;
00217         bool haveBlkFiller() const;
00218 
00219     private:
00221         void accept();
00223         void setWidgets();
00225         bool setConfig();
00226     private slots:
00228         void pathChanged();
00230         void openAsn1Des();
00231 
00232     private:
00234         Asn1BrowserCfg* config_;
00235     };                                  // class DlgAsn1Cfg
00236 }                                       // namespace OSB_GUI
00237 
00238 // ************************************************************************
00239 // inline definitions
00240 namespace OSB_GUI {
00241 }                                       // namespace OSB_GUI
00242 #endif                                  // #ifndef _ASN1GUIUTIL_H_

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