Diffstat (limited to 'inputmethods/keyboard/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/keyboard/keyboard.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inputmethods/keyboard/keyboard.h b/inputmethods/keyboard/keyboard.h index 38ae338..cc7f3f5 100644 --- a/inputmethods/keyboard/keyboard.h +++ b/inputmethods/keyboard/keyboard.h | |||
@@ -1,103 +1,108 @@ | |||
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 "../pickboard/pickboardcfg.h" | 21 | #include "../pickboard/pickboardcfg.h" |
22 | #include "../pickboard/pickboardpicks.h" | 22 | #include "../pickboard/pickboardpicks.h" |
23 | 23 | ||
24 | class QTimer; | 24 | class QTimer; |
25 | 25 | ||
26 | namespace KeyboardInput | ||
27 | { | ||
28 | |||
26 | class KeyboardConfig : public DictFilterConfig | 29 | class KeyboardConfig : public DictFilterConfig |
27 | { | 30 | { |
28 | public: | 31 | public: |
29 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } | 32 | KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } |
30 | virtual void generateText(const QString &s); | 33 | virtual void generateText(const QString &s); |
31 | void decBackspaces() { if (backspaces) backspaces--; } | 34 | void decBackspaces() { if (backspaces) backspaces--; } |
32 | void incBackspaces() { backspaces++; } | 35 | void incBackspaces() { backspaces++; } |
33 | void resetBackspaces() { backspaces = 0; } | 36 | void resetBackspaces() { backspaces = 0; } |
34 | private: | 37 | private: |
35 | int backspaces; | 38 | int backspaces; |
36 | }; | 39 | }; |
37 | 40 | ||
38 | 41 | ||
39 | class KeyboardPicks : public PickboardPicks | 42 | class KeyboardPicks : public PickboardPicks |
40 | { | 43 | { |
41 | Q_OBJECT | 44 | Q_OBJECT |
42 | public: | 45 | public: |
43 | KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) | 46 | KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) |
44 | : PickboardPicks(parent, name, f) { } | 47 | : PickboardPicks(parent, name, f) { } |
45 | void initialise(); | 48 | void initialise(); |
46 | virtual QSize sizeHint() const; | 49 | virtual QSize sizeHint() const; |
47 | KeyboardConfig *dc; | 50 | KeyboardConfig *dc; |
48 | }; | 51 | }; |
49 | 52 | ||
50 | class Keyboard : public QFrame | 53 | class Keyboard : public QFrame |
51 | { | 54 | { |
52 | Q_OBJECT | 55 | Q_OBJECT |
53 | public: | 56 | public: |
54 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 57 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
55 | 58 | ||
56 | void resetState(); | 59 | void resetState(); |
57 | 60 | ||
58 | void mousePressEvent(QMouseEvent*); | 61 | void mousePressEvent(QMouseEvent*); |
59 | void mouseReleaseEvent(QMouseEvent*); | 62 | void mouseReleaseEvent(QMouseEvent*); |
60 | void resizeEvent(QResizeEvent*); | 63 | void resizeEvent(QResizeEvent*); |
61 | void paintEvent(QPaintEvent* e); | 64 | void paintEvent(QPaintEvent* e); |
62 | void timerEvent(QTimerEvent* e); | 65 | void timerEvent(QTimerEvent* e); |
63 | void drawKeyboard( QPainter &p, int key = -1 ); | 66 | void drawKeyboard( QPainter &p, int key = -1 ); |
64 | 67 | ||
65 | void setMode(int mode) { useOptiKeys = mode; } | 68 | void setMode(int mode) { useOptiKeys = mode; } |
66 | 69 | ||
67 | QSize sizeHint() const; | 70 | QSize sizeHint() const; |
68 | 71 | ||
69 | signals: | 72 | signals: |
70 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); | 73 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); |
71 | 74 | ||
72 | private slots: | 75 | private slots: |
73 | void repeat(); | 76 | void repeat(); |
74 | 77 | ||
75 | private: | 78 | private: |
76 | int getKey( int &w, int j = -1 ); | 79 | int getKey( int &w, int j = -1 ); |
77 | void clearHighlight(); | 80 | void clearHighlight(); |
78 | 81 | ||
79 | uint shift:1; | 82 | uint shift:1; |
80 | uint lock:1; | 83 | uint lock:1; |
81 | uint ctrl:1; | 84 | uint ctrl:1; |
82 | uint alt:1; | 85 | uint alt:1; |
83 | uint useLargeKeys:1; | 86 | uint useLargeKeys:1; |
84 | uint useOptiKeys:1; | 87 | uint useOptiKeys:1; |
85 | 88 | ||
86 | int pressedKey; | 89 | int pressedKey; |
87 | 90 | ||
88 | KeyboardPicks *picks; | 91 | KeyboardPicks *picks; |
89 | 92 | ||
90 | int keyHeight; | 93 | int keyHeight; |
91 | int defaultKeyWidth; | 94 | int defaultKeyWidth; |
92 | int xoffs; | 95 | int xoffs; |
93 | 96 | ||
94 | int unicode; | 97 | int unicode; |
95 | int qkeycode; | 98 | int qkeycode; |
96 | int modifiers; | 99 | int modifiers; |
97 | 100 | ||
98 | int pressTid; | 101 | int pressTid; |
99 | bool pressed; | 102 | bool pressed; |
100 | 103 | ||
101 | QTimer *repeatTimer; | 104 | QTimer *repeatTimer; |
102 | }; | 105 | }; |
103 | 106 | ||
107 | } // namespace KeyboardInput | ||
108 | |||