plastikbutton.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PLASTIKBUTTON_H
00024 #define PLASTIKBUTTON_H
00025
00026 #include <qbutton.h>
00027 #include <qimage.h>
00028 #include "plastik.h"
00029
00030 class QTimer;
00031
00032 namespace KWinPlastik {
00033
00034 class PlastikClient;
00035
00036 class PlastikButton : public QButton
00037 {
00038 Q_OBJECT
00039 public:
00040 PlastikButton(PlastikClient *parent, const char *name, const QString &tip, ButtonType type, int size, bool toggle = false, int btns = LeftButton);
00041 ~PlastikButton();
00042
00043 QSize sizeHint() const;
00044 ButtonState lastMousePress() const { return m_lastMouse; }
00045 void reset() { repaint(false); }
00046 PlastikClient * client() { return m_client; }
00047 virtual void setOn(bool on);
00048 void setDeco();
00049 void setTipText(const QString &tip);
00050 void setSize(const int s);
00051
00052 protected slots:
00053 void animate();
00054
00055 private:
00056 void enterEvent(QEvent *e);
00057 void leaveEvent(QEvent *e);
00058 void mousePressEvent(QMouseEvent *e);
00059 void mouseReleaseEvent(QMouseEvent *e);
00060 void drawButton(QPainter *painter);
00061
00062 private:
00063 PlastikClient *m_client;
00064 ButtonState m_lastMouse;
00065 int m_realizeButtons;
00066
00067 int m_size;
00068
00069 ButtonType m_type;
00070 QImage m_aDecoLight,m_iDecoLight,m_aDecoDark,m_iDecoDark;
00071 bool hover;
00072
00073 QTimer *animTmr;
00074 uint animProgress;
00075 };
00076
00077 }
00078
00079 #endif // PLASTIKBUTTON_H
This file is part of the documentation for kwin Library Version 3.4.2.