Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiKeyboardMap.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file                FUiKeyboardMap.h
20  * @brief               This is the header file for the %KeyboardMap class.
21  *
22  * This header file contains the declarations of the %KeyboardMap class.
23  */
24
25 #ifndef _FUI_KEYBOARD_MAP_H_
26 #define _FUI_KEYBOARD_MAP_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseErrors.h>
30 #include <FBaseString.h>
31 #include <FUiIKeyEventListener.h>
32
33 namespace Tizen {namespace Ui
34 {
35 /**
36  * @if OSPDEPREC
37  * @enum        KeyboardKeyLabelType
38  *
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.
42  *
43  *  @brief <i> [Deprecated]  </i>
44  *  @deprecated     This enum is deprecated because it is not supported by the platform.
45  *  @since  2.0
46  * @endif
47  */
48 enum KeyboardKeyLabelType
49 {
50         /**
51          * @if OSPDEPREC
52          *      The first label to be displayed
53          * @endif 
54          */
55         KEYBOARD_KEY_LABEL_1 = 0x0000,
56
57         /**
58          * @if OSPDEPREC
59          *      The second label to be displayed after KEY_CAPSLOCK or KEY_FN is pressed
60          * @endif 
61          */
62         KEYBOARD_KEY_LABEL_2,
63
64         /**
65          * @if OSPDEPREC
66          *      The third label to be displayed when the key is toggled twice (without pressing KEY_CAPSLOCK or KEY_FN)
67          * @endif 
68          */
69         KEYBOARD_KEY_LABEL_3,
70
71         /**
72          * @if OSPDEPREC
73          *      The fourth label to be displayed when the key is toggled the third time (without pressing KEY_CAPSLOCK or KEY_FN)
74          * @endif 
75          */
76         KEYBOARD_KEY_LABEL_4,
77
78         /*
79          * @if OSPDEPREC
80          *      The max value
81          * @endif 
82          */
83         KEYBOARD_KEY_LABEL_MAX = 255
84 };
85
86
87 /**
88  * @if OSPDEPREC
89  * @class       KeyboardMap
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.
92  * @since       2.0
93  *
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.
98  *
99  * The following example demonstrates how to use the %KeyboardMap class to get the type of the keyboard and the property of each key.
100  *
101  * @code
102  * KeyboardMap* pKeyboardMap = KeyboardMap::GetInstance();
103  * if (pKeyboardMap != null)
104  * {
105  *     // Gets the keyboard type
106  *     String type = pKeyboardMap->GetKeyboardType();
107  *     AppLog("The current hardware keyboard type = %ls", type.GetPointer());
108  *
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);
116  * }
117  * @endcode
118  * @endif
119  */
120 class _OSP_EXPORT_ KeyboardMap
121         : public Tizen::Base::Object
122 {
123 public:
124         /**
125          * @if OSPDEPREC
126          * This destructor overrides Tizen::Base::Object::~Object().
127          *
128          * @brief               <i> [Deprecated] </i>
129          * @deprecated  This class is deprecated because it is not supported by the platform.
130          * @since               2.0
131          * @endif
132          */
133         virtual ~KeyboardMap(void);
134
135         /**
136          * @if OSPDEPREC
137          * Gets the pointer to the %KeyboardMap instance.
138          *
139          * @brief               <i> [Deprecated] </i>
140          * @deprecated  This class is deprecated because it is not supported by the platform.
141          * @since               2.0
142          *
143          * @return      The current %KeyboardMap instance
144          * @endif
145          */
146         static KeyboardMap* GetInstance(void);
147
148 public:
149         /**
150          * @if OSPDEPREC
151          * Checks whether the specified key is a printing key (the key has one or more labels printed on the corresponding key).
152          *
153          * @brief               <i> [Deprecated] </i>
154          * @deprecated  This class is deprecated because it is not supported by the platform.
155          * @since               2.0
156          *
157          * @return      @c true if the specified key is a printing key, @n
158          *                              else @c false
159          * @param[in]   keyCode     The key
160          * @endif
161          */
162         bool IsPrintingKey(KeyCode keyCode) const;
163
164         /**
165          * @if OSPDEPREC
166          * Checks whether the specified key is available on the current keyboard.
167          *
168          * @brief               <i> [Deprecated] </i>
169          * @deprecated  This class is deprecated because it is not supported by the platform.
170          * @since               2.0
171          *
172          * @return      @c true if the specified key is available on the current keyboard, @n
173          *                              else @c false
174          * @param[in]   keyCode     The key
175          * @endif
176          */
177         bool IsKeyAvailable(KeyCode keyCode) const;
178
179         /**
180          * @if OSPDEPREC
181          * Gets the name of the keyboard type.
182          *
183          * @brief               <i> [Deprecated] </i>
184          * @deprecated  This class is deprecated because it is not supported by the platform.
185          * @since               2.0
186          *
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
191          * @remarks
192          * Supported keyboard types
193          * <table>
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>
220          * </table>
221          * @endif
222         */
223         Tizen::Base::String GetKeyboardType(void) const;
224
225         /**
226          * @if OSPDEPREC
227          * Gets the label of the specified key.
228          *
229          * @brief               <i> [Deprecated] </i>
230          * @deprecated  This class is deprecated because it is not supported by the platform.
231          * @since               2.0
232          *
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
237          * @endif
238          */
239         Tizen::Base::String GetDisplayableLabel(KeyCode keyCode, KeyboardKeyLabelType type = KEYBOARD_KEY_LABEL_1) const;
240
241 protected:
242         /**
243          * @if OSPDEPREC
244          * This is the default constructor for this class.
245          *
246          * @brief               <i> [Deprecated] </i>
247          * @deprecated  This class is deprecated because it is not supported by the platform.
248          * @since               2.0
249          * @endif
250          */
251         KeyboardMap(void);
252
253         /**
254          * @if OSPDEPREC
255          * Initializes this instance of %KeyboardMap.
256          *
257          * @brief               <i> [Deprecated] </i>
258          * @deprecated  This class is deprecated because it is not supported by the platform.
259          * @since               2.0
260          *
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.
265          * @endif
266          */
267         result Construct(void);
268
269 protected:
270         //
271         // This method is for internal use only. Using this method can cause behavioral, security-related,
272         // and consistency-related issues in the application.
273         //
274         // This method is reserved and may change its name at any time without
275         // prior notice.
276         //
277         // Gets KeyCode of the specified system key.
278         //
279         // @since               2.0
280         // @return              The key code
281         // @param[in]   systemKeyCode   The system key
282         //
283         KeyCode GetKeyCode(int systemKeyCode) const;
284
285         //
286         // This method is for internal use only. Using this method can cause behavioral, security-related,
287         // and consistency-related issues in the application.
288         //
289         // This method is reserved and may change its name at any time without
290         // prior notice.
291         //
292         // Loads keyboard map table from file.
293         //
294         // @since               2.0
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.
299         //
300         result LoadKeyboarMapFromFile(void);
301 private:
302         static void InitializeInstance(void);
303
304 }; // KeyboardMap
305
306 }} // Tizen::Ui
307
308 #endif // _FUI_KEYBOARD_MAP_H_