23
23
#include <widget.h>
24
#include <plasma/widgets/pushbutton.h>
26
class PlasmaboardWidget;
28
class BoardKey : public Plasma::PushButton {
31
BoardKey(PlasmaboardWidget *parent);
34
unsigned int getKeycode();
37
Replaces text on the button. Warning! This does not trigger a repaint for performance reasons.
38
If you are updating an already painted button, call update() !
40
void setText(QString text);
28
BoardKey(QPoint relativePosition, QSize relativeSize, unsigned int keycode);
31
bool contains (const QPoint &point) const;
32
bool intersects (const QRectF &rect) const;
33
unsigned int getKeycode() const;
34
unsigned int getKeysymbol(int level) const;
35
virtual QString label() const;
36
virtual void paint(QPainter *painter);
37
QPoint position() const;
39
* called when button is pressed
41
virtual void pressed();
43
virtual void pressRepeated();
45
QSize relativeSize() const;
47
* called when button is pressed
49
virtual void released();
51
* Called to "unpress" the button
54
void setKeycode(unsigned int keycode);
55
virtual void setPixmap(QPixmap *pixmap);
57
virtual void unpressed();
58
void updateDimensions(double factor_x, double factor_y);
62
virtual void sendKeyPress();
63
virtual void sendKeyRelease();
64
void setUpPainter(QPainter *painter) const;
48
void sendKeycodePress();
49
void sendKeycodeRelease();
50
void sendKeycodeToggled();
55
* Called to "unpress" the button
59
* called when button is pressed
61
virtual void pressed();
63
* called when button is pressed
65
virtual void released();
68
void setUpPainter(QPainter *painter);
69
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
67
unsigned int m_keycode;
69
QPoint m_relativePosition;