kdeui Library API Documentation

kpassivepopup.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *   Copyright            : (C) 2001-2002 by Richard Moore
00005  *   License              : This file is released under the terms of the LGPL, version 2.
00006  *   Email                : rich@kde.org
00007  */
00008 
00009 #ifndef KPASSIVEPOPUP_H
00010 #define KPASSIVEPOPUP_H
00011 
00012 #include <qframe.h>
00013 
00014 #include <kdelibs_export.h>
00015 
00016 class QBoxLayout;
00017 class QTimer;
00018 class QLabel;
00019 class QVBox;
00020 
00062 class KDEUI_EXPORT KPassivePopup : public QFrame
00063 {
00064     Q_OBJECT
00065     Q_PROPERTY (bool autoDelete READ autoDelete WRITE setAutoDelete )
00066     Q_PROPERTY (int timeout READ timeout WRITE setTimeout )
00067 
00068 public:
00072     KPassivePopup( QWidget *parent=0, const char *name=0, WFlags f=0 );
00073 
00077     KPassivePopup( WId parent, const char *name=0, WFlags f=0 );
00078 
00082     virtual ~KPassivePopup();
00083 
00087     void setView( QWidget *child );
00088 
00092     void setView( const QString &caption, const QString &text = QString::null );
00093 
00097     virtual void setView( const QString &caption, const QString &text, const QPixmap &icon );
00098 
00119     QVBox * standardView( const QString& caption, const QString& text,
00120                           const QPixmap& icon, QWidget *parent = 0L );
00121     
00125     QWidget *view() const { return msgView; }
00126 
00130     int timeout() const { return hideDelay; }
00131 
00138     virtual void setAutoDelete( bool autoDelete );
00139 
00144     bool autoDelete() const { return m_autoDelete; }
00145 
00152     static KPassivePopup *message( const QString &text, QWidget *parent, const char *name=0 );
00153 
00160     static KPassivePopup *message( const QString &caption, const QString &text,
00161                    QWidget *parent, const char *name=0 );
00162 
00169     static KPassivePopup *message( const QString &caption, const QString &text,
00170                    const QPixmap &icon,
00171                    QWidget *parent, const char *name=0, int timeout = -1 );
00172 
00179     static KPassivePopup *message( const QString &caption, const QString &text,
00180                    const QPixmap &icon,
00181                    WId parent, const char *name=0, int timeout = -1 );
00182 
00183 public slots:
00190     void setTimeout( int delay );
00191 
00195     virtual void show();
00196 
00197 signals:
00201     void clicked();
00202 
00206     void clicked( QPoint pos );
00207 
00208 protected:
00212     virtual void positionSelf();
00213 
00218     virtual void hideEvent( QHideEvent * );
00219 
00223     void moveNear( QRect target );
00224 
00228     virtual void mouseReleaseEvent( QMouseEvent *e );
00229 
00238     QRect defaultArea() const;
00239 
00240 private:
00241     void init();
00242 
00243     WId window;
00244     QWidget *msgView;
00245     QBoxLayout *topLayout;
00246     int hideDelay;
00247     QTimer *hideTimer;
00248 
00249     QLabel *ttlIcon;
00250     QLabel *ttl;
00251     QLabel *msg;
00252 
00253     bool m_autoDelete;
00254 
00255     /* @internal */
00256     class Private *d;
00257 };
00258 
00259 #endif // KPASSIVEPOPUP_H
00260 
00261 // Local Variables:
00262 // c-basic-offset: 4
00263 // End:
00264 
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 16 06:49:58 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003