2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.
20 * @file FUiKeyboardMap.h
21 * @brief This is the header file for the %KeyboardMap class.
23 * This header file contains the declarations of the %KeyboardMap class.
27 #ifndef _FUI_KEYBOARD_MAP_H_
28 #define _FUI_KEYBOARD_MAP_H_
30 #include <FBaseObject.h>
31 #include <FBaseErrors.h>
32 #include <FBaseString.h>
33 #include <FUiIKeyEventListener.h>
35 namespace Tizen {namespace Ui
39 * @enum KeyboardKeyLabelType
41 * Defines the key label types. @n
42 * It defines the types of labels that are printed on the corresponding key of the QWERTY keyboard. Only the printing
43 * keys have one or more text labels.
45 * @brief <i> [Deprecated] </i>
46 * @deprecated This enum is deprecated because it is not supported by the platform.
50 enum KeyboardKeyLabelType
54 * The first label to be displayed
57 KEYBOARD_KEY_LABEL_1 = 0x0000,
61 * The second label to be displayed after KEY_CAPSLOCK or KEY_FN is pressed
68 * The third label to be displayed when the key is toggled twice (without pressing KEY_CAPSLOCK or KEY_FN)
75 * The fourth label to be displayed when the key is toggled the third time (without pressing KEY_CAPSLOCK or KEY_FN)
85 KEYBOARD_KEY_LABEL_MAX = 255
92 * @brief <i> [Deprecated] </i> This class manages the hardware keyboard key mapping.
93 * @deprecated This class is deprecated because it is not supported by the platform.
96 * The %KeyboardMap class maintains a map of hardware keys. You can query the current
97 * hardware keyboard type of the device and check the availability of a
98 * specific key. Furthermore, you can query the labels that are printed on the
99 * hardware keyboard of a specific key.
101 * The following example demonstrates how to use the %KeyboardMap class to get the type of the keyboard and the property of each key.
104 * KeyboardMap* pKeyboardMap = KeyboardMap::GetInstance();
105 * if (pKeyboardMap != null)
107 * // Gets the keyboard type
108 * String type = pKeyboardMap->GetKeyboardType();
109 * AppLog("The current hardware keyboard type = %ls", type.GetPointer());
111 * // Checks properties of the hardware key
112 * bool available = pKeyboardMap->IsKeyAvailable(KEY_A);
113 * bool printing = pKeyboardMap->IsPrintingKey(KEY_A);
114 * String l1 = pKeyboardMap->GetDisplayableLabel(KEY_A);
115 * String l2 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_2);
116 * String l3 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_3);
117 * String l4 = pKeyboardMap->GetDisplayableLabel(KEY_A, KEYBOARD_KEY_LABEL_4);
122 class _OSP_EXPORT_ KeyboardMap
123 : public Tizen::Base::Object
128 * This destructor overrides Tizen::Base::Object::~Object().
130 * @brief <i> [Deprecated] </i>
131 * @deprecated This class is deprecated because it is not supported by the platform.
135 virtual ~KeyboardMap(void);
139 * Gets the pointer to the %KeyboardMap instance.
141 * @brief <i> [Deprecated] </i>
142 * @deprecated This class is deprecated because it is not supported by the platform.
145 * @return The current %KeyboardMap instance
148 static KeyboardMap* GetInstance(void);
153 * Checks whether the specified key is a printing key (the key has one or more labels printed on the corresponding key).
155 * @brief <i> [Deprecated] </i>
156 * @deprecated This class is deprecated because it is not supported by the platform.
159 * @return @c true if the specified key is a printing key, @n
161 * @param[in] keyCode The key
164 bool IsPrintingKey(KeyCode keyCode) const;
168 * Checks whether the specified key is available on the current keyboard.
170 * @brief <i> [Deprecated] </i>
171 * @deprecated This class is deprecated because it is not supported by the platform.
174 * @return @c true if the specified key is available on the current keyboard, @n
176 * @param[in] keyCode The key
179 bool IsKeyAvailable(KeyCode keyCode) const;
183 * Gets the name of the keyboard type.
185 * @brief <i> [Deprecated] </i>
186 * @deprecated This class is deprecated because it is not supported by the platform.
189 * @return The name of the keyboard type
190 * @remarks The name of the keyboard type follows the following naming convention: @n
191 * GENERAL-TYPE_KEY-LAYOUT_LANGUAGE/COUNTRY/REGION (for example, QWERTY_11x4_EUROPE,
192 * NUMERIC_3x4_EUROPE). @n If the device does not have a keyboard, the method returns "NONE". @n
194 * Supported keyboard types
196 * <tr> <td> Keyboard Type </td> <td> Languages </td> </tr>
197 * <tr> <td> QWERTY_11x4_GLOBAL </td> <td> English </td> </tr>
198 * <tr> <td> QWERTY_11x4_EUROPE </td> <td> English </td> </tr>
199 * <tr> <td> QWERTY_11x4_UK </td> <td> English </td> </tr>
200 * <tr> <td> QWERTY_11x4_FRANCE </td> <td> French, English </td> </tr>
201 * <tr> <td> QWERTY_11x4_GERMAN </td> <td> German, English </td> </tr>
202 * <tr> <td> QWERTY_11x4_GREECE </td> <td> Greek, English </td> </tr>
203 * <tr> <td> QWERTY_11x4_ITALY </td> <td> Italian, English </td> </tr>
204 * <tr> <td> QWERTY_11x4_NORDIC </td> <td> North Germanic </td> </tr>
205 * <tr> <td> QWERTY_11x4_RUSSIA </td> <td> Russian, English </td> </tr>
206 * <tr> <td> QWERTY_11x4_SPAIN </td> <td> Spanish, English </td> </tr>
207 * <tr> <td> QWERTY_11x4_TURKEY </td> <td> English </td> </tr>
208 * <tr> <td> QWERTY_11x4_NORTH-AFRICA </td> <td> English, English </td> </tr>
209 * <tr> <td> QWERTY_11x4_ARAB </td> <td> Arabic, English </td> </tr>
210 * <tr> <td> QWERTY_11x4_IRAN </td> <td> Farsi, English </td> </tr>
211 * <tr> <td> QWERTY_11x4_PARKISTAN </td> <td> Urdu, English </td> </tr>
212 * <tr> <td> QWERTY_11x4_ISRAEL </td> <td> Hebrew, English </td> </tr>
213 * <tr> <td> QWERTY_11x4_CHINA </td> <td> English </td> </tr>
214 * <tr> <td> QWERTY_11x4_HONGKONG </td> <td> Chinese Traditional, English </td> </tr>
215 * <tr> <td> QWERTY_11x4_SINGAPORE </td> <td> English </td> </tr>
216 * <tr> <td> QWERTY_11x4_THAILAND </td> <td> Thai, English </td> </tr>
217 * <tr> <td> QWERTY_11x4_TAIWAN </td> <td> Chinese Traditional, English </td> </tr>
218 * <tr> <td> QWERTY_11x4_VIETNAM </td> <td> Vietnamese, English </td> </tr>
219 * <tr> <td> QWERTY_11x4_JAPAN </td> <td> Japanese, English </td> </tr>
220 * <tr> <td> QWERTY_11x4_KOREA </td> <td> Korean, English </td> </tr>
221 * <tr> <td> QWERTY_11x4_NORTH-AMERICA </td> <td> English </td> </tr>
225 Tizen::Base::String GetKeyboardType(void) const;
229 * Gets the label of the specified key.
231 * @brief <i> [Deprecated] </i>
232 * @deprecated This class is deprecated because it is not supported by the platform.
235 * @return The text of the label, @n
236 * else an empty string if the specified key is not a printing key or the secondary/tertiary character label is not defined
237 * @param[in] keyCode The key
238 * @param[in] type The keyboard key label type
241 Tizen::Base::String GetDisplayableLabel(KeyCode keyCode, KeyboardKeyLabelType type = KEYBOARD_KEY_LABEL_1) const;
246 * This is the default constructor for this class.
248 * @brief <i> [Deprecated] </i>
249 * @deprecated This class is deprecated because it is not supported by the platform.
257 * Initializes this instance of %KeyboardMap.
259 * @brief <i> [Deprecated] </i>
260 * @deprecated This class is deprecated because it is not supported by the platform.
263 * @return An error code
264 * @exception E_SUCCESS The method is successful.
265 * @exception E_IO An IO error has occurred.
266 * @exception E_SYSTEM A system error has occurred.
269 result Construct(void);
273 // This method is for internal use only. Using this method can cause behavioral, security-related,
274 // and consistency-related issues in the application.
276 // This method is reserved and may change its name at any time without
279 // Gets KeyCode of the specified system key.
282 // @return The key code
283 // @param[in] systemKeyCode The system key
285 KeyCode GetKeyCode(int systemKeyCode) const;
288 // This method is for internal use only. Using this method can cause behavioral, security-related,
289 // and consistency-related issues in the application.
291 // This method is reserved and may change its name at any time without
294 // Loads keyboard map table from file.
297 // @return An error code
298 // @exception E_SUCCESS The method is successful.
299 // @exception E_IO An unexpected IO error has occurred.
300 // @exception E_SYSTEM A system error has occurred.
302 result LoadKeyboarMapFromFile(void);
304 static void InitializeInstance(void);
310 #endif // _FUI_KEYBOARD_MAP_H_