Diffstat (limited to 'inputmethods/dvorak/dvorak.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dvorak/dvorak.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/inputmethods/dvorak/dvorak.h b/inputmethods/dvorak/dvorak.h new file mode 100644 index 0000000..38ae338 --- a/dev/null +++ b/inputmethods/dvorak/dvorak.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include <qframe.h> | ||
21 | #include "../pickboard/pickboardcfg.h" | ||
22 | #include "../pickboard/pickboardpicks.h" | ||
23 | |||
24 | class QTimer; | ||
25 | |||
26 | class KeyboardConfig : public DictFilterConfig | ||
27 | { | ||
28 | public: | ||
29 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } | ||
30 | virtual void generateText(const QString &s); | ||
31 | void decBackspaces() { if (backspaces) backspaces--; } | ||
32 | void incBackspaces() { backspaces++; } | ||
33 | void resetBackspaces() { backspaces = 0; } | ||
34 | private: | ||
35 | int backspaces; | ||
36 | }; | ||
37 | |||
38 | |||
39 | class KeyboardPicks : public PickboardPicks | ||
40 | { | ||
41 | Q_OBJECT | ||
42 | public: | ||
43 | KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) | ||
44 | : PickboardPicks(parent, name, f) { } | ||
45 | void initialise(); | ||
46 | virtual QSize sizeHint() const; | ||
47 | KeyboardConfig *dc; | ||
48 | }; | ||
49 | |||
50 | class Keyboard : public QFrame | ||
51 | { | ||
52 | Q_OBJECT | ||
53 | public: | ||
54 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); | ||
55 | |||
56 | void resetState(); | ||
57 | |||
58 | void mousePressEvent(QMouseEvent*); | ||
59 | void mouseReleaseEvent(QMouseEvent*); | ||
60 | void resizeEvent(QResizeEvent*); | ||
61 | void paintEvent(QPaintEvent* e); | ||
62 | void timerEvent(QTimerEvent* e); | ||
63 | void drawKeyboard( QPainter &p, int key = -1 ); | ||
64 | |||
65 | void setMode(int mode) { useOptiKeys = mode; } | ||
66 | |||
67 | QSize sizeHint() const; | ||
68 | |||
69 | signals: | ||
70 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); | ||
71 | |||
72 | private slots: | ||
73 | void repeat(); | ||
74 | |||
75 | private: | ||
76 | int getKey( int &w, int j = -1 ); | ||
77 | void clearHighlight(); | ||
78 | |||
79 | uint shift:1; | ||
80 | uint lock:1; | ||
81 | uint ctrl:1; | ||
82 | uint alt:1; | ||
83 | uint useLargeKeys:1; | ||
84 | uint useOptiKeys:1; | ||
85 | |||
86 | int pressedKey; | ||
87 | |||
88 | KeyboardPicks *picks; | ||
89 | |||
90 | int keyHeight; | ||
91 | int defaultKeyWidth; | ||
92 | int xoffs; | ||
93 | |||
94 | int unicode; | ||
95 | int qkeycode; | ||
96 | int modifiers; | ||
97 | |||
98 | int pressTid; | ||
99 | bool pressed; | ||
100 | |||
101 | QTimer *repeatTimer; | ||
102 | }; | ||
103 | |||