summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/keyboardimpl.cpp
authorhash <hash>2002-07-28 10:10:35 (UTC)
committer hash <hash>2002-07-28 10:10:35 (UTC)
commitb18897e49eb04eb5d847c8231dde7442eca19fb4 (patch) (unidiff)
tree05f1bebfe62c4fbc9c6ee84fae46d3d781027470 /inputmethods/multikey/keyboardimpl.cpp
parentdfa88fddb768b27d6a3c92c25b223b59c84af153 (diff)
downloadopie-b18897e49eb04eb5d847c8231dde7442eca19fb4.zip
opie-b18897e49eb04eb5d847c8231dde7442eca19fb4.tar.gz
opie-b18897e49eb04eb5d847c8231dde7442eca19fb4.tar.bz2
keyboard that changes according to current locale setting
Diffstat (limited to 'inputmethods/multikey/keyboardimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboardimpl.cpp108
1 files changed, 108 insertions, 0 deletions
diff --git a/inputmethods/multikey/keyboardimpl.cpp b/inputmethods/multikey/keyboardimpl.cpp
new file mode 100644
index 0000000..2bcb0fa
--- a/dev/null
+++ b/inputmethods/multikey/keyboardimpl.cpp
@@ -0,0 +1,108 @@
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 <qapplication.h>
21#include <qpixmap.h>
22#include "keyboard.h"
23#include "keyboardimpl.h"
24
25/* XPM */
26static const char * kb_xpm[] = {
27"28 13 4 1",
28" c None",
29". c #4C4C4C",
30"+ c #FFF7DD",
31"@ c #D6CFBA",
32" .......................... ",
33" .+++.+++.+++.+++.+++.++++. ",
34" .+@@.+@@.+@@.+@@.+@@.+@@@. ",
35" .......................... ",
36" .+++++.+++.+++.+++.++++++. ",
37" .+@@@@.+@@.+@@.+@@.+@@@@@. ",
38" .......................... ",
39" .++++++.+++.+++.+++.+++++. ",
40" .+@@@@@.+@@.+@@.+@@.+@@@@. ",
41" .......................... ",
42" .++++.++++++++++++++.++++. ",
43" .+@@@.+@@@@@@@@@@@@@.+@@@. ",
44" .......................... "};
45
46
47KeyboardImpl::KeyboardImpl()
48 : input(0), icn(0), ref(0)
49{
50}
51
52KeyboardImpl::~KeyboardImpl()
53{
54 delete input;
55 delete icn;
56}
57
58QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
59{
60 if ( !input )
61 input = new Keyboard( parent, "Keyboard", f );
62 return input;
63}
64
65void KeyboardImpl::resetState()
66{
67 if ( input )
68 input->resetState();
69}
70
71QPixmap *KeyboardImpl::icon()
72{
73 if ( !icn )
74 icn = new QPixmap( (const char **)kb_xpm );
75 return icn;
76}
77
78QString KeyboardImpl::name()
79{
80 return qApp->translate( "InputMethods", "Multikey" );
81// return qApp->translate( "InputMethods", "Opti" );
82}
83
84void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot )
85{
86 if ( input )
87 QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
88}
89
90#ifndef QT_NO_COMPONENT
91QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
92{
93 *iface = 0;
94 if ( uuid == IID_QUnknown )
95 *iface = this;
96 else if ( uuid == IID_InputMethod )
97 *iface = this;
98
99 if ( *iface )
100 (*iface)->addRef();
101 return QS_OK;
102}
103
104Q_EXPORT_INTERFACE()
105{
106 Q_CREATE_INSTANCE( KeyboardImpl )
107}
108#endif