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 class QBoxLayout;
00015 class QTimer;
00016 class QLabel;
00017 class QVBox;
00018 
00059 class KPassivePopup : public QFrame
00060 {
00061     Q_OBJECT
00062 
00063 public:
00067     KPassivePopup( QWidget *parent=0, const char *name=0, WFlags f=0 );
00068 
00072     KPassivePopup( WId parent, const char *name=0, WFlags f=0 );
00073 
00077     virtual ~KPassivePopup();
00078 
00082     void setView( QWidget *child );
00083 
00087     void setView( const QString &caption, const QString &text = QString::null );
00088 
00092     virtual void setView( const QString &caption, const QString &text, const QPixmap &icon );
00093 
00111     QVBox * standardView( const QString& caption, const QString& text,
00112                           const QPixmap& icon, QWidget *parent = 0L );
00113     
00117     QWidget *view() const { return msgView; }
00118 
00122     int timeout() const { return hideDelay; }
00123 
00130     virtual void setAutoDelete( bool autoDelete );
00131 
00136     bool autoDelete() const { return m_autoDelete; }
00137 
00144     static KPassivePopup *message( const QString &text, QWidget *parent, const char *name=0 );
00145 
00152     static KPassivePopup *message( const QString &caption, const QString &text,
00153                                    QWidget *parent, const char *name=0 );
00154 
00161     static KPassivePopup *message( const QString &caption, const QString &text,
00162                                    const QPixmap &icon,
00163                                    QWidget *parent, const char *name=0, int timeout = -1 );
00164 
00171     static KPassivePopup *message( const QString &caption, const QString &text,
00172                                    const QPixmap &icon,
00173                                    WId parent, const char *name=0, int timeout = -1 );
00174 
00175 public slots:
00182     void setTimeout( int delay );
00183 
00187     virtual void show();
00188 
00189 signals:
00193     void clicked();
00194 
00198     void clicked( QPoint pos );
00199 
00200 protected:
00204     virtual void positionSelf();
00205 
00210     virtual void hideEvent( QHideEvent * );
00211 
00215     void moveNear( QRect target );
00216 
00220     virtual void mouseReleaseEvent( QMouseEvent *e );
00221 
00230     QRect defaultArea() const;
00231 
00232 private:
00233     void init();
00234 
00235     WId window;
00236     QWidget *msgView;
00237     QBoxLayout *layout;
00238     int hideDelay;
00239     QTimer *hideTimer;
00240 
00241     QLabel *ttlIcon;
00242     QLabel *ttl;
00243     QLabel *msg;
00244 
00245     bool m_autoDelete;
00246 
00247     /* @internal */
00248     class Private *d;
00249 };
00250 
00251 #endif // KPASSIVEPOPUP_H
00252 
00253 // Local Variables:
00254 // c-basic-offset: 4
00255 // End:
00256 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:57:31 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001