libplasma
flash.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PLASMA_FLASH_H_
00022 #define PLASMA_FLASH_H_
00023
00024 #include <QtGui/QGraphicsWidget>
00025 #include <QtGui/QTextOption>
00026
00027 #include <plasma/plasma_export.h>
00028
00029 namespace Plasma
00030 {
00031
00032 class FlashPrivate;
00033
00037 class PLASMA_EXPORT Flash : public QGraphicsWidget
00038 {
00039 Q_OBJECT
00040 public:
00041 explicit Flash(QGraphicsItem *parent = 0);
00042 virtual ~Flash();
00043
00044 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00045
00046 void setFont( const QFont & );
00047 void setColor( const QColor & );
00048 void setDuration( int duration );
00049
00050 void flash( const QString &text, int duration = 0, const QTextOption &option = QTextOption(Qt::AlignCenter) );
00051 void flash( const QPixmap &pixmap, int duration = 0, Qt::Alignment align = Qt::AlignCenter );
00052
00053 public Q_SLOTS:
00054 void kill();
00055
00056 protected Q_SLOTS:
00057 void fadeIn();
00058 void fadeOut();
00059
00060 protected:
00061 QPixmap renderPixmap();
00062
00063 private:
00064 FlashPrivate * const d;
00065 };
00066
00067 }
00068
00069 #endif