00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.18 $ 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 _ASN1BROWSER_H_ 00031 #define _ASN1BROWSER_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 00039 // + local headers 00040 #include "adminwidget.h" 00041 00042 // + class declarations 00043 namespace OSB_GUI { 00044 class LvAsn1; 00045 class Asn1BrowserCfg; 00046 } 00047 namespace OSB_LIB { 00048 class Asn1InputInfo; 00049 class Asn1Info; 00050 class Asn1Reader; 00051 class CdrInputFile; 00052 class Guard; 00053 } 00054 // QT 00055 class QFrame; 00056 class QHBoxLayout; 00057 class QLabel; 00058 class QPushButton; 00059 class QSpacerItem; 00060 class QSpinBox; 00061 class QVBoxLayout; 00062 class QPopupMenu; 00063 00064 // ************************************************************************ 00065 // namespace extensions 00066 namespace OSB_GUI { 00067 00068 // ************************************************************************ 00069 // forward declarations 00070 00071 // ************************************************************************ 00072 // type definitions 00073 00074 // ************************************************************************ 00075 // class definitions 00079 class Asn1Browser : public AdminWidget 00080 { 00081 Q_OBJECT // for vim ->; 00082 public: 00084 enum MenuCmd { 00086 cmdOpen = 1, 00088 cmdConfig, 00090 cmdCreDes 00091 }; 00092 00093 public: 00098 Asn1Browser( 00099 AdminType type, 00100 QWidget* parent, 00101 const char* name = 0, 00102 WFlags flags = 0 00103 ); 00105 ~Asn1Browser(); 00106 00107 private: 00109 Asn1Browser(const Asn1Browser&); 00111 Asn1Browser& operator=(const Asn1Browser&); 00112 00113 public: 00114 // documentation from base class 00115 std::string menuTitle() const; 00116 // documentation from base class 00117 QPopupMenu* menu(); 00118 // documentation from base class 00119 void clearMenuAccels(); 00120 00122 void mkAsn1Des(); 00123 00124 public slots: 00126 void languageChange(); 00128 void open(); 00134 bool getConfig(bool showRecord); 00136 void showCurRecord(); 00138 void menuEvent(int cmd); 00140 void setNesting(int level); 00141 00142 private: 00144 bool cntRecords(); 00152 OSB_LIB::Guard openFile(); 00161 bool getRecord( 00162 size_t recNum, 00163 OSB_LIB::Asn1Info& dest 00164 ); 00166 bool getAsn1Defs( 00167 OSB_LIB::Asn1InputInfo& dest, 00168 bool allRecords 00169 ); 00171 bool saveAsn1Defs( 00172 const OSB_LIB::Asn1InputInfo& dest 00173 ); 00174 00175 private: 00177 std::string inputPath_; 00179 size_t numRecs_; 00181 size_t filePos_; 00182 00184 OSB_LIB::Asn1InputInfo* asn1Info_; 00186 Asn1BrowserCfg* config_; 00188 OSB_LIB::Asn1Reader* reader_; 00190 OSB_LIB::CdrInputFile* input_; 00191 00192 private: // widgets 00194 LvAsn1* lvAsn1_; 00195 00197 QPopupMenu* menu_; 00198 00200 QFrame* linePb_; 00202 QSpinBox* sbRecNum_; 00204 QLabel* tlInfo_; 00206 QSpacerItem* spPb_; 00208 QLabel* tlNesting_; 00210 QSpinBox* sbNesting_; 00211 00213 QVBoxLayout* layout_; 00215 QHBoxLayout* loPb_; 00216 }; // class Asn1Browser 00217 } // namespace OSB_GUI 00218 00219 // ************************************************************************ 00220 // inline definitions 00221 namespace OSB_GUI { 00222 } // namespace OSB_GUI 00223 #endif // #ifndef _ASN1BROWSER_H_