summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/keyboard.h
Unidiff
Diffstat (limited to 'inputmethods/multikey/keyboard.h') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h
index b524195..e61b76c 100644
--- a/inputmethods/multikey/keyboard.h
+++ b/inputmethods/multikey/keyboard.h
@@ -1,47 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qframe.h> 20#include <qframe.h>
21#include <qmap.h> 21#include <qmap.h>
22#include "../pickboard/pickboardcfg.h" 22#include "../pickboard/pickboardcfg.h"
23#include "../pickboard/pickboardpicks.h" 23#include "../pickboard/pickboardpicks.h"
24#include "configdlg.h"
24 25
25class QTimer; 26class QTimer;
26 27
27class KeyboardConfig : public DictFilterConfig 28class KeyboardConfig : public DictFilterConfig
28{ 29{
29public: 30public:
30 KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } 31 KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; }
31 virtual void generateText(const QString &s); 32 virtual void generateText(const QString &s);
32 void decBackspaces() { if (backspaces) backspaces--; } 33 void decBackspaces() { if (backspaces) backspaces--; }
33 void incBackspaces() { backspaces++; } 34 void incBackspaces() { backspaces++; }
34 void resetBackspaces() { backspaces = 0; } 35 void resetBackspaces() { backspaces = 0; }
35private: 36private:
36 int backspaces; 37 int backspaces;
37}; 38};
38 39
39 40
40class KeyboardPicks : public PickboardPicks 41class KeyboardPicks : public PickboardPicks
41{ 42{
42 Q_OBJECT 43 Q_OBJECT
43public: 44public:
44 KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) 45 KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0)
45 : PickboardPicks(parent, name, f) { } 46 : PickboardPicks(parent, name, f) { }
46 void initialise(); 47 void initialise();
47 virtual QSize sizeHint() const; 48 virtual QSize sizeHint() const;
@@ -85,64 +86,67 @@ private:
85}; 86};
86 87
87class Keyboard : public QFrame 88class Keyboard : public QFrame
88{ 89{
89 Q_OBJECT 90 Q_OBJECT
90public: 91public:
91 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); 92 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 );
92 93
93 void resetState(); 94 void resetState();
94 95
95 void mousePressEvent(QMouseEvent*); 96 void mousePressEvent(QMouseEvent*);
96 void mouseReleaseEvent(QMouseEvent*); 97 void mouseReleaseEvent(QMouseEvent*);
97 void resizeEvent(QResizeEvent*); 98 void resizeEvent(QResizeEvent*);
98 void paintEvent(QPaintEvent* e); 99 void paintEvent(QPaintEvent* e);
99 //void timerEvent(QTimerEvent* e); 100 //void timerEvent(QTimerEvent* e);
100 void drawKeyboard( QPainter &p, int row = -1, int col = -1); 101 void drawKeyboard( QPainter &p, int row = -1, int col = -1);
101 102
102 QSize sizeHint() const; 103 QSize sizeHint() const;
103 104
104signals: 105signals:
105 void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); 106 void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool );
106 107
107private slots: 108private slots:
108 void repeat(); 109 void repeat();
110 void togglePickboard(bool on_off);
109 111
110private: 112private:
111 int getKey( int &w, int j = -1 ); 113 int getKey( int &w, int j = -1 );
112 void clearHighlight(); 114 void clearHighlight();
113 115
114 bool *shift; 116 bool *shift;
115 bool *lock; 117 bool *lock;
116 bool *ctrl; 118 bool *ctrl;
117 bool *alt; 119 bool *alt;
118 uint useLargeKeys:1; 120 uint useLargeKeys:1;
119 uint usePicks:1; 121 uint usePicks:1;
120 122
121 int pressedKeyRow; 123 int pressedKeyRow;
122 int pressedKeyCol; 124 int pressedKeyCol;
123 125
124 KeyboardPicks *picks; 126 KeyboardPicks *picks;
125 127
126 int keyHeight; 128 int keyHeight;
127 int defaultKeyWidth; 129 int defaultKeyWidth;
128 int xoffs; 130 int xoffs;
129 131
130 int unicode; 132 int unicode;
131 int qkeycode; 133 int qkeycode;
132 int modifiers; 134 int modifiers;
133 135
134 int pressTid; 136 int pressTid;
135 bool pressed; 137 bool pressed;
136 138
137 Keys keys; 139 Keys keys;
138 QString LANG; 140 QString LANG;
139 /* for korean input */ 141 /* for korean input */
140 ushort schar, mchar, echar; 142 ushort schar, mchar, echar;
141 ushort parseKoreanInput(ushort c); 143 ushort parseKoreanInput(ushort c);
142 ushort combineKoreanChars(const ushort s, const ushort m, const ushort e); 144 ushort combineKoreanChars(const ushort s, const ushort m, const ushort e);
143 ushort constoe(const ushort c); 145 ushort constoe(const ushort c);
144 146
145 QTimer *repeatTimer; 147 QTimer *repeatTimer;
148
149 ConfigDlg *configdlg;
146}; 150};
147 151
148 152