author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /inputmethods/pickboard/pickboardimpl.cpp | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'inputmethods/pickboard/pickboardimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | inputmethods/pickboard/pickboardimpl.cpp | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/inputmethods/pickboard/pickboardimpl.cpp b/inputmethods/pickboard/pickboardimpl.cpp new file mode 100644 index 0000000..a4e8f02 --- a/dev/null +++ b/inputmethods/pickboard/pickboardimpl.cpp | |||
@@ -0,0 +1,101 @@ | |||
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 <qobject.h> | ||
22 | #include <qpixmap.h> | ||
23 | #include "pickboard.h" | ||
24 | #include "pickboardimpl.h" | ||
25 | |||
26 | /* XPM */ | ||
27 | static const char * pb_xpm[]={ | ||
28 | "28 7 2 1", | ||
29 | "# c #303030", | ||
30 | " c None", | ||
31 | " ########################## ", | ||
32 | " # # # # # # # ", | ||
33 | " # # # # # # # ", | ||
34 | " ########################## ", | ||
35 | " # # # # # # ", | ||
36 | " # # # # # # ", | ||
37 | " ########################## "}; | ||
38 | |||
39 | |||
40 | PickboardImpl::PickboardImpl() | ||
41 | : pickboard(0), icn(0), ref(0) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | PickboardImpl::~PickboardImpl() | ||
46 | { | ||
47 | delete pickboard; | ||
48 | delete icn; | ||
49 | } | ||
50 | |||
51 | QWidget *PickboardImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | ||
52 | { | ||
53 | if ( !pickboard ) | ||
54 | pickboard = new Pickboard( parent, "pickboard", f ); | ||
55 | return pickboard; | ||
56 | } | ||
57 | |||
58 | void PickboardImpl::resetState() | ||
59 | { | ||
60 | if ( pickboard ) | ||
61 | pickboard->resetState(); | ||
62 | } | ||
63 | |||
64 | QPixmap *PickboardImpl::icon() | ||
65 | { | ||
66 | if ( !icn ) | ||
67 | icn = new QPixmap( (const char **)pb_xpm ); | ||
68 | return icn; | ||
69 | } | ||
70 | |||
71 | QString PickboardImpl::name() | ||
72 | { | ||
73 | return qApp->translate( "InputMethods", "Pickboard" ); | ||
74 | } | ||
75 | |||
76 | void PickboardImpl::onKeyPress( QObject *receiver, const char *slot ) | ||
77 | { | ||
78 | if ( pickboard ) | ||
79 | QObject::connect( pickboard, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); | ||
80 | } | ||
81 | |||
82 | #ifndef QT_NO_COMPONENT | ||
83 | QRESULT PickboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
84 | { | ||
85 | *iface = 0; | ||
86 | if ( uuid == IID_QUnknown ) | ||
87 | *iface = this; | ||
88 | else if ( uuid == IID_InputMethod ) | ||
89 | *iface = this; | ||
90 | |||
91 | if ( *iface ) | ||
92 | (*iface)->addRef(); | ||
93 | return QS_OK; | ||
94 | } | ||
95 | |||
96 | Q_EXPORT_INTERFACE() | ||
97 | { | ||
98 | Q_CREATE_INSTANCE( PickboardImpl ) | ||
99 | } | ||
100 | #endif | ||
101 | |||