osbpopup.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.8 $
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 _OSBPOPUP_H_
00031 #define _OSBPOPUP_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <qwidget.h>
00039 #include <qlineedit.h>
00040 
00041 // + local headers
00042 
00043 // ************************************************************************
00044 // class declarations
00045 
00046 // ************************************************************************
00047 // namespace extensions
00048 namespace OSB_GUI {
00049 
00050 // ************************************************************************
00051 // forward declarations
00052 
00053 // ************************************************************************
00054 // type definitions
00055 
00056 // ************************************************************************
00057 // class definitions
00061     class Popup : public QWidget {
00062         Q_OBJECT                        // for vim ->;
00063     public:
00070         explicit Popup(
00071                   QWidget* parent,
00072             const char*    name,
00073                   WFlags   flags   = Qt::WType_Popup
00074         );
00076         virtual ~Popup() = 0;
00077     public:
00083         void popup(QWidget* served);
00090         void popup(
00091                   QWidget* served,
00092             const QPoint&  pos
00093         );
00099         bool result() const;
00101         bool keyClosed() const;
00103         QWidget* prevServed() const;
00105         void resetPrevServed();
00106     signals:
00113         void sigClosed(bool result);
00114     protected:
00116         virtual void closeEvent(QCloseEvent* event);
00123         virtual void keyPressEvent(QKeyEvent* event);
00124     private:
00126         bool result_;
00128         QWidget* served_;
00130         QWidget* prevServed_;
00139         bool keyClosed_;
00140     };                                  // class Popup
00141 
00145     class LePopup : public QLineEdit {
00146         Q_OBJECT                        // for vim ->;
00147     public:
00149         explicit LePopup(
00150                   QWidget* parent,
00151             const char*    name   = "leSe_"
00152         );
00153     public:
00155         void setPopup(Popup* popup);
00156     protected:
00158         virtual void focusInEvent(QFocusEvent* event);
00160         virtual void keyPressEvent(QKeyEvent* event);
00162         virtual void mousePressEvent(QMouseEvent* event);
00163     private slots:
00165         virtual void popup();
00167         virtual void popupClosed(bool result);
00168     private:
00170         Popup* popup_;
00171     };                                  // LePopup
00172 }                                       // namespace OSB_GUI
00173 
00174 // ************************************************************************
00175 // inline definitions
00176 namespace OSB_GUI {
00177 }                                       // namespace OSB_GUI
00178 #endif                                  // #ifndef _OSBPOPUP_H_

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