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