kdeui
krootpixmap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __KRootPixmap_h_Included__
00012 #define __KRootPixmap_h_Included__
00013
00014 #include <qobject.h>
00015 #include <qcolor.h>
00016 #include <kdelibs_export.h>
00017
00018 #ifndef Q_WS_QWS //FIXME
00019
00020 class QRect;
00021 class QWidget;
00022 class QTimer;
00023 class KSharedPixmap;
00024 class KRootPixmapData;
00025
00046 class KDEUI_EXPORT KRootPixmap: public QObject
00047 {
00048 Q_OBJECT
00049
00050 public:
00060 KRootPixmap( QWidget *target, const char *name=0 );
00061
00066 KRootPixmap( QWidget *target, QObject *parent, const char *name=0 );
00067
00071 virtual ~KRootPixmap();
00072
00077 bool isAvailable() const;
00078
00082 bool isActive() const { return m_bActive; }
00083
00087 int currentDesktop() const;
00088
00093 bool customPainting() const { return m_bCustomPaint; }
00094
00095 #ifndef KDE_NO_COMPAT
00096
00100 KDE_DEPRECATED bool checkAvailable(bool) { return isAvailable(); }
00101 #endif
00102
00106 const QColor &color() const { return m_FadeColor; }
00107
00111 double opacity() const { return m_Fade; }
00112
00113 public slots:
00117 virtual void start();
00118
00122 virtual void stop();
00123
00134 void setFadeEffect(double opacity, const QColor &color);
00135
00142 void repaint( bool force );
00143
00149 void repaint();
00150
00157 void setCustomPainting( bool enable ) { m_bCustomPaint = enable; }
00158
00163 void enableExports();
00164
00168 static QString pixmapName(int desk);
00169 signals:
00176 void backgroundUpdated( const QPixmap &pm );
00177
00178 protected:
00183 virtual bool eventFilter(QObject *, QEvent *);
00184
00190 virtual void updateBackground( KSharedPixmap * );
00191
00192 private slots:
00193 void slotBackgroundChanged(int);
00194 void slotDone(bool);
00195 void desktopChanged(int desktop);
00196 void desktopChanged( WId window, unsigned int properties );
00197
00198 private:
00199 bool m_bActive, m_bInit, m_bCustomPaint;
00200 int m_Desk;
00201
00202 double m_Fade;
00203 QColor m_FadeColor;
00204
00205 QRect m_Rect;
00206 QWidget *m_pWidget;
00207 QTimer *m_pTimer;
00208 KSharedPixmap *m_pPixmap;
00209 KRootPixmapData *d;
00210
00211 void init();
00212 };
00213
00214 #endif // ! Q_WS_QWS
00215 #endif // __KRootPixmap_h_Included__
00216