summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/keyboard.h
authorhash <hash>2002-08-19 07:21:51 (UTC)
committer hash <hash>2002-08-19 07:21:51 (UTC)
commit9cc94030d7f6a04b79da8db83e6c609c1580a3d3 (patch) (unidiff)
treeb7c0fbc543d633ec9bd0f9d2ef762ebb92b2da55 /inputmethods/multikey/keyboard.h
parent64a00421be85d223072e087d4d3c9ecdad464095 (diff)
downloadopie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.zip
opie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.tar.gz
opie-9cc94030d7f6a04b79da8db83e6c609c1580a3d3.tar.bz2
parses dir and also lets you add/remove maps located in other places
Diffstat (limited to 'inputmethods/multikey/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h
index 805f0ed..8c4e666 100644
--- a/inputmethods/multikey/keyboard.h
+++ b/inputmethods/multikey/keyboard.h
@@ -24,97 +24,97 @@
24#include "configdlg.h" 24#include "configdlg.h"
25 25
26class QTimer; 26class QTimer;
27 27
28class KeyboardConfig : public DictFilterConfig 28class KeyboardConfig : public DictFilterConfig
29{ 29{
30public: 30public:
31 KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; } 31 KeyboardConfig(PickboardPicks* p) : DictFilterConfig(p), backspaces(0) { nrows = 1; }
32 virtual void generateText(const QString &s); 32 virtual void generateText(const QString &s);
33 void decBackspaces() { if (backspaces) backspaces--; } 33 void decBackspaces() { if (backspaces) backspaces--; }
34 void incBackspaces() { backspaces++; } 34 void incBackspaces() { backspaces++; }
35 void resetBackspaces() { backspaces = 0; } 35 void resetBackspaces() { backspaces = 0; }
36private: 36private:
37 int backspaces; 37 int backspaces;
38}; 38};
39 39
40 40
41class KeyboardPicks : public PickboardPicks 41class KeyboardPicks : public PickboardPicks
42{ 42{
43 Q_OBJECT 43 Q_OBJECT
44public: 44public:
45 KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) 45 KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0)
46 : PickboardPicks(parent, name, f) { } 46 : PickboardPicks(parent, name, f) { }
47 void initialise(); 47 void initialise();
48 virtual QSize sizeHint() const; 48 virtual QSize sizeHint() const;
49 KeyboardConfig *dc; 49 KeyboardConfig *dc;
50}; 50};
51 51
52 52
53class Keys { 53class Keys {
54public: 54public:
55 55
56 Keys(); 56 Keys();
57 Keys(const char * filename); 57 Keys(const char * filename);
58 ~Keys(); 58 ~Keys();
59 ushort uni(const int row, const int col); 59 ushort uni(const int row, const int col);
60 int qcode(const int row, const int col); 60 int qcode(const int row, const int col);
61 int width(const int row, const int col); 61 int width(const int row, const int col);
62 bool pressed(const int row, const int col); 62 bool pressed(const int row, const int col);
63 bool *pressedPtr(const int row, const int col); 63 bool *pressedPtr(const int row, const int col);
64 ushort shift(const ushort); 64 ushort shift(const ushort);
65 QPixmap *pix(const int row, const int col); 65 QPixmap *pix(const int row, const int col);
66 int numKeys(const int row); 66 int numKeys(const int row);
67 void setKeysFromFile(const char *filename); 67 void setKeysFromFile(const char *filename);
68 void setKey(const int row, const int qcode, const ushort unicode, 68 void setKey(const int row, const int qcode, const ushort unicode,
69 const int width, QPixmap *pix); 69 const int width, QPixmap *pix);
70 void setPressed(const int row, const int col, const bool pressed); 70 void setPressed(const int row, const int col, const bool pressed);
71 QString lang; 71 QString lang;
72 QString title; 72 QString label;
73 73
74private: 74private:
75 75
76 typedef struct Key { 76 typedef struct Key {
77 int qcode; // are qt key codes just unicode values? 77 int qcode; // are qt key codes just unicode values?
78 ushort unicode; 78 ushort unicode;
79 int width; // not pixels but relative key width. normal key is 2 79 int width; // not pixels but relative key width. normal key is 2
80 80
81 // only needed for keys like ctrl that can have multiple keys pressed at once 81 // only needed for keys like ctrl that can have multiple keys pressed at once
82 bool *pressed; 82 bool *pressed;
83 QPixmap *pix; 83 QPixmap *pix;
84 }; 84 };
85 85
86 QList<Key> keys[6]; 86 QList<Key> keys[6];
87 QMap<ushort,ushort> shiftMap; 87 QMap<ushort,ushort> shiftMap;
88 88
89}; 89};
90 90
91class Keyboard : public QFrame 91class Keyboard : public QFrame
92{ 92{
93 Q_OBJECT 93 Q_OBJECT
94public: 94public:
95 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); 95 Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 );
96 ~Keyboard(); 96 ~Keyboard();
97 97
98 void resetState(); 98 void resetState();
99 99
100 void mousePressEvent(QMouseEvent*); 100 void mousePressEvent(QMouseEvent*);
101 void mouseReleaseEvent(QMouseEvent*); 101 void mouseReleaseEvent(QMouseEvent*);
102 void resizeEvent(QResizeEvent*); 102 void resizeEvent(QResizeEvent*);
103 void paintEvent(QPaintEvent* e); 103 void paintEvent(QPaintEvent* e);
104 //void timerEvent(QTimerEvent* e); 104 //void timerEvent(QTimerEvent* e);
105 void drawKeyboard( QPainter &p, int row = -1, int col = -1); 105 void drawKeyboard( QPainter &p, int row = -1, int col = -1);
106 106
107 QSize sizeHint() const; 107 QSize sizeHint() const;
108 108
109signals: 109signals:
110 void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); 110 void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool );
111 111
112private slots: 112private slots:
113 void repeat(); 113 void repeat();
114 void togglePickboard(bool on_off); 114 void togglePickboard(bool on_off);
115 void setMapToDefault(); 115 void setMapToDefault();
116 void setMapToFile(QString map); 116 void setMapToFile(QString map);
117 117
118private: 118private:
119 int getKey( int &w, int j = -1 ); 119 int getKey( int &w, int j = -1 );
120 void clearHighlight(); 120 void clearHighlight();