kpassivepopup.h
00001
00002
00003
00004
00005
00006
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
00060 class KPassivePopup : public QFrame
00061 {
00062 Q_OBJECT
00063 Q_PROPERTY (bool autoDelete READ autoDelete WRITE setAutoDelete )
00064 Q_PROPERTY (int timeout READ timeout WRITE setTimeout )
00065
00066 public:
00070 KPassivePopup( QWidget *parent=0, const char *name=0, WFlags f=0 );
00071
00075 KPassivePopup( WId parent, const char *name=0, WFlags f=0 );
00076
00080 virtual ~KPassivePopup();
00081
00085 void setView( QWidget *child );
00086
00090 void setView( const QString &caption, const QString &text = QString::null );
00091
00095 virtual void setView( const QString &caption, const QString &text, const QPixmap &icon );
00096
00117 QVBox * standardView( const QString& caption, const QString& text,
00118 const QPixmap& icon, QWidget *parent = 0L );
00119
00123 QWidget *view() const { return msgView; }
00124
00128 int timeout() const { return hideDelay; }
00129
00136 virtual void setAutoDelete( bool autoDelete );
00137
00142 bool autoDelete() const { return m_autoDelete; }
00143
00150 static KPassivePopup *message( const QString &text, QWidget *parent, const char *name=0 );
00151
00158 static KPassivePopup *message( const QString &caption, const QString &text,
00159 QWidget *parent, const char *name=0 );
00160
00167 static KPassivePopup *message( const QString &caption, const QString &text,
00168 const QPixmap &icon,
00169 QWidget *parent, const char *name=0, int timeout = -1 );
00170
00177 static KPassivePopup *message( const QString &caption, const QString &text,
00178 const QPixmap &icon,
00179 WId parent, const char *name=0, int timeout = -1 );
00180
00181 public slots:
00188 void setTimeout( int delay );
00189
00193 virtual void show();
00194
00195 signals:
00199 void clicked();
00200
00204 void clicked( QPoint pos );
00205
00206 protected:
00210 virtual void positionSelf();
00211
00216 virtual void hideEvent( QHideEvent * );
00217
00221 void moveNear( QRect target );
00222
00226 virtual void mouseReleaseEvent( QMouseEvent *e );
00227
00236 QRect defaultArea() const;
00237
00238 private:
00239 void init();
00240
00241 WId window;
00242 QWidget *msgView;
00243 QBoxLayout *topLayout;
00244 int hideDelay;
00245 QTimer *hideTimer;
00246
00247 QLabel *ttlIcon;
00248 QLabel *ttl;
00249 QLabel *msg;
00250
00251 bool m_autoDelete;
00252
00253
00254 class Private *d;
00255 };
00256
00257 #endif // KPASSIVEPOPUP_H
00258
00259
00260
00261
00262
This file is part of the documentation for kdeui Library Version 3.3.0.