kwindowinfo.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 KWINDOWINFO_H
00010 #define KWINDOWINFO_H
00011 
00012 #include <qobject.h>
00013 #include <qpixmap.h>
00014 #include <qstring.h>
00015 
00016 #include <kdelibs_export.h>
00017 
00041 class KDEUI_EXPORT KWindowInfo : public QObject
00042 {
00043     Q_OBJECT
00044 
00045 public:
00049     KWindowInfo( QWidget *parent, const char *name=0 );
00050 
00054     virtual ~KWindowInfo();
00055 
00059     bool autoDelete() const { return autoDel; }
00060 
00065     void setAutoDelete( bool enable ) { autoDel = enable; }
00066 
00071     static void showMessage( QWidget *window, const QString &text, int timeout = -1 );
00072 
00077     static void showMessage( QWidget *window, const QString &text,
00078                  const QPixmap &pix, int timeout = -1 );
00079 
00080 public slots:
00084     void message( const QString &text );
00085 
00089     void message( const QString &text, const QPixmap &pix );
00090 
00094     void message( const QString &text, int timeout );
00095 
00103     void message( const QString &text, const QPixmap &pix, int timeout );
00104 
00108     void permanent( const QString &text );
00109 
00113     void permanent( const QString &text, const QPixmap &pix );
00114 
00115 protected:
00119     virtual void display( const QString &text, const QPixmap &pix );
00120 
00121 protected slots:
00125     virtual void save();
00126 
00131     virtual void restore();
00132 
00133 private:
00134     QWidget *win;
00135     QPixmap oldIcon;
00136     QPixmap oldMiniIcon;
00137     QString oldText;
00138     bool autoDel;
00139 
00140     /* @internal */
00141     class Private *d;
00142 };
00143 
00144 #endif // KWINDOWINFO_H
00145 
KDE Home | KDE Accessibility Home | Description of Access Keys