• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kpassivepopup.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 
00003 /*
00004  *   Copyright            : (C) 2001-2006 by Richard Moore
00005  *   Copyright            : (C) 2004-2005 by Sascha Cunz
00006  *   License              : This file is released under the terms of the LGPL, version 2.
00007  *   Email                : rich@kde.org
00008  *   Email                : sascha.cunz@tiscali.de
00009  *
00010  *   This library is free software; you can redistribute it and/or
00011  *   modify it under the terms of the GNU Lesser General Public
00012  *   License as published by the Free Software Foundation; either
00013  *   version 2 of the License, or (at your option) any later version.
00014  *
00015  *   This library is distributed in the hope that it will be useful,
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *   Lesser General Public License for more details.
00019  *
00020  *   You should have received a copy of the GNU Lesser General Public
00021  *   License along with this library; if not, write to the Free Software
00022  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 #ifndef KPASSIVEPOPUP_H
00026 #define KPASSIVEPOPUP_H
00027 
00028 #include <kdeui_export.h>
00029 
00030 #include <QtGui/QFrame>
00031 
00032 class KVBox;
00033 class QSystemTrayIcon;
00034 
00082 class KDEUI_EXPORT KPassivePopup : public QFrame
00083 {
00084     Q_OBJECT
00085     Q_PROPERTY (bool autoDelete READ autoDelete WRITE setAutoDelete )
00086     Q_PROPERTY (int timeout READ timeout WRITE setTimeout )
00087     Q_PROPERTY (QRect defaultArea READ defaultArea )
00088 
00089 public:
00093     enum PopupStyle
00094     {
00095         Boxed,             
00096         Balloon,           
00097     CustomStyle=128    
00098     };
00099 
00103     explicit KPassivePopup( QWidget *parent=0, Qt::WFlags f = 0 );
00104 
00108     explicit KPassivePopup( WId parent );
00109 
00110 #if 0 // These break macos and win32 where the definition of WId makes them ambiguous
00111 
00115     explicit KPassivePopup( int popupStyle, QWidget *parent=0, Qt::WFlags f=0 ) KDE_DEPRECATED;
00116 
00121     KPassivePopup( int popupStyle, WId parent, Qt::WFlags f=0 ) KDE_DEPRECATED;
00122 #endif
00123 
00127     virtual ~KPassivePopup();
00128 
00132     void setView( QWidget *child );
00133 
00137     void setView( const QString &caption, const QString &text = QString() );
00138 
00142     virtual void setView( const QString &caption, const QString &text, const QPixmap &icon );
00143 
00164     KVBox * standardView( const QString& caption, const QString& text,
00165                           const QPixmap& icon, QWidget *parent = 0L );
00166 
00170     QWidget *view() const;
00171 
00175     int timeout() const;
00176 
00183     virtual void setAutoDelete( bool autoDelete );
00184 
00189     bool autoDelete() const;
00190 
00199     QRect defaultArea() const;
00200 
00204     QPoint anchor() const;
00205 
00210     void setAnchor( const QPoint& anchor );
00211 
00212     // TODO KDE4: give all the static methods a const QPoint p = QPoint() that in
00213     // case the point is not null calls the show(const QPoint &p) method instead
00214     // of the show() one.
00221     static KPassivePopup *message( const QString &text, QWidget *parent );
00222 
00229     static KPassivePopup *message( const QString &text, QSystemTrayIcon *parent );
00230 
00237     static KPassivePopup *message( const QString &caption, const QString &text,
00238                    QWidget *parent );
00239 
00246     static KPassivePopup *message( const QString &caption, const QString &text,
00247                    QSystemTrayIcon *parent );
00248 
00255     static KPassivePopup *message( const QString &caption, const QString &text,
00256                    const QPixmap &icon,
00257                    QWidget *parent, int timeout = -1 );
00258 
00265     static KPassivePopup *message( const QString &caption, const QString &text,
00266                    const QPixmap &icon,
00267                    QSystemTrayIcon *parent, int timeout = -1 );
00268 
00275     static KPassivePopup *message( const QString &caption, const QString &text,
00276                    const QPixmap &icon,
00277                    WId parent, int timeout = -1 );
00278 
00285     static KPassivePopup *message( int popupStyle, const QString &text, QWidget *parent );
00286 
00293     static KPassivePopup *message( int popupStyle, const QString &text, QSystemTrayIcon *parent );
00294 
00301     static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
00302                    QSystemTrayIcon *parent );
00303 
00310     static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
00311                    QWidget *parent );
00312 
00319     static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
00320                    const QPixmap &icon,
00321                    QWidget *parent, int timeout = -1 );
00322 
00329     static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
00330                    const QPixmap &icon,
00331                    QSystemTrayIcon *parent, int timeout = -1 );
00332 
00339     static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
00340                    const QPixmap &icon,
00341                    WId parent, int timeout = -1 );
00342 
00343 
00344 public Q_SLOTS:
00353     void setTimeout( int delay );
00354 
00359     void setPopupStyle( int popupstyle );
00360 
00364     void show();
00365 
00369     void show(const QPoint &p);
00370 
00371     virtual void setVisible(bool visible);
00372 
00373 Q_SIGNALS:
00377     void clicked();
00378 
00382     void clicked( const QPoint &pos );
00383 
00384 protected:
00388     virtual void positionSelf();
00389 
00394     virtual void hideEvent( QHideEvent * );
00395 
00399     void moveNear( const QRect &target );
00400 
00404     QPoint calculateNearbyPoint( const QRect &target);
00405 
00409     virtual void mouseReleaseEvent( QMouseEvent *e );
00410 
00414     void updateMask();
00415 
00420     virtual void paintEvent( QPaintEvent* pe );
00421 
00422 private:
00423     void init( WId window );
00424 
00425     /* @internal */
00426     class Private;
00427     Private *const d;
00428 };
00429 
00430 #endif // KPASSIVEPOPUP_H
00431 
00432 // Local Variables:
00433 // c-basic-offset: 4
00434 // End:
00435 

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal