00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef KICKER_TIP_H
00027 #define KICKER_TIP_H
00028
00029 #include <tqbitmap.h>
00030 #include <tqpixmap.h>
00031 #include <tqtimer.h>
00032 #include <tqwidget.h>
00033
00034 #include <kpanelapplet.h>
00035
00036 class TQMimeSourceFactory;
00037 class TQPaintEvent;
00038 class TQSimpleRichText;
00039 class TQTimer;
00040
00041 class KDE_EXPORT KickerTip : public QWidget
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 enum MaskEffect { Plain, Dissolve };
00047
00048 struct Data
00049 {
00050 TQString message;
00051 TQString subtext;
00052 TQPixmap icon;
00053 KickerTip::MaskEffect maskEffect;
00054 int duration;
00055 KPanelApplet::Direction direction;
00056
00057
00058 TQMimeSourceFactory* mimeFactory;
00059 };
00060
00061 class KDE_EXPORT Client
00062 {
00063 public:
00064 virtual void updateKickerTip(KickerTip::Data&) = 0;
00065 void updateKickerTip() const;
00066 };
00067
00068 static KickerTip* the();
00069 static void enableTipping(bool tip);
00070 static bool tippingEnabled();
00071
00072 void untipFor(const TQWidget* w);
00073 bool eventFilter(TQObject *o, TQEvent *e);
00074
00075 protected:
00076 KickerTip(TQWidget * parent);
00077 ~KickerTip();
00078
00079 void paintEvent(TQPaintEvent * e);
00080 void mousePressEvent(TQMouseEvent * e);
00081
00082 void plainMask();
00083 void dissolveMask();
00084
00085 void displayInternal();
00086 void hide();
00087
00088 void tipFor(const TQWidget* w);
00089 bool isTippingFor(const TQWidget* w) const;
00090
00091 protected slots:
00092 void tipperDestroyed(TQObject* o);
00093 void internalUpdate();
00094 void display();
00095 void slotSettingsChanged();
00096
00097 private:
00098 TQBitmap m_mask;
00099 TQPixmap m_pixmap;
00100 TQPixmap m_icon;
00101 MaskEffect m_maskEffect;
00102 TQSimpleRichText* m_richText;
00103 TQMimeSourceFactory* m_mimeFactory;
00104
00105 int m_dissolveSize;
00106 int m_dissolveDelta;
00107 KPanelApplet::Direction m_direction;
00108
00109 TQTimer m_timer;
00110 TQTimer m_frameTimer;
00111 bool m_dirty;
00112
00113 const TQWidget* m_tippingFor;
00114
00115 static KickerTip* m_self;
00116 static int m_tippingEnabled;
00117
00118 friend class KickerTip::Client;
00119 };
00120
00121 #endif