|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbPlugins module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 #include "hardwareinputplugin.h" |
|
26 //Required Qt Headers |
|
27 #include <QStringList> |
|
28 #include <QInputContextPlugin> |
|
29 |
|
30 //User Includes |
|
31 #include "hbhardware12key.h" |
|
32 #include "hbhardwareqwerty.h" |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // HbHardwareInputPlugin::HbHardwareInputPlugin |
|
36 // |
|
37 // Constructs HbHardwareInputPlugin |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 HbHardwareInputPlugin::HbHardwareInputPlugin(QObject *parent) |
|
41 : QInputContextPlugin(parent) |
|
42 { |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // HbHardwareInputPlugin::~HbHardwareInputPlugin |
|
47 // |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 HbHardwareInputPlugin::~HbHardwareInputPlugin() |
|
51 { |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // HW12KeyImpl::create |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 QInputContext* HbHardwareInputPlugin::create(const QString& key) |
|
60 { |
|
61 if (key == QString("HbHardware12key")) { |
|
62 return new HbHardware12key(); |
|
63 } else if (key == QString("HbHardwareQwerty")) { |
|
64 return new HbHardwareQwerty(); |
|
65 } else { |
|
66 return 0; |
|
67 } |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // HbHardwareInputPlugin::description |
|
72 // |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 QString HbHardwareInputPlugin::description(const QString& key) |
|
76 { |
|
77 if (key == QString("HbHardware12key")) { |
|
78 return QString("HW phone keypad input"); |
|
79 } else if (key == QString("HbHardwareQwerty")) { |
|
80 return QString("HW phone Qwerty keypad input"); |
|
81 } else { |
|
82 return QString(""); |
|
83 } |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // HbHardwareInputPlugin::displayName |
|
88 // |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 QString HbHardwareInputPlugin::displayName(const QString& key) |
|
92 { |
|
93 if (key == QString("HbHardware12key")) { |
|
94 return QString("HW 12-key"); |
|
95 } else if (key == QString("HbHardwareQwerty")) { |
|
96 return QString("HW phone Qwerty keypad input"); |
|
97 } else { |
|
98 return QString(""); |
|
99 } |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // HbHardwareInputPlugin::keys |
|
104 // |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 QStringList HbHardwareInputPlugin::keys() const |
|
108 { |
|
109 QStringList keys; |
|
110 keys.append(QString("HbHardware12key")); |
|
111 keys.append(QString("HbHardwareQwerty")); |
|
112 return keys; |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // HbHardwareInputPlugin::languages |
|
117 // |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 QStringList HbHardwareInputPlugin::languages(const QString& /*key*/) |
|
121 { |
|
122 return QStringList(); |
|
123 } |
|
124 |
|
125 // |
|
126 // Make plugin loadable. |
|
127 // |
|
128 Q_EXPORT_PLUGIN2(HardwareInput, HbHardwareInputPlugin) |
|
129 |
|
130 // End of file |