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
23 #include <QtGui/QFrame>
29 class EmulKbd : public QFrame
41 EmulKbd(QWidget *parent = 0, Qt::WFlags f = 0);
45 void addKey(const char *label, int keycode, int row, int col, int matrix_row = -1, int matrix_col = -1);
51 void setKey(int row, int col, bool on);
53 // Base class overrides
55 virtual QSizePolicy sizePolicy() const;
56 virtual void resizeEvent(QResizeEvent *e);
57 virtual bool event(QEvent *e);
64 // Private helper class for EmulKbd
65 // NOTE: with protected inheritance, dynamic_cast<> does not work (gcc 2.96)
66 #include <QtGui/qpushbutton.h>
67 class EmulKey : public QPushButton
78 EmulKey(EmulKbd *parent, const char *label, int keycode, int _row, int _col);
81 // superclass overrides
82 void setDown(bool enable);
85 void keyPressed(void);
86 void keyReleased(void);
93 #endif // !defined(EMULKBD_H)