summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/function_keyboard.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/function_keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/function_keyboard.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.h b/noncore/apps/opie-console/function_keyboard.h
index 05b991d..496d932 100644
--- a/noncore/apps/opie-console/function_keyboard.h
+++ b/noncore/apps/opie-console/function_keyboard.h
@@ -2,6 +2,7 @@
2#define OPIE_FUNCTION_KEYBOARD_H 2#define OPIE_FUNCTION_KEYBOARD_H
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qpeapplication.h>
5#include <qframe.h> 6#include <qframe.h>
6#include <qpainter.h> 7#include <qpainter.h>
7#include <qvbox.h> 8#include <qvbox.h>
@@ -12,21 +13,22 @@
12#include "profiledialogwidget.h" 13#include "profiledialogwidget.h"
13 14
14 15
15class FKey { 16struct FKey {
16
17public:
18 17
19 FKey(): qcode(0), unicode(0) {}; 18 FKey(): qcode(0), unicode(0) {};
20 FKey(const QString &l, ushort q, ushort u): label(l), qcode(q), unicode(u) {}; 19 FKey(const QString &l, const QString &f, ushort q, ushort u):
20 label(l), pixFile(f), qcode(q), unicode(u) {
21
22 if (!f.isEmpty()) {
21 23
22 QString getL() { return label; } 24 pix = new QPixmap (QPEApplication::qpeDir() + "pics/console/keys/" + f);
23 ushort getQ() { return qcode; }
24 ushort getU() { return unicode; }
25 25
26 26 }
27private: 27 };
28 28
29 QString label; 29 QString label;
30 QPixmap *pix;
31 QString pixFile;
30 ushort qcode; 32 ushort qcode;
31 ushort unicode; 33 ushort unicode;
32}; 34};
@@ -38,11 +40,15 @@ public:
38 FunctionKeyboard(QWidget *parent = 0); 40 FunctionKeyboard(QWidget *parent = 0);
39 ~FunctionKeyboard(); 41 ~FunctionKeyboard();
40 42
43 friend class FunctionKeyboardConfig;
44
41 void changeRows(int); 45 void changeRows(int);
42 void changeCols(int); 46 void changeCols(int);
43 47
48 //Key getKey(int, int);
49
44 void paintEvent(QPaintEvent *); 50 void paintEvent(QPaintEvent *);
45 void paintKey(int, int); 51 void paintKey(uint, uint);
46 void mousePressEvent(QMouseEvent*); 52 void mousePressEvent(QMouseEvent*);
47 void mouseReleaseEvent(QMouseEvent*); 53 void mouseReleaseEvent(QMouseEvent*);
48 void resizeEvent(QResizeEvent*); 54 void resizeEvent(QResizeEvent*);
@@ -50,7 +56,7 @@ public:
50 56
51signals: 57signals:
52 58
53 void keyPressed(ushort, ushort, bool, bool, bool, ushort, ushort); 59 void keyPressed(FKey, ushort, ushort, bool);
54 60
55private: 61private:
56 62
@@ -87,16 +93,19 @@ public:
87 93
88private slots: 94private slots:
89 95
90 void slotKeyPressed(ushort, ushort, bool, bool, bool, ushort, ushort); 96 void slotKeyPressed(FKey, ushort, ushort, bool);
91 void slotChangeRows(int); 97 void slotChangeRows(int);
92 void slotChangeCols(int); 98 void slotChangeCols(int);
93 void slotChangeIcon(int); 99 void slotChangeIcon(int);
100 void slotChangeLabelText(const QString &);
94 101
95private: 102private:
96 103
104 ushort selectedRow, selectedCol;
105
97 FunctionKeyboard *kb; 106 FunctionKeyboard *kb;
98 QSpinBox *m_rowBox, *m_colBox; 107 QSpinBox *m_rowBox, *m_colBox;
99 QComboBox *m_labels; 108 QComboBox *m_labels, *m_qvalues;
100 109
101}; 110};
102 111