Diffstat (limited to 'inputmethods/multikey/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/multikey/keyboard.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 8ca50ea..400edc0 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h @@ -10,96 +10,97 @@ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qframe.h> #include <qmap.h> #include "../pickboard/pickboardcfg.h" #include "../pickboard/pickboardpicks.h" #include "configdlg.h" class QTimer; class KeyboardConfig : public DictFilterConfig { public: KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } virtual void generateText(const QString &s); void decBackspaces() { if (backspaces) backspaces--; } void incBackspaces() { backspaces++; } void resetBackspaces() { backspaces = 0; } private: int backspaces; }; class KeyboardPicks : public PickboardPicks { Q_OBJECT public: KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) : PickboardPicks(parent, name, f) { } void initialise(); virtual QSize sizeHint() const; KeyboardConfig *dc; }; class Keys { public: Keys(); Keys(const char * filename); + ~Keys(); ushort uni(const int row, const int col); int qcode(const int row, const int col); int width(const int row, const int col); bool pressed(const int row, const int col); bool *pressedPtr(const int row, const int col); ushort shift(const ushort); QPixmap *pix(const int row, const int col); int numKeys(const int row); void setKeysFromFile(const char *filename); void setKey(const int row, const int qcode, const ushort unicode, const int width, QPixmap *pix); void setPressed(const int row, const int col, const bool pressed); QString lang; QString title; private: typedef struct Key { int qcode; // are qt key codes just unicode values? ushort unicode; int width; // not pixels but relative key width. normal key is 2 // only needed for keys like ctrl that can have multiple keys pressed at once bool *pressed; QPixmap *pix; }; QList<Key> keys[6]; QMap<ushort,ushort> shiftMap; }; class Keyboard : public QFrame { Q_OBJECT public: Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~Keyboard(); void resetState(); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void resizeEvent(QResizeEvent*); void paintEvent(QPaintEvent* e); //void timerEvent(QTimerEvent* e); void drawKeyboard( QPainter &p, int row = -1, int col = -1); |