2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiKeyboardMap.h
20 * @brief This is the header file for the %KeyboardMap class.
22 * This header file contains the declarations of the %KeyboardMap class.
25 #ifndef _FUI_KEYBOARD_MAP_H_
26 #define _FUI_KEYBOARD_MAP_H_
28 #include <FBaseObject.h>
29 #include <FBaseErrors.h>
30 #include <FBaseString.h>
31 #include <FUiIKeyEventListener.h>
33 namespace Tizen {namespace Ui
37 * @enum KeyboardKeyLabelType
39 * Defines the key label types. @n
40 * It defines the types of labels that are printed on the corresponding key of the QWERTY keyboard. Only the printing
41 * keys have one or more text labels.
43 * @brief <i> [Deprecated] </i>
44 * @deprecated This enum is deprecated because it is not supported by the platform.
48 enum KeyboardKeyLabelType
52 * The first label to be displayed
55 KEYBOARD_KEY_LABEL_1 = 0x0000,
59 * The second label to be displayed after KEY_CAPSLOCK or KEY_FN is pressed
66 * The third label to be displayed when the key is toggled twice (without pressing KEY_CAPSLOCK or KEY_FN)
73 * The fourth label to be displayed when the key is toggled the third time (without pressing KEY_CAPSLOCK or KEY_FN)
83 KEYBOARD_KEY_LABEL_MAX = 255
90 * @brief <i> [Deprecated] </i> This class manages the hardware keyboard key mapping.
91 * @deprecated This class is deprecated because it is not supported by the platform.
94 * The %KeyboardMap class maintains a map of hardware keys. You can query the current
95 * hardware keyboard type of the device and check the availability of a
96 * specific key. Furthermore, you can query the labels that are printed on the
97 * hardware keyboard of a specific key.
99 * The following example demonstrates how to use the %KeyboardMap class to get the type of the keyboard and the property of each key.
102 * KeyboardMap* pKeyboardMap = KeyboardMap::GetInstance();
103 * if (pKeyboardMap != null)
105 * // Gets the keyboard type
106 * String type = pKeyboardMap->GetKeyboardType();
107 * AppLog("The current hardware keyboard type = %ls", type.GetPointer());
109 * // Checks properties of the hardware key
110 * bool available = pKeyboardMap->IsKeyAvailable(KEY_A);
111 * bool printing = pKeyboardMap->IsPrintingKey(KEY_A);
112 * String l1 = pKeyboardMap->GetDisplayableLabel(KEY_A);
113 * String l2 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_2);
114 * String l3 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_3);
115 * String l4 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_4);
120 class _OSP_EXPORT_ KeyboardMap
121 : public Tizen::Base::Object
126 * This destructor overrides Tizen::Base::Object::~Object().
128 * @brief <i> [Deprecated] </i>
129 * @deprecated This class is deprecated because it is not supported by the platform.
133 virtual ~KeyboardMap(void);
137 * Gets the pointer to the %KeyboardMap instance.
139 * @brief <i> [Deprecated] </i>
140 * @deprecated This class is deprecated because it is not supported by the platform.
143 * @return The current %KeyboardMap instance
146 static KeyboardMap* GetInstance(void);
151 * Checks whether the specified key is a printing key (the key has one or more labels printed on the corresponding key).
153 * @brief <i> [Deprecated] </i>
154 * @deprecated This class is deprecated because it is not supported by the platform.
157 * @return @c true if the specified key is a printing key, @n
159 * @param[in] keyCode The key
162 bool IsPrintingKey(KeyCode keyCode) const;
166 * Checks whether the specified key is available on the current keyboard.
168 * @brief <i> [Deprecated] </i>
169 * @deprecated This class is deprecated because it is not supported by the platform.
172 * @return @c true if the specified key is available on the current keyboard, @n
174 * @param[in] keyCode The key
177 bool IsKeyAvailable(KeyCode keyCode) const;
181 * Gets the name of the keyboard type.
183 * @brief <i> [Deprecated] </i>
184 * @deprecated This class is deprecated because it is not supported by the platform.
187 * @return The name of the keyboard type
188 * @remarks The name of the keyboard type follows the following naming convention: @n
189 * GENERAL-TYPE_KEY-LAYOUT_LANGUAGE/COUNTRY/REGION (for example, QWERTY_11x4_EUROPE,
190 * NUMERIC_3x4_EUROPE). @n If the device does not have a keyboard, the method returns "NONE". @n
192 * Supported keyboard types
194 * <tr> <td> Keyboard Type </td> <td> Languages </td> </tr>
195 * <tr> <td> QWERTY_11x4_GLOBAL </td> <td> English </td> </tr>
196 * <tr> <td> QWERTY_11x4_EUROPE </td> <td> English </td> </tr>
197 * <tr> <td> QWERTY_11x4_UK </td> <td> English </td> </tr>
198 * <tr> <td> QWERTY_11x4_FRANCE </td> <td> French, English </td> </tr>
199 * <tr> <td> QWERTY_11x4_GERMAN </td> <td> German, English </td> </tr>
200 * <tr> <td> QWERTY_11x4_GREECE </td> <td> Greek, English </td> </tr>
201 * <tr> <td> QWERTY_11x4_ITALY </td> <td> Italian, English </td> </tr>
202 * <tr> <td> QWERTY_11x4_NORDIC </td> <td> North Germanic </td> </tr>
203 * <tr> <td> QWERTY_11x4_RUSSIA </td> <td> Russian, English </td> </tr>
204 * <tr> <td> QWERTY_11x4_SPAIN </td> <td> Spanish, English </td> </tr>
205 * <tr> <td> QWERTY_11x4_TURKEY </td> <td> English </td> </tr>
206 * <tr> <td> QWERTY_11x4_NORTH-AFRICA </td> <td> English, English </td> </tr>
207 * <tr> <td> QWERTY_11x4_ARAB </td> <td> Arabic, English </td> </tr>
208 * <tr> <td> QWERTY_11x4_IRAN </td> <td> Farsi, English </td> </tr>
209 * <tr> <td> QWERTY_11x4_PARKISTAN </td> <td> Urdu, English </td> </tr>
210 * <tr> <td> QWERTY_11x4_ISRAEL </td> <td> Hebrew, English </td> </tr>
211 * <tr> <td> QWERTY_11x4_CHINA </td> <td> English </td> </tr>
212 * <tr> <td> QWERTY_11x4_HONGKONG </td> <td> Chinese Traditional, English </td> </tr>
213 * <tr> <td> QWERTY_11x4_SINGAPORE </td> <td> English </td> </tr>
214 * <tr> <td> QWERTY_11x4_THAILAND </td> <td> Thai, English </td> </tr>
215 * <tr> <td> QWERTY_11x4_TAIWAN </td> <td> Chinese Traditional, English </td> </tr>
216 * <tr> <td> QWERTY_11x4_VIETNAM </td> <td> Vietnamese, English </td> </tr>
217 * <tr> <td> QWERTY_11x4_JAPAN </td> <td> Japanese, English </td> </tr>
218 * <tr> <td> QWERTY_11x4_KOREA </td> <td> Korean, English </td> </tr>
219 * <tr> <td> QWERTY_11x4_NORTH-AMERICA </td> <td> English </td> </tr>
223 Tizen::Base::String GetKeyboardType(void) const;
227 * Gets the label of the specified key.
229 * @brief <i> [Deprecated] </i>
230 * @deprecated This class is deprecated because it is not supported by the platform.
233 * @return The text of the label, @n
234 * else an empty string if the specified key is not a printing key or the secondary/tertiary character label is not defined
235 * @param[in] keyCode The key
236 * @param[in] type The keyboard key label type
239 Tizen::Base::String GetDisplayableLabel(KeyCode keyCode, KeyboardKeyLabelType type = KEYBOARD_KEY_LABEL_1) const;
244 * This is the default constructor for this class.
246 * @brief <i> [Deprecated] </i>
247 * @deprecated This class is deprecated because it is not supported by the platform.
255 * Initializes this instance of %KeyboardMap.
257 * @brief <i> [Deprecated] </i>
258 * @deprecated This class is deprecated because it is not supported by the platform.
261 * @return An error code
262 * @exception E_SUCCESS The method is successful.
263 * @exception E_IO An IO error has occurred.
264 * @exception E_SYSTEM A system error has occurred.
267 result Construct(void);
271 // This method is for internal use only. Using this method can cause behavioral, security-related,
272 // and consistency-related issues in the application.
274 // This method is reserved and may change its name at any time without
277 // Gets KeyCode of the specified system key.
280 // @return The key code
281 // @param[in] systemKeyCode The system key
283 KeyCode GetKeyCode(int systemKeyCode) const;
286 // This method is for internal use only. Using this method can cause behavioral, security-related,
287 // and consistency-related issues in the application.
289 // This method is reserved and may change its name at any time without
292 // Loads keyboard map table from file.
295 // @return An error code
296 // @exception E_SUCCESS The method is successful.
297 // @exception E_IO An unexpected IO error has occurred.
298 // @exception E_SYSTEM A system error has occurred.
300 result LoadKeyboarMapFromFile(void);
302 static void InitializeInstance(void);
308 #endif // _FUI_KEYBOARD_MAP_H_