4 * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 2001 Bernardo Innocenti <bernie@codewiz.org>
6 * This file is part of DevLib - See README.devlib for information.
11 * \author Bernardo Innocenti <bernie@develer.com>
13 * \brief QT-based widget for leyboard emulation (interface)
16 #if !defined(EMULKBD_H)
19 #if defined (_MSC_VER) && (_MSC_VER > 1000)
21 #endif // _MSC_VER > 1000
26 #include <QtGui/QFrame>
33 class EmulKbd : public QFrame
45 EmulKbd(QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0);
49 void addKey(const char *label, int keycode, int row, int col, int matrix_row = -1, int matrix_col = -1);
55 void setKey(int row, int col, bool on);
57 // Base class overrides
59 virtual QSizePolicy sizePolicy() const;
60 virtual void resizeEvent(QResizeEvent *e);
61 virtual bool event(QEvent *e);
68 // Private helper class for EmulKbd
69 // NOTE: with protected inheritance, dynamic_cast<> does not work (gcc 2.96)
71 #include <qpushbutton.h>
73 #include <QtGui/qpushbutton.h>
75 class EmulKey : public QPushButton
86 EmulKey(EmulKbd *parent, const char *label, int keycode, int _row, int _col);
89 // superclass overrides
90 void setDown(bool enable);
93 void keyPressed(void);
94 void keyReleased(void);
101 #endif // !defined(EMULKBD_H)