|
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 HbCore 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 |
|
26 #ifndef HB_INPUT_UTILS_H |
|
27 #define HB_INPUT_UTILS_H |
|
28 |
|
29 #include <QStringList> |
|
30 |
|
31 #include <hbinputdef.h> |
|
32 #include <hbinputlanguage.h> |
|
33 |
|
34 class HbMappedKey; |
|
35 class HbLanguageDatabaseInterface; |
|
36 class QInputContextPlugin; |
|
37 class QWidget; |
|
38 class QGraphicsWidget; |
|
39 |
|
40 struct HbInputMethodList |
|
41 { |
|
42 QStringList dllName; |
|
43 QStringList key; |
|
44 }; |
|
45 |
|
46 class HB_CORE_EXPORT HbInputUtils |
|
47 { |
|
48 public: |
|
49 static inline bool isChineseInputMode(HbInputModeType inputMode); |
|
50 static inline bool isQwertyKeyboard(HbKeyboardType keyboardType); |
|
51 static inline bool isTouchKeyboard(HbKeyboardType keyboardType); |
|
52 static bool isCaseSensitiveMode(HbInputModeType inputMode); |
|
53 static QChar findFirstNumberCharacterBoundToKey(const HbMappedKey* key, |
|
54 const HbInputLanguage language, |
|
55 const HbInputDigitType digitType = HbDigitTypeLatin); |
|
56 |
|
57 static void listAvailableLanguageDatabasePlugins(QStringList& result, const QString& subfolder); |
|
58 static HbLanguageDatabaseInterface* languageDatabasePluginInstance(const QString& pluginFileName, const QString& subfolder); |
|
59 |
|
60 static bool isInputPluginInPermanentMemory(const QString& pluginFileName); |
|
61 static void listSupportedInputLanguages(QList<HbInputLanguage>& results); |
|
62 |
|
63 static QWidget* createWrapperWidget(QGraphicsWidget* graphicsWidget); |
|
64 static QGraphicsWidget* createGraphicsProxyWidget(QWidget* widget); |
|
65 }; |
|
66 |
|
67 /*! |
|
68 Returns true if given input mode is Chinese input mode. |
|
69 */ |
|
70 inline bool HbInputUtils::isChineseInputMode(HbInputModeType inputMode) |
|
71 { |
|
72 return (inputMode & HbChineseModeMask) != 0; |
|
73 } |
|
74 |
|
75 /*! |
|
76 Returns true if given keyboard type is qwerty keyboard. |
|
77 */ |
|
78 inline bool HbInputUtils::isQwertyKeyboard(HbKeyboardType keyboardType) |
|
79 { |
|
80 return (keyboardType & HbQwertyKeyboardMask) != 0; |
|
81 } |
|
82 |
|
83 /*! |
|
84 Returns true if given keyboard type is virtual keyboard. |
|
85 */ |
|
86 inline bool HbInputUtils::isTouchKeyboard(HbKeyboardType keyboardType) |
|
87 { |
|
88 return (keyboardType & HbTouchInputMask) != 0; |
|
89 } |
|
90 |
|
91 #endif // HB_INPUT_UTILS_H |
|
92 |
|
93 // End of file |