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 00060 class KPassivePopup : public QFrame 00061 { 00062 Q_OBJECT 00063 00064 public: 00068 KPassivePopup( QWidget *parent=0, const char *name=0, WFlags f=0 ); 00069 00073 KPassivePopup( WId parent, const char *name=0, WFlags f=0 ); 00074 00078 virtual ~KPassivePopup(); 00079 00083 void setView( QWidget *child ); 00084 00088 void setView( const QString &caption, const QString &text = QString::null ); 00089 00093 virtual void setView( const QString &caption, const QString &text, const QPixmap &icon ); 00094 00115 QVBox * standardView( const QString& caption, const QString& text, 00116 const QPixmap& icon, QWidget *parent = 0L ); 00117 00121 QWidget *view() const { return msgView; } 00122 00126 int timeout() const { return hideDelay; } 00127 00134 virtual void setAutoDelete( bool autoDelete ); 00135 00140 bool autoDelete() const { return m_autoDelete; } 00141 00148 static KPassivePopup *message( const QString &text, QWidget *parent, const char *name=0 ); 00149 00156 static KPassivePopup *message( const QString &caption, const QString &text, 00157 QWidget *parent, const char *name=0 ); 00158 00165 static KPassivePopup *message( const QString &caption, const QString &text, 00166 const QPixmap &icon, 00167 QWidget *parent, const char *name=0, int timeout = -1 ); 00168 00175 static KPassivePopup *message( const QString &caption, const QString &text, 00176 const QPixmap &icon, 00177 WId parent, const char *name=0, int timeout = -1 ); 00178 00179 public slots: 00186 void setTimeout( int delay ); 00187 00191 virtual void show(); 00192 00193 signals: 00197 void clicked(); 00198 00202 void clicked( QPoint pos ); 00203 00204 protected: 00208 virtual void positionSelf(); 00209 00214 virtual void hideEvent( QHideEvent * ); 00215 00219 void moveNear( QRect target ); 00220 00224 virtual void mouseReleaseEvent( QMouseEvent *e ); 00225 00234 QRect defaultArea() const; 00235 00236 private: 00237 void init(); 00238 00239 WId window; 00240 QWidget *msgView; 00241 QBoxLayout *topLayout; 00242 int hideDelay; 00243 QTimer *hideTimer; 00244 00245 QLabel *ttlIcon; 00246 QLabel *ttl; 00247 QLabel *msg; 00248 00249 bool m_autoDelete; 00250 00251 /* @internal */ 00252 class Private *d; 00253 }; 00254 00255 #endif // KPASSIVEPOPUP_H 00256 00257 // Local Variables: 00258 // c-basic-offset: 4 00259 // End: 00260
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Aug 30 22:53:58 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003