summaryrefslogtreecommitdiff
path: root/inputmethods/jumpx/keyboardimpl.cpp
Unidiff
Diffstat (limited to 'inputmethods/jumpx/keyboardimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/jumpx/keyboardimpl.cpp97
1 files changed, 97 insertions, 0 deletions
diff --git a/inputmethods/jumpx/keyboardimpl.cpp b/inputmethods/jumpx/keyboardimpl.cpp
new file mode 100644
index 0000000..92abb09
--- a/dev/null
+++ b/inputmethods/jumpx/keyboardimpl.cpp
@@ -0,0 +1,97 @@
1/**************************************************************************************94x78**
2**
3** This file may be distributed and/or modified under the terms of the
4** GNU General Public License version 2 as published by the Free Software
5** Foundation and appearing in the file LICENSE.GPL included in the
6** packaging of this file.
7**
8** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10**
11*********************************************************************************************/
12#include <qapplication.h>
13#include <qpixmap.h>
14#include "keyboard.h"
15#include "keyboardimpl.h"
16
17/* XPM */
18static const char * icon_xpm[] = {
19"26 13 2 1",
20 " c None",
21 ".c #000000",
22" ... ... ... ... ... ... ",
23". . . . . . . ",
24". . . . . . . ",
25". . . . . . . ",
26" ....... ... ... ....... ",
27". . . . . ",
28". . . . . ",
29". . . . . ",
30" ....... ... ... ....... ",
31". . . . . . . ",
32". . . . . . . ",
33". . . . . . . ",
34" ... ... ... ... ... ... "};
35
36
37KeyboardImpl::KeyboardImpl()
38 : input(0), icn(0), ref(0)
39{
40}
41
42KeyboardImpl::~KeyboardImpl()
43{
44 delete input;
45 delete icn;
46}
47
48QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
49{
50 if ( !input )
51 input = new Keyboard( parent, "Keyboard", f );
52 return input;
53}
54
55void KeyboardImpl::resetState()
56{
57 if ( input )
58 input->resetState();
59}
60
61QPixmap *KeyboardImpl::icon()
62{
63 if ( !icn )
64 icn = new QPixmap( (const char **)icon_xpm );
65 return icn;
66}
67
68QString KeyboardImpl::name()
69{
70 return qApp->translate( "InputMethods", "JumpX" );
71}
72
73void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot )
74{
75 if ( input )
76 QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
77}
78
79#ifndef QT_NO_COMPONENT
80QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
81{
82 *iface = 0;
83 if ( uuid == IID_QUnknown )
84 *iface = this;
85 else if ( uuid == IID_InputMethod )
86 *iface = this;
87
88 if ( *iface )
89 (*iface)->addRef();
90 return QS_OK;
91}
92
93Q_EXPORT_INTERFACE()
94{
95 Q_CREATE_INSTANCE( KeyboardImpl )
96}
97#endif