streamutils.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.2.1 $
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 _STREAMUTILS_H_
00031 #define _STREAMUTILS_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 #include <string>
00037 
00038 // + libraries
00039 #include <callaccounting.h>
00040 #include <recordstream.h>
00041 
00042 #include <qframe.h>
00043 #include <qmenudata.h>
00044 
00045 // + local headers
00046 #include "osbcombos.h"
00047 
00048 // + class declarations
00049 class QButtonGroup;
00050 class QPushButton;
00051 class QGridLayout;
00052 class QVBoxLayout;
00053 
00054 // ************************************************************************
00055 // namespace extensions
00056 namespace OSB_GUI {
00057 
00058 // ************************************************************************
00059 // free functions
00061     const QPixmap& pmStreamStatus(OSB_LIB::RecordStream::Status s);
00063     std::string strStreamStatus(OSB_LIB::RecordStream::Status s);
00065     std::string strStreamType(OSB_LIB::RecordStream::Type t);
00067     std::string strCaResult(OSB_LIB::CallAccounting::Result r);
00068 
00069 // ************************************************************************
00070 // class definitions
00071 
00073     typedef ValueCombo<OSB_LIB::RecordStream::Status> CmbStreamStatusBase;
00075     class CmbStreamStatus : public CmbStreamStatusBase {
00076     public:
00078         CmbStreamStatus(
00079                   QWidget* parent,
00080             const char*    name
00081         );
00082     public:
00089         void populate();
00090     private:
00092         void add(OSB_LIB::RecordStream::Status s);
00093     };                                  // class CmbStreamStatus
00094 
00096     typedef ValueCombo<OSB_LIB::RecordSource::Oid> CmbRecordSourceBase;
00098     class CmbRecordSource : public CmbRecordSourceBase {
00099     public:
00101         CmbRecordSource(
00102                   QWidget* parent,
00103             const char*    name
00104         );
00105 
00106     public:
00112         void populate(
00113             const OSB_LIB::RecordSources& sources
00114         );
00115     };                                  // class CmbStreamStatus
00116 
00120     class StreamStatusPopup : public QFrame {
00121         Q_OBJECT                        // for vim ->;
00122     public:
00124         StreamStatusPopup(
00125                   QWidget* parent = 0,
00126             const char*    name   = "rsStatusPopup_",
00127                   WFlags   flags  = Qt::WType_Popup
00128         );
00129 
00130     public:
00140         void popup(
00141                   OSB_LIB::RecordStream::Status rs,
00142                   bool                          all,
00143             const QPoint&                       pos
00144         );
00145 
00156         void popup(
00157                   OSB_LIB::RecordStream::Status rs,
00158                   bool                          all,
00159             const QWidget&                      widget
00160         );
00161 
00163         OSB_LIB::RecordStream::Status rsStatus() const;
00164 
00165     signals:
00171         void accepted(OSB_LIB::RecordStream::Status rs);
00172     private slots:
00178         void accept();
00179     private:
00181         void clear();
00188         void setup(
00189             OSB_LIB::RecordStream::Status rs,
00190             bool                          all
00191         );
00198         void add(
00199             OSB_LIB::RecordStream::Status rs,
00200             int                           row
00201         );
00208         void keyPressEvent(QKeyEvent* event);
00209 
00210     private:
00212         QButtonGroup* radioGroup_;
00214         QFrame*       linePb_;
00216         QPushButton*  pbOk_;
00218         QGridLayout*  rsLayout_;
00220         QVBoxLayout*  layout_;
00221     };                                  // class StreamStatusPopup
00222 
00226     class RsStatusMenuItem : public QCustomMenuItem {
00227     public:
00229         RsStatusMenuItem(OSB_LIB::RecordStream::Status rs);
00230     public:
00233         void paint(
00234                   QPainter*    p,
00235             const QColorGroup& cg,
00236                   bool         act,
00237                   bool         enabled,
00238                   int          x,
00239                   int          y,
00240                   int          w,
00241                   int          h
00242         );
00244         QSize sizeHint();
00246         void setFont(const QFont& font);
00247     private:
00249         OSB_LIB::RecordStream::Status rs_;
00251         QFont font_;
00253         QSize sizeHint_;
00254     };                                  // class RsStatusMenuItem
00255 }                                       // namespace OSB_GUI
00256 
00257 // ************************************************************************
00258 // inline definitions
00259 namespace OSB_GUI {
00260 }                                       // namespace OSB_GUI
00261 #endif                                  // #ifndef _STREAMUTILS_H_

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