2 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_UIX_INPUTMETHOD_H__
18 #define __TIZEN_UIX_INPUTMETHOD_H__
22 * @brief This file contains input method APIs and related enumeration.
26 #include <inputmethod_keydef.h>
27 #include <inputmethod_device_event.h>
29 #include <Ecore_IMF.h>
37 * @addtogroup CAPI_UIX_INPUTMETHOD_MODULE
42 * @brief Enumeration for input method function error.
44 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
47 IME_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
48 IME_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
49 IME_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
50 IME_ERROR_NO_CALLBACK_FUNCTION = TIZEN_ERROR_IME | 0x0001, /**< Necessary callback function is not set */
51 IME_ERROR_NOT_RUNNING = TIZEN_ERROR_IME | 0x0002, /**< IME main loop isn't started yet */
52 IME_ERROR_OPERATION_FAILED = TIZEN_ERROR_IME | 0x0003, /**< Operation failed */
53 IME_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< out of memory */
57 * @brief Enumeration of the option window type.
59 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
61 * @see ime_option_window_created_cb()
64 IME_OPTION_WINDOW_TYPE_KEYBOARD, /**< Open from Keyboard */
65 IME_OPTION_WINDOW_TYPE_SETTING_APPLICATION, /**< Open from Setting application */
66 } ime_option_window_type_e;
69 * @brief Enumeration of layout variation.
71 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
73 * @see ime_context_get_layout_variation()
76 IME_LAYOUT_NORMAL_VARIATION_NORMAL = 0, /**< The plain normal layout */
77 IME_LAYOUT_NORMAL_VARIATION_FILENAME, /**< Filename layout; symbols such as '/', '*', '\', '|', '<', '>', '?', '"' and ':' should be disabled */
78 IME_LAYOUT_NORMAL_VARIATION_PERSON_NAME, /**< The name of a person */
79 IME_LAYOUT_NUMBERONLY_VARIATION_NORMAL = 0, /**< The plain normal number layout */
80 IME_LAYOUT_NUMBERONLY_VARIATION_SIGNED, /**< The number layout to allow a negative sign */
81 IME_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, /**< The number layout to allow decimal point to provide fractional value */
82 IME_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL, /**< The number layout to allow decimal point and negative sign */
83 IME_LAYOUT_PASSWORD_VARIATION_NORMAL = 0, /**< The normal password layout */
84 IME_LAYOUT_PASSWORD_VARIATION_NUMBERONLY, /**< The password layout to allow only number */
85 } ime_layout_variation_e;
88 * @brief Enumeration of string attribute type.
90 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
92 * @remarks Currently, a font style is available to use.
94 * @see ime_preedit_attribute()
95 * @see ime_update_preedit_string()
98 IME_ATTR_NONE, /**< No attribute */
99 IME_ATTR_FONTSTYLE, /**< A font style attribute, e.g., underline, etc. */
100 } ime_attribute_type;
103 * @brief Enumeration containing input panel events.
107 * @see ime_update_input_panel_event()
110 IME_EVENT_TYPE_LANGUAGE = 1, /**< The language of the input panel */
111 IME_EVENT_TYPE_SHIFT_MODE, /**< The shift key state of the input panel */
112 IME_EVENT_TYPE_GEOMETRY, /**< The size of the input panel */
116 * @brief Value for #IME_ATTR_FONTSTYLE. Draw a line under the text.
117 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
119 #define IME_ATTR_FONTSTYLE_UNDERLINE 1
122 * @brief Value for #IME_ATTR_FONTSTYLE. Draw text in highlighted color.
123 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
125 #define IME_ATTR_FONTSTYLE_HIGHLIGHT 2
128 * @brief Value for #IME_ATTR_FONTSTYLE. Draw text in reversal color.
129 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
131 #define IME_ATTR_FONTSTYLE_REVERSAL 4
134 * @brief The structure type to contain the attributes for preedit string.
136 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
138 * @remarks A preedit string may have one or more different attributes. This structure describes each attribute of the string.
140 * @see ime_update_preedit_string()
141 * @see ime_attribute_type
144 unsigned int start; /**< The start position in the string of this attribute */
145 unsigned int length; /**< The character length of this attribute, the range is [start, start+length] */
146 ime_attribute_type type; /**< The type of this attribute */
147 unsigned int value; /**< The value of this attribute */
148 } ime_preedit_attribute;
151 * @brief Handle of an associated text input UI control's input context.
153 * @details This is one of parameters of ime_show_cb() callback function. IME application
154 * should configure its input panel with this structure information.
156 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
158 * @see ime_context_get_layout()
159 * @see ime_context_get_layout_variation()
160 * @see ime_context_get_cursor_position()
161 * @see ime_context_get_autocapital_type()
162 * @see ime_context_get_return_key_type()
163 * @see ime_context_get_return_key_state()
164 * @see ime_context_get_prediction_mode()
165 * @see ime_context_get_password_mode()
166 * @see ime_context_get_input_hint()
167 * @see ime_context_get_bidi_direction()
168 * @see ime_context_get_language()
170 typedef struct _ime_context *ime_context_h;
173 * @brief Handle of the device information of the key event.
175 * @details This is one of parameters of ime_process_key_event_cb() callback function. IME application
176 * may distinguish the key event by using this if necessary.
178 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
180 * @see ime_process_key_event_cb()
181 * @see ime_device_info_get_name()
182 * @see ime_device_info_get_class()
183 * @see ime_device_info_get_subclass()
185 typedef struct _ime_device_info *ime_device_info_h;
188 * @brief Called when the input panel is created.
190 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
194 * @privilege %http://tizen.org/privilege/ime
196 * @remarks This callback function is mandatory and must be registered using ime_run(). The
197 * ime_get_main_window() can be used to get the created input panel window.
199 * @param[in] user_data User data to be passed from the callback registration function
201 * @pre The ime_run() function calls this callback function.
204 * @see ime_set_size()
205 * @see ime_get_main_window()
207 typedef void (*ime_create_cb)(void *user_data);
210 * @brief Called when the input panel is terminated.
212 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
216 * @privilege %http://tizen.org/privilege/ime
218 * @remarks This callback function is mandatory and must be registered using ime_run(). The
219 * ime_get_main_window() can be used to get the created input panel window.
221 * @param[in] user_data User data to be passed from the callback registration function
224 * @see ime_get_main_window()
226 typedef void (*ime_terminate_cb)(void *user_data);
229 * @brief Called when an associated text input UI control requests the input panel to show itself.
231 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
235 * @privilege %http://tizen.org/privilege/ime
237 * @remarks This callback function is mandatory and must be registered using ime_run().
238 * IME application should configure its input panel with #ime_context_h structure information.
239 * The ime_get_main_window() can be used to get the created input panel window.
241 * @param[in] context_id The input context identification value of an associated text input UI control
242 * @param[in] context The input context information handle
243 * @param[in] user_data User data to be passed from the callback registration function
246 * @see ime_get_main_window()
247 * @see ime_context_get_layout()
248 * @see ime_context_get_layout_variation()
249 * @see ime_context_get_cursor_position()
250 * @see ime_context_get_autocapital_type()
251 * @see ime_context_get_return_key_type()
252 * @see ime_context_get_return_key_state()
253 * @see ime_context_get_prediction_mode()
254 * @see ime_context_get_password_mode()
255 * @see ime_context_get_input_hint()
256 * @see ime_context_get_bidi_direction()
257 * @see ime_context_get_language()
259 typedef void (*ime_show_cb)(int context_id, ime_context_h context, void *user_data);
262 * @brief Called when an associated text input UI control requests the input panel to hide itself.
264 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
268 * @privilege %http://tizen.org/privilege/ime
270 * @remarks This callback function is mandatory and must be registered using ime_run(). The
271 * ime_get_main_window() can be used to get the created input panel window.
273 * @param[in] context_id The input context identification value of an associated text input UI control
274 * @param[in] user_data User data to be passed from the callback registration function
277 * @see ime_get_main_window()
279 typedef void (*ime_hide_cb)(int context_id, void *user_data);
282 * @brief Called when an associated text input UI control has focus.
284 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
288 * @privilege %http://tizen.org/privilege/ime
290 * @param[in] context_id The input context identification value of an associated text input UI control
291 * @param[in] user_data User data to be passed from the callback registration function
293 * @pre The callback can be registered using ime_event_set_focus_in_cb() function.
295 * @see ime_event_set_focus_in_cb()
297 typedef void (*ime_focus_in_cb)(int context_id, void *user_data);
300 * @brief Called when an associated text input UI control loses focus.
302 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
306 * @privilege %http://tizen.org/privilege/ime
308 * @param[in] context_id The input context identification value of an associated text input UI control
309 * @param[in] user_data User data to be passed from the callback registration function
311 * @pre The callback can be registered using ime_event_set_focus_out_cb() function.
313 * @see ime_event_set_focus_out_cb()
315 typedef void (*ime_focus_out_cb)(int context_id, void *user_data);
318 * @brief Called when an associated text input UI control responds to a request with the surrounding text.
320 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
324 * @privilege %http://tizen.org/privilege/ime
326 * @remarks The ime_request_surrounding_text() must be called to invoke this callback function, asynchronously.
328 * @param[in] context_id The input context identification value of an associated text input UI control
329 * @param[in] text The UTF-8 string requested
330 * @param[in] cursor_pos The cursor position
331 * @param[in] user_data User data to be passed from the callback registration function
333 * @pre The callback can be registered using ime_event_set_surrounding_text_updated_cb() function.
335 * @see ime_event_set_surrounding_text_updated_cb()
336 * @see ime_request_surrounding_text()
338 typedef void (*ime_surrounding_text_updated_cb)(int context_id, const char *text, int cursor_pos, void *user_data);
341 * @brief Called to reset the input context of an associated text input UI control.
343 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
347 * @privilege %http://tizen.org/privilege/ime
349 * @param[in] user_data User data to be passed from the callback registration function
351 * @pre The callback can be registered using ime_event_set_input_context_reset_cb() function.
353 * @see ime_event_set_input_context_reset_cb()
355 typedef void (*ime_input_context_reset_cb)(void *user_data);
358 * @brief Called when the position of the cursor in an associated text input UI control changes.
360 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
364 * @privilege %http://tizen.org/privilege/ime
366 * @param[in] cursor_pos The cursor position
367 * @param[in] user_data User data to be passed from the callback registration function
369 * @pre The callback can be registered using ime_event_set_cursor_position_updated_cb() function.
371 * @see ime_event_set_cursor_position_updated_cb()
373 typedef void (*ime_cursor_position_updated_cb)(int cursor_pos, void *user_data);
376 * @brief Called when an associated text input UI control requests the language from the input panel.
378 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
382 * @privilege %http://tizen.org/privilege/ime
384 * @remarks The allocated @a lang_code will be released internally.
386 * @param[in] user_data User data to be passed from the callback registration function
387 * @param[out] lang_code Input panel's current input language code (e.g., "en_US")
389 * @pre The callback can be registered using ime_event_set_language_requested_cb() function.
391 * @see ime_event_set_language_requested_cb()
393 typedef void (*ime_language_requested_cb)(void *user_data, char **lang_code);
396 * @brief Called to set the preferred language to the input panel.
398 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
402 * @privilege %http://tizen.org/privilege/ime
404 * @remarks @a language information is already set to the input panel when it is shown
405 * through #ime_context_h. This callback function will be only called when the client
406 * application changes the edit field's language attribute after the input panel is shown.
408 * @param[in] language The preferred language that the client application wants
409 * @param[in] user_data User data to be passed from the callback registration function
411 * @pre The callback can be registered using ime_event_set_language_set_cb() function.
413 * @see ime_event_set_language_set_cb()
415 typedef void (*ime_language_set_cb)(Ecore_IMF_Input_Panel_Lang language, void *user_data);
418 * @brief Called to set the application specific data to deliver to the input panel.
420 * @details This API is used by the applications to deliver the specific data to the input panel.
421 * The data format MUST be negotiated by both application and input panel.
423 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
427 * @privilege %http://tizen.org/privilege/ime
429 * @param[in] data The specific data to be set to the input panel
430 * @param[in] data_length The length of data, in bytes, to send to the input panel
431 * @param[in] user_data User data to be passed from the callback registration function
433 * @pre The callback can be registered using ime_event_set_imdata_set_cb() function.
435 * @see ime_event_set_imdata_set_cb()
437 typedef void (*ime_imdata_set_cb)(void *data, unsigned int data_length, void *user_data);
440 * @brief Called when an associated text input UI control requests the application specific data from the input panel.
442 * @details This API is used by the applications to request the specific data from the input panel.
443 * The data format MUST be negotiated by both application and input panel.
445 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
449 * @privilege %http://tizen.org/privilege/ime
451 * @remarks The allocated @a data will be released internally.
453 * @param[in] user_data User data to be passed from the callback registration function
454 * @param[out] data Input panel's data to be set to the application
455 * @param[out] data_length The length of data, in bytes, to send to the application
457 * @pre The callback can be registered using ime_event_set_imdata_requested_cb() function.
459 * @see ime_event_set_imdata_requested_cb()
461 typedef void (*ime_imdata_requested_cb)(void *user_data, void **data, unsigned int *data_length);
464 * @brief Called when an associated text input UI control requests the input panel to set its layout.
466 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
470 * @privilege %http://tizen.org/privilege/ime
472 * @remarks @a layout information is already set to the input panel when it is shown
473 * through #ime_context_h. This callback function will be only called when the client
474 * application changes the edit field's layout attribute after the input panel is shown.
476 * @param[in] layout The input panel layout
477 * @param[in] user_data User data to be passed from the callback registration function
479 * @pre The callback can be registered using ime_event_set_layout_set_cb() function.
481 * @see ime_event_set_layout_set_cb()
483 typedef void (*ime_layout_set_cb)(Ecore_IMF_Input_Panel_Layout layout, void *user_data);
486 * @brief Called when an associated text input UI control requests the input panel to set the @c Return key label.
487 * The input panel can show text or image on the @c Return button according to the @c Return key action.
489 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
493 * @privilege %http://tizen.org/privilege/ime
495 * @remarks @a type information is already set to the input panel when it is shown
496 * through #ime_context_h. This callback function will be only called when the client
497 * application changes the edit field's @c Return key type attribute after the input panel
500 * @param[in] type The type of @c Return key on the input panel
501 * @param[in] user_data User data to be passed from the callback registration function
503 * @pre The callback can be registered using ime_event_set_return_key_type_set_cb() function.
505 * @see ime_event_set_return_key_type_set_cb()
507 typedef void (*ime_return_key_type_set_cb)(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data);
510 * @brief Called when an associated text input UI control requests the input panel to enable
511 * or disable the @c Return key state.
513 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
517 * @privilege %http://tizen.org/privilege/ime
519 * @remarks @a disabled information is already set to the input panel when it is shown
520 * through #ime_context_h. This callback function will be only called when the client
521 * application changes the edit field's @c Return key disable attribute after the input panel
524 * @param[in] disabled The Boolean state to disable @c Return key. The @c Return key is enabled by default
525 * @param[in] user_data User data to be passed from the callback registration function
527 * @pre The callback can be registered using ime_event_set_return_key_state_set_cb() function.
529 * @see ime_event_set_return_key_state_set_cb()
531 typedef void (*ime_return_key_state_set_cb)(bool disabled, void *user_data);
534 * @brief Called when an associated text input UI control requests the position and size from the input panel.
536 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
540 * @privilege %http://tizen.org/privilege/ime
542 * @param[in] user_data User data to be passed from the callback registration function
543 * @param[out] x The x position in screen
544 * @param[out] y The y position in screen
545 * @param[out] w The window width
546 * @param[out] h The window height
548 * @pre The callback can be registered using ime_event_set_geometry_requested_cb() function.
550 * @see ime_event_set_geometry_requested_cb()
552 typedef void (*ime_geometry_requested_cb)(void *user_data, int *x, int *y, int *w, int *h);
555 * @brief Called when a key event is received from external devices or ime_send_key_event().
557 * @details This function processes the key event before an associated text input UI control does.
559 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
563 * @privilege %http://tizen.org/privilege/ime
565 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
566 * @a dev_info should not be released by the application. The platform manages the handle and will release it when ime_process_key_event_cb() exits.
568 * @param[in] key_code The key code to be sent
569 * @param[in] key_mask The modifier key mask
570 * @param[in] dev_info The device information handle
571 * @param[in] user_data User data to be passed from the callback registration function
573 * @return @c true if the event was processed, otherwise the event was not processed and was forwarded to the client application.
575 * @pre The callback should be registered using ime_event_set_process_key_event_cb() function.
577 * @see ime_event_set_process_key_event_cb()
578 * @see ime_device_info_get_name()
579 * @see ime_device_info_get_class()
580 * @see ime_device_info_get_subclass()
581 * @see ime_send_key_event()
582 * @see ime_commit_string()
583 * @see ime_show_preedit_string()
584 * @see ime_hide_preedit_string()
585 * @see ime_update_preedit_string()
587 typedef bool (*ime_process_key_event_cb)(ime_key_code_e key_code, ime_key_mask_e key_mask, ime_device_info_h dev_info, void *user_data);
590 * @brief Called when a key event is received from external devices or ime_send_key_event().
591 * Provides the key code.
593 * @details This function processes the key event with keycode before an associated text input UI control does.
599 * @privilege %http://tizen.org/privilege/ime
601 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
602 * @a dev_info should not be released by the application. The platform manages the handle and will release it when ime_process_key_event_with_keycode_cb() exits.
604 * @param[in] key_code The X11 key code to be sent
605 * @param[in] key_sym The key symbol to be sent
606 * @param[in] key_mask The modifier key mask
607 * @param[in] dev_info The device information handle
608 * @param[in] user_data User data to be passed from the callback registration function
610 * @return @c true if the event was processed, otherwise the event was not processed and was forwarded to the client application.
612 * @pre The callback should be registered using ime_event_set_process_key_event_with_keycode_cb() function.
614 * @see ime_event_set_process_key_event_with_keycode_cb()
615 * @see ime_device_info_get_name()
616 * @see ime_device_info_get_class()
617 * @see ime_device_info_get_subclass()
618 * @see ime_send_key_event()
619 * @see ime_commit_string()
620 * @see ime_show_preedit_string()
621 * @see ime_hide_preedit_string()
622 * @see ime_update_preedit_string()
624 typedef bool (*ime_process_key_event_with_keycode_cb)(unsigned int key_code, ime_key_code_e key_sym, ime_key_mask_e key_mask, ime_device_info_h dev_info, void *user_data);
627 * @brief Called when the system display language is changed.
629 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
633 * @privilege %http://tizen.org/privilege/ime
635 * @param[in] language The language code
636 * @param[in] user_data User data to be passed from the callback registration function
638 * @pre The callback can be registered using ime_event_set_display_language_changed_cb() function.
640 * @see ime_event_set_display_language_changed_cb()
642 typedef void (*ime_display_language_changed_cb)(const char *language, void *user_data);
645 * @brief Called when the device is rotated.
647 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
651 * @privilege %http://tizen.org/privilege/ime
653 * @param[in] degree The rotation degree
654 * @param[in] user_data User data to be passed from the callback registration function
656 * @pre The callback can be registered using ime_event_set_rotation_degree_changed_cb() function.
658 * @see ime_event_set_rotation_degree_changed_cb()
660 typedef void (*ime_rotation_degree_changed_cb)(int degree, void *user_data);
663 * @brief Called when Accessibility in Settings application is on or off.
665 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
669 * @privilege %http://tizen.org/privilege/ime
671 * @param[in] state Accessibility option state
672 * @param[in] user_data User data to be passed from the callback registration function
674 * @pre The callback can be registered using ime_event_set_accessibility_state_changed_cb() function.
676 * @see ime_event_set_accessibility_state_changed_cb()
678 typedef void (*ime_accessibility_state_changed_cb)(bool state, void *user_data);
681 * @brief Called to create the option window.
683 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
687 * @privilege %http://tizen.org/privilege/ime
689 * @remarks if Input panel requests to open the option window, @a type will be #IME_OPTION_WINDOW_TYPE_KEYBOARD.
690 * And if Settings application requests to open it, @a type will be #IME_OPTION_WINDOW_TYPE_SETTING_APPLICATION.
692 * @param[in] window The created window object
693 * @param[in] type The type of option window
694 * @param[in] user_data User data to be passed from the callback registration function
696 * @pre The callback can be registered using ime_event_set_option_window_created_cb() function. The
697 * ime_create_option_window() calls this callback function or Settings application can call this callback function.
699 * @see ime_event_set_option_window_created_cb()
700 * @see ime_create_option_window()
702 typedef void (*ime_option_window_created_cb)(Evas_Object *window, ime_option_window_type_e type, void *user_data);
705 * @brief Called to destroy the option window.
707 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
711 * @privilege %http://tizen.org/privilege/ime
713 * @param[in] window The window object to destroy
714 * @param[in] user_data User data to be passed to the callback function
716 * @pre The callback can be registered using ime_event_set_option_window_destroyed_cb() function.
717 * ime_destroy_option_window() calls this callback function.
719 * @see ime_event_set_option_window_destroyed_cb()
721 typedef void (*ime_option_window_destroyed_cb)(Evas_Object *window, void *user_data);
724 * @brief Called to set the prediction hint string to deliver to the input panel.
730 * @privilege %http://tizen.org/privilege/ime
732 * @remarks @a prediction_hint is valid only in the callback. To use outside the callback, make a copy.
733 * This function is used by the applications to deliver the prediction hint message to the input panel.
735 * @param[in] prediction_hint The prediction hint to be set to the input panel
736 * @param[in] user_data User data to be passed to the callback function
738 * @pre The callback can be registered using ime_event_set_prediction_hint_set_cb() function.
740 * @see ime_event_set_prediction_hint_set_cb()
742 typedef void (*ime_prediction_hint_set_cb)(const char *prediction_hint, void *user_data);
745 * @brief Called when an associated text input UI control requests the text entry to set the MIME type.
751 * @privilege %http://tizen.org/privilege/ime
753 * @remarks @a mime_type is valid only in the callback. To use outside the callback, make a copy.
754 * This function is used by the applications to deliver the MIME type to the input panel.
756 * @param[in] mime_type The MIME type to be set to the input panel
757 * @param[in] user_data User data to be passed to the callback function
759 * @pre The callback can be registered using ime_event_set_mime_type_set_request_cb() function.
761 * @see ime_event_set_mime_type_set_request_cb()
763 typedef void (*ime_mime_type_set_request_cb)(const char *mime_type, void *user_data);
766 * @brief Called with the prediction hint key and value which can be delivered to the input panel.
772 * @privilege %http://tizen.org/privilege/ime
774 * @remarks @a key and @a value is valid only in the callback. To use outside the callback, make a copy.
775 * This function is used by the applications to deliver the prediction hint data message to the input panel.
777 * @param[in] key The prediction hint key to be set to the input panel
778 * @param[in] value The prediction hint value to be set to the input panel
779 * @param[in] user_data User data to be passed to the callback function
781 * @pre The callback can be registered using ime_event_set_prediction_hint_data_set_cb() function.
783 * @see ime_event_set_prediction_hint_data_set_cb()
785 typedef void (*ime_prediction_hint_data_set_cb)(const char *key, const char *value, void *user_data);
788 * @brief The structure type to contain the set of the essential callback functions for IME application lifecycle and appearance.
790 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
792 * @remarks These four callback functions are mandatory for IME application.
797 ime_create_cb create; /**< Called when the input panel is created */
798 ime_terminate_cb terminate; /**< Called when the input panel is terminated */
799 ime_show_cb show; /**< Called when the input panel is requested to show itself */
800 ime_hide_cb hide; /**< Called when the input panel is requested to hide itself */
804 * @brief Runs the main loop of IME application.
806 * @details This function starts to run IME application's main loop. The ime_create_cb()
807 * callback function is called to initialize IME application before the main loop starts up. And
808 * the ime_terminate_cb() callback function is called when IME application is terminated.
810 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
814 * @privilege %http://tizen.org/privilege/ime
816 * @remarks IME application MUST implement ime_app_main() function which is the main
817 * entry point of IME application. In ime_app_main() function, the ime_run()
818 * function MUST be called with the necessary callback functions; ime_create_cb(),
819 * ime_terminate_cb(), ime_show_cb(), and ime_hide_cb() callback functions
820 * are mandatory for IME application.
822 * @param[in] basic_cb The structure pointer of the essential callback functions
823 * @param[in] user_data User data to be passed to the callback functions
825 * @return 0 if IME application ends successfully, otherwise a negative error value
826 * @retval #IME_ERROR_NONE No error
827 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
828 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
829 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
830 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
832 * @pre The ime_event_set_***() functions can be called to set the event handling callback functions.
834 * @see ime_callback_s()
835 * @see ime_event_set_focus_in_cb()
836 * @see ime_event_set_focus_out_cb()
837 * @see ime_event_set_surrounding_text_updated_cb()
838 * @see ime_event_set_input_context_reset_cb()
839 * @see ime_event_set_cursor_position_updated_cb()
840 * @see ime_event_set_language_requested_cb()
841 * @see ime_event_set_language_set_cb()
842 * @see ime_event_set_imdata_set_cb()
843 * @see ime_event_set_layout_set_cb()
844 * @see ime_event_set_return_key_type_set_cb()
845 * @see ime_event_set_return_key_state_set_cb()
846 * @see ime_event_set_geometry_requested_cb()
847 * @see ime_event_set_display_language_changed_cb()
848 * @see ime_event_set_rotation_degree_changed_cb()
849 * @see ime_event_set_accessibility_state_changed_cb()
850 * @see ime_event_set_option_window_created_cb()
851 * @see ime_event_set_option_window_destroyed_cb()
852 * @see ime_event_set_prediction_hint_set_cb()
855 static void inputmethod_create_cb(void *user_data);
856 static void inputmethod_terminate_cb(void *user_data);
857 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
858 static void inputmethod_hide_cb(int context_id, void *user_data);
859 static void inputmethod_focus_in_cb(int context_id, void *user_data);
860 static void inputmethod_focus_out_cb(int context_id, void *user_data);
861 static void inputmethod_cursor_position_updated_cb(int cursor_pos, void *user_data);
863 static void inputmethod_create_cb(void *user_data)
865 Evas_Object *ime_win = NULL;
867 ime_set_size(480, 400, 800, 400);
868 ime_win = ime_get_main_window();
870 // Prepare before showing IME window.
874 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data)
876 Ecore_IMF_Input_Panel_Layout layout;
877 ime_layout_variation_e layout_variation;
878 Evas_Object *ime_win;
880 ime_context_get_layout(context, &layout);
881 ime_context_get_layout_variation(context, &layout_variation);
883 ime_win = ime_get_main_window();
885 // Compose IME UI properly with the context information and show.
887 evas_object_show(ime_win);
891 static void inputmethod_hide_cb(int context_id, void *user_data)
893 Evas_Object *ime_win = ime_get_main_window();
895 evas_object_hide(ime_win);
899 void ime_app_main(int argc, char **argv)
901 ime_callback_s basic_callback = {
902 inputmethod_create_cb,
903 inputmethod_terminate_cb,
908 ime_event_set_focus_in_cb(inputmethod_focus_in_cb, NULL);
909 ime_event_set_focus_out_cb(inputmethod_focus_out_cb, NULL);
910 ime_event_set_cursor_position_updated_cb(inputmethod_cursor_position_updated_cb, NULL);
912 ime_run(&basic_callback, NULL);
916 int ime_run(ime_callback_s *basic_cb, void *user_data);
919 * @brief Sets @c focus_in event callback function.
921 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
925 * @privilege %http://tizen.org/privilege/ime
927 * @remarks The ime_focus_in_cb() callback function is called when an associated text input
928 * UI control has focus.
930 * @param[in] callback_func @c focus_in event callback function
931 * @param[in] user_data User data to be passed to the callback function
933 * @return 0 on success, otherwise a negative error value
934 * @retval #IME_ERROR_NONE No error
935 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
936 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
937 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
939 * @post The ime_run() function should be called to start the IME application's main loop.
941 * @see ime_focus_in_cb()
944 int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data);
947 * @brief Sets @c focus_out event callback function.
949 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
953 * @privilege %http://tizen.org/privilege/ime
955 * @remarks The ime_focus_out_cb() callback function is called when an associated text input
956 * UI control loses focus.
958 * @param[in] callback_func @c focus_out event callback function
959 * @param[in] user_data User data to be passed to the callback function
961 * @return 0 on success, otherwise a negative error value
962 * @retval #IME_ERROR_NONE No error
963 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
964 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
965 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
967 * @post The ime_run() function should be called to start the IME application's main loop.
969 * @see ime_focus_out_cb()
972 int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data);
975 * @brief Sets @c surrounding_text_updated event callback function.
977 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
981 * @privilege %http://tizen.org/privilege/ime
983 * @remarks The ime_surrounding_text_updated_cb() callback function is called when an
984 * associated text input UI control responds to a request with the surrounding text.
986 * @param[in] callback_func @c surrounding_text_updated event callback function
987 * @param[in] user_data User data to be passed to the callback function
989 * @return 0 on success, otherwise a negative error value
990 * @retval #IME_ERROR_NONE No error
991 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
992 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
993 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
995 * @post The ime_run() function should be called to start the IME application's main loop.
997 * @see ime_surrounding_text_updated_cb()
1000 int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb callback_func, void *user_data);
1003 * @brief Sets @c input_context_reset event callback function.
1005 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1009 * @privilege %http://tizen.org/privilege/ime
1011 * @remarks The ime_input_context_reset_cb() callback function is called to reset the input
1012 * context of an associated text input UI control.
1014 * @param[in] callback_func @c input_context_reset event callback function
1015 * @param[in] user_data User data to be passed to the callback function
1017 * @return 0 on success, otherwise a negative error value
1018 * @retval #IME_ERROR_NONE No error
1019 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1020 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1021 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1023 * @post The ime_run() function should be called to start the IME application's main loop.
1025 * @see ime_input_context_reset_cb()
1028 int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_func, void *user_data);
1031 * @brief Sets @c cursor_position_updated event callback function.
1033 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1037 * @privilege %http://tizen.org/privilege/ime
1039 * @remarks The ime_cursor_position_updated_cb() callback function is called when the position
1040 * of the cursor in an associated text input UI control changes.
1042 * @param[in] callback_func @c cursor_position_updated event callback function
1043 * @param[in] user_data User data to be passed to the callback function
1045 * @return 0 on success, otherwise a negative error value
1046 * @retval #IME_ERROR_NONE No error
1047 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1048 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1049 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1051 * @post The ime_run() function should be called to start the IME application's main loop.
1053 * @see ime_cursor_position_updated_cb()
1056 int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb callback_func, void *user_data);
1059 * @brief Sets @c language_requested event callback function.
1061 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1065 * @privilege %http://tizen.org/privilege/ime
1067 * @remarks The ime_language_requested_cb() callback function is called when an associated
1068 * text input UI control requests the language from the input panel.
1070 * @param[in] callback_func @c language_requested event callback function
1071 * @param[in] user_data User data to be passed to the callback function
1073 * @return 0 on success, otherwise a negative error value
1074 * @retval #IME_ERROR_NONE No error
1075 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1076 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1077 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1079 * @post The ime_run() function should be called to start the IME application's main loop.
1081 * @see ime_language_requested_cb()
1084 int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, void *user_data);
1087 * @brief Sets @c language_set event callback function.
1089 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1093 * @privilege %http://tizen.org/privilege/ime
1095 * @remarks The ime_language_set_cb() callback function is called to set the preferred
1096 * language to the input panel.
1098 * @param[in] callback_func @c language_set event callback function
1099 * @param[in] user_data User data to be passed to the callback function
1101 * @return 0 on success, otherwise a negative error value
1102 * @retval #IME_ERROR_NONE No error
1103 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1104 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1105 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1107 * @post The ime_run() function should be called to start the IME application's main loop.
1109 * @see ime_language_set_cb()
1112 int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_data);
1115 * @brief Sets @c imdata_set event callback function.
1117 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1121 * @privilege %http://tizen.org/privilege/ime
1123 * @remarks The ime_imdata_set_cb() callback function is called to set the application
1124 * specific data to deliver to the input panel.
1126 * @param[in] callback_func @c imdata_set event callback function
1127 * @param[in] user_data User data to be passed to the callback function
1129 * @return 0 on success, otherwise a negative error value
1130 * @retval #IME_ERROR_NONE No error
1131 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1132 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1133 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1135 * @post The ime_run() function should be called to start the IME application's main loop.
1137 * @see ime_imdata_set_cb()
1138 * @see ime_event_set_imdata_requested_cb()
1141 int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data);
1144 * @brief Sets @c imdata_requested event callback function.
1146 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1150 * @privilege %http://tizen.org/privilege/ime
1152 * @remarks The ime_imdata_requested_cb() callback function is called when an associated
1153 * text input UI control requests the application specific data from the input panel.
1155 * @param[in] callback_func @c imdata_requested event callback function
1156 * @param[in] user_data User data to be passed to the callback function
1158 * @return 0 on success, otherwise a negative error value
1159 * @retval #IME_ERROR_NONE No error
1160 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1161 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1162 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1164 * @post The ime_run() function should be called to start the IME application's main loop.
1166 * @see ime_imdata_requested_cb()
1167 * @see ime_event_set_imdata_set_cb()
1170 int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, void *user_data);
1173 * @brief Sets @c layout_set event callback function.
1175 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1179 * @privilege %http://tizen.org/privilege/ime
1181 * @remarks The ime_layout_set_cb() callback function is called when an associated text input
1182 * UI control requests the input panel to set its layout.
1184 * @param[in] callback_func @c layout_set event callback function
1185 * @param[in] user_data User data to be passed to the callback function
1187 * @return 0 on success, otherwise a negative error value
1188 * @retval #IME_ERROR_NONE No error
1189 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1190 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1191 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1193 * @post The ime_run() function should be called to start the IME application's main loop.
1195 * @see ime_layout_set_cb()
1198 int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data);
1201 * @brief Sets @c return_key_type_set event callback function.
1203 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1207 * @privilege %http://tizen.org/privilege/ime
1209 * @remarks The ime_return_key_type_set_cb() callback function is called when an associated
1210 * text input UI control requests the input panel to set the @c Return key label.
1212 * @param[in] callback_func @c return_key_type_set event callback function
1213 * @param[in] user_data User data to be passed to the callback function
1215 * @return 0 on success, otherwise a negative error value
1216 * @retval #IME_ERROR_NONE No error
1217 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1218 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1219 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1221 * @post The ime_run() function should be called to start the IME application's main loop.
1223 * @see ime_return_key_type_set_cb()
1226 int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_func, void *user_data);
1229 * @brief Sets @c return_key_state_set event callback function.
1231 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1235 * @privilege %http://tizen.org/privilege/ime
1237 * @remarks The ime_return_key_state_set_cb() callback function is called when an associated
1238 * text input UI control requests the input panel to enable or disable the @c Return key state.
1240 * @param[in] callback_func @c return_key_state_set event callback function
1241 * @param[in] user_data User data to be passed to the callback function
1243 * @return 0 on success, otherwise a negative error value
1244 * @retval #IME_ERROR_NONE No error
1245 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1246 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1247 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1249 * @post The ime_run() function should be called to start the IME application's main loop.
1251 * @see ime_return_key_state_set_cb()
1254 int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_func, void *user_data);
1257 * @brief Sets @c geometry_requested event callback function.
1259 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1263 * @privilege %http://tizen.org/privilege/ime
1265 * @remarks The ime_geometry_requested_cb() callback function is called when an associated
1266 * text input UI control requests the position and size from the input panel.
1268 * @param[in] callback_func @c geometry_requested event callback function
1269 * @param[in] user_data User data to be passed to the callback function
1271 * @return 0 on success, otherwise a negative error value
1272 * @retval #IME_ERROR_NONE No error
1273 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1274 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1275 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1277 * @post The ime_run() function should be called to start the IME application's main loop.
1279 * @see ime_geometry_requested_cb()
1282 int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, void *user_data);
1285 * @brief Sets @c process_key_event event callback function.
1287 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1291 * @privilege %http://tizen.org/privilege/ime
1293 * @remarks The ime_process_key_event_cb() callback function is called when the key event
1294 * is received from the external keyboard devices or ime_send_key_event() function.
1296 * @param[in] callback_func @c process_key_event event callback function
1297 * @param[in] user_data User data to be passed to the callback function
1299 * @return 0 on success, otherwise a negative error value
1300 * @retval #IME_ERROR_NONE No error
1301 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1302 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1303 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1305 * @post The ime_run() function should be called to start the IME application's main loop.
1307 * @see ime_process_key_event_cb()
1311 static void inputmethod_create_cb(void *user_data);
1312 static void inputmethod_terminate_cb(void *user_data);
1313 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
1314 static void inputmethod_hide_cb(int context_id, void *user_data);
1316 static bool inputmethod_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, void *user_data);
1318 if (keymask & IME_KEY_MASK_CONTROL) {
1319 return false; // e.g., Control+C key event would be forwarded to UI control of the client application
1321 if (keymask & IME_KEY_MASK_ALT) {
1325 if (!(keymask & IME_KEY_MASK_RELEASED)) { // The key is pressed
1326 if (keycode == IME_KEY_1) {
1327 ime_update_preedit_string("1"); // Show "1" preedit string
1330 else if (keycode == IME_KEY_2) {
1331 ime_commit_string("12"); // Input "12" string
1339 void ime_app_main(int argc, char **argv)
1341 ime_callback_s basic_callback = {
1342 inputmethod_create_cb,
1343 inputmethod_terminate_cb,
1344 inputmethod_show_cb,
1345 inputmethod_hide_cb,
1348 ime_event_set_process_key_event_cb(inputmethod_process_key_event_cb, NULL);
1350 ime_run(&basic_callback, NULL);
1354 int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, void *user_data);
1357 * @brief Sets key event callback function for keycode.
1363 * @privilege %http://tizen.org/privilege/ime
1365 * @remarks The ime_process_key_event_with_keycode_cb() callback function is called when the key event
1366 * is received from external keyboard devices or ime_send_key_event().
1368 * @param[in] callback_func @c process_key_event_with_keycode() event callback function
1369 * @param[in] user_data User data to be passed to the callback function
1371 * @return 0 on success, otherwise a negative error value
1372 * @retval #IME_ERROR_NONE No error
1373 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1374 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1375 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1377 * @post The ime_run() function should be called to start the IME application's main loop.
1379 * @see ime_process_key_event_with_keycode_cb()
1382 int ime_event_set_process_key_event_with_keycode_cb(ime_process_key_event_with_keycode_cb callback_func, void *user_data);
1385 * @brief Sets @c display_language_changed event callback function.
1387 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1391 * @privilege %http://tizen.org/privilege/ime
1393 * @remarks The ime_display_language_changed_cb() callback function is called when the system
1394 * display language is changed.
1396 * @param[in] callback_func @c display_language_changed event callback function
1397 * @param[in] user_data User data to be passed to the callback function
1399 * @return 0 on success, otherwise a negative error value
1400 * @retval #IME_ERROR_NONE No error
1401 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1402 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1403 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1405 * @post The ime_run() function should be called to start the IME application's main loop.
1407 * @see ime_display_language_changed_cb()
1410 int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb callback_func, void *user_data);
1413 * @brief Sets @c rotation_degree_changed event callback function.
1415 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1419 * @privilege %http://tizen.org/privilege/ime
1421 * @remarks The ime_rotation_degree_changed_cb() callback function is called when the device
1424 * @param[in] callback_func @c rotation_degree_changed event callback function
1425 * @param[in] user_data User data to be passed to the callback function
1427 * @return 0 on success, otherwise a negative error value
1428 * @retval #IME_ERROR_NONE No error
1429 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1430 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1431 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1433 * @post The ime_run() function should be called to start the IME application's main loop.
1435 * @see ime_rotation_degree_changed_cb()
1438 int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb callback_func, void *user_data);
1441 * @brief Sets @c accessibility_state_changed event callback function.
1443 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1447 * @privilege %http://tizen.org/privilege/ime
1449 * @remarks The ime_accessibility_state_changed_cb() callback function is called when
1450 * Accessibility in Settings application is on or off.
1452 * @param[in] callback_func @c accessibility_state_changed event callback function
1453 * @param[in] user_data User data to be passed to the callback function
1455 * @return 0 on success, otherwise a negative error value
1456 * @retval #IME_ERROR_NONE No error
1457 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1458 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1459 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1461 * @post The ime_run() function should be called to start the IME application's main loop.
1463 * @see ime_accessibility_state_changed_cb()
1466 int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed_cb callback_func, void *user_data);
1469 * @brief Sets @c option_window_created event callback function.
1471 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1475 * @privilege %http://tizen.org/privilege/ime
1477 * @remarks The ime_option_window_created_cb() callback function is called to create the option window.
1479 * @param[in] callback_func @c option_window_created event callback function
1480 * @param[in] user_data User data to be passed to the callback function
1482 * @return 0 on success, otherwise a negative error value
1483 * @retval #IME_ERROR_NONE No error
1484 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1485 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1486 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1488 * @post The ime_run() function should be called to start the IME application's main loop.
1490 * @see ime_option_window_created_cb()
1493 int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback_func, void *user_data);
1496 * @brief Sets @c option_window_destroyed event callback function.
1498 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1502 * @privilege %http://tizen.org/privilege/ime
1504 * @remarks The ime_option_window_destroyed_cb() callback function is called to destroy the option window.
1506 * @param[in] callback_func @c option_window_destroyed event callback function
1507 * @param[in] user_data User data to be passed to the callback function
1509 * @return 0 on success, otherwise a negative error value
1510 * @retval #IME_ERROR_NONE No error
1511 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1512 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1513 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1515 * @post The ime_run() function should be called to start the IME application's main loop.
1517 * @see ime_option_window_destroyed_cb()
1520 int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb callback_func, void *user_data);
1523 * @brief Sends a key event to the associated text input UI control.
1525 * @details This function sends key down or up event with key mask to the client application.
1526 * If @a forward_key is @c true, this key event goes to the edit field directly. And if @a forward_key
1527 * is @c false, the ime_process_key_event_cb() callback function receives the key event before the edit field.
1529 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1533 * @privilege %http://tizen.org/privilege/ime
1535 * @param[in] keycode The key code to be sent
1536 * @param[in] keymask The modifier key mask
1537 * @param[in] forward_key The flag to send the key event directly to the edit field
1539 * @return 0 on success, otherwise a negative error value
1540 * @retval #IME_ERROR_NONE No error
1541 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1542 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1544 * @post If @a forward_key is @c false, the ime_process_key_event_cb() callback function can compose the text with the key events.
1546 * @see ime_key_code_e
1547 * @see ime_key_mask_e
1548 * @see ime_process_key_event_cb()
1550 int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key);
1553 * @brief Sends the text to the associated text input UI control.
1555 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1559 * @privilege %http://tizen.org/privilege/ime
1561 * @param[in] str The UTF-8 string to be committed
1563 * @return 0 on success, otherwise a negative error value
1564 * @retval #IME_ERROR_NONE No error
1565 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1566 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1568 * @see ime_show_preedit_string()
1569 * @see ime_hide_preedit_string()
1570 * @see ime_update_preedit_string()
1572 int ime_commit_string(const char *str);
1575 * @brief Requests to show preedit string.
1577 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1581 * @privilege %http://tizen.org/privilege/ime
1583 * @return 0 on success, otherwise a negative error value
1584 * @retval #IME_ERROR_NONE No error
1585 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1586 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1588 * @see ime_commit_string()
1589 * @see ime_hide_preedit_string()
1590 * @see ime_update_preedit_string()
1592 int ime_show_preedit_string(void);
1595 * @brief Requests to hide preedit string.
1597 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1601 * @privilege %http://tizen.org/privilege/ime
1603 * @return 0 on success, otherwise a negative error value
1604 * @retval #IME_ERROR_NONE No error
1605 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1606 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1608 * @see ime_commit_string()
1609 * @see ime_show_preedit_string()
1610 * @see ime_update_preedit_string()
1612 int ime_hide_preedit_string(void);
1615 * @brief Updates a new preedit string.
1617 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1621 * @privilege %http://tizen.org/privilege/ime
1623 * @param[in] str The UTF-8 string to be updated in preedit
1624 * @param[in] attrs The Eina_List which has #ime_preedit_attribute lists; @a str can be composed of multiple
1625 * string attributes: underline, highlight color and reversal color. The @a attrs will be released internally
1626 * on success and it can be NULL if no attributes to set
1628 * @return 0 on success, otherwise a negative error value
1629 * @retval #IME_ERROR_NONE No error
1630 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1631 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1632 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1634 * @post This function is supposed to be followed by the ime_show_preedit_string() function.
1636 * @see ime_preedit_attribute
1637 * @see ime_commit_string()
1638 * @see ime_show_preedit_string()
1639 * @see ime_hide_preedit_string()
1644 Eina_List *list = NULL;
1646 ime_preedit_attribute *attr = calloc(1, sizeof(ime_preedit_attribute));
1649 attr->type = IME_ATTR_FONTSTYLE;
1650 attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
1651 list = eina_list_append(list, attr);
1653 attr = calloc(1, sizeof(ime_preedit_attribute));
1656 attr->type = IME_ATTR_FONTSTYLE;
1657 attr->value = IME_ATTR_FONTSTYLE_HIGHLIGHT;
1658 list = eina_list_append(list, attr);
1660 attr = calloc(1, sizeof(ime_preedit_attribute));
1663 attr->type = IME_ATTR_FONTSTYLE;
1664 attr->value = IME_ATTR_FONTSTYLE_REVERSAL;
1665 list = eina_list_append(list, attr);
1667 ret = ime_update_preedit_string("abcd", list);
1668 if (ret != IME_ERROR_NONE) {
1669 EINA_LIST_FREE(list, attr)
1675 int ime_update_preedit_string(const char *str, Eina_List *attrs);
1678 * @brief Requests the surrounding text from the position of the cursor, asynchronously.
1680 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1684 * @privilege %http://tizen.org/privilege/ime
1686 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1687 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1689 * @return 0 on success, otherwise a negative error value
1690 * @retval #IME_ERROR_NONE No error
1691 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1692 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1693 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1695 * @pre The ime_surrounding_text_updated_cb() callback function MUST be set by ime_event_set_surrounding_text_updated_cb().
1697 * @post The requested surrounding text can be received using the ime_surrounding_text_updated_cb() callback function.
1699 * @see ime_delete_surrounding_text()
1700 * @see ime_event_set_surrounding_text_updated_cb()
1701 * @see ime_surrounding_text_updated_cb()
1703 int ime_request_surrounding_text(int maxlen_before, int maxlen_after);
1706 * @brief Requests to delete surrounding text.
1708 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1712 * @privilege %http://tizen.org/privilege/ime
1714 * @param[in] offset The offset value from the cursor position
1715 * @param[in] len The length of the text to delete
1717 * @return 0 on success, otherwise a negative error value
1718 * @retval #IME_ERROR_NONE No error
1719 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1720 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1721 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1723 * @see ime_request_surrounding_text()
1725 int ime_delete_surrounding_text(int offset, int len);
1728 * @brief Gets the surrounding text from the position of the cursor, synchronously.
1734 * @privilege %http://tizen.org/privilege/ime
1736 * @remarks @a text must be released using free().
1738 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1739 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1740 * @param[out] text The surrounding text
1741 * @param[out] cursor_pos The cursor position
1743 * @return 0 on success, otherwise a negative error value
1744 * @retval #IME_ERROR_NONE No error
1745 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1746 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1747 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1748 * @retval #IME_ERROR_OUT_OF_MEMORY Failed to obtain text due to out of memory
1750 * @see ime_delete_surrounding_text()
1752 int ime_get_surrounding_text(int maxlen_before, int maxlen_after, char **text, int *cursor_pos);
1755 * @brief Requests to set selection.
1761 * @privilege %http://tizen.org/privilege/ime
1763 * @param[in] start The start cursor position in text (in characters not bytes)
1764 * @param[in] end The end cursor position in text (in characters not bytes)
1766 * @return 0 on success, otherwise a negative error value
1767 * @retval #IME_ERROR_NONE No error
1768 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1769 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1770 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1772 int ime_set_selection(int start, int end);
1775 * @brief Gets the selected text synchronously.
1777 * @details If multi-line text is selected, the result will contain '\n' for each newline character.
1778 * And if the selected text is empty, the result will be an empty string.
1784 * @privilege %http://tizen.org/privilege/ime
1786 * @remarks @a text must be released using free().
1788 * @param[out] text The selected text
1790 * @return 0 on success, otherwise a negative error value
1791 * @retval #IME_ERROR_NONE No error
1792 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1793 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1794 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1796 int ime_get_selected_text(char **text);
1799 * @brief This API returns the pointer of input panel main window.
1801 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1805 * @privilege %http://tizen.org/privilege/ime
1807 * @remarks The specific error code can be obtained using the get_last_result() method if this function returns NULL.
1809 * @return The input panel main window object on success, otherwise NULL
1811 * @exception #IME_ERROR_NONE Successful
1812 * @exception #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1813 * @exception #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1814 * @exception #IME_ERROR_OPERATION_FAILED Operation failed
1816 * @see get_last_result()
1817 * @see ime_create_cb()
1818 * @see ime_terminate_cb()
1819 * @see ime_show_cb()
1820 * @see ime_hide_cb()
1822 Evas_Object* ime_get_main_window(void);
1825 * @brief This API updates the input panel window's size information.
1827 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1831 * @privilege %http://tizen.org/privilege/ime
1833 * @param[in] portrait_width The width in portrait mode
1834 * @param[in] portrait_height The height in portrait mode
1835 * @param[in] landscape_width The width in landscape mode
1836 * @param[in] landscape_height The height in landscape mode
1838 * @return 0 on success, otherwise a negative error value
1839 * @retval #IME_ERROR_NONE No error
1840 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1841 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1843 * @see ime_create_cb()
1845 int ime_set_size(int portrait_width, int portrait_height, int landscape_width, int landscape_height);
1848 * @brief Requests to create an option window from the input panel.
1850 * @details The input panel can call this function to open the option window. This
1851 * function calls ime_option_window_created_cb() callback function with
1852 * #IME_OPTION_WINDOW_TYPE_KEYBOARD parameter.
1854 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1858 * @privilege %http://tizen.org/privilege/ime
1860 * @return 0 on success, otherwise a negative error value
1861 * @retval #IME_ERROR_NONE No error
1862 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1863 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1864 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1865 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1867 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1868 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1869 * ime_event_set_option_window_destroyed_cb() respectively.
1871 * @post This function calls ime_option_window_created_cb() callback function to
1872 * create the option window. And ime_destroy_option_window() function can be called
1873 * to close the option window.
1875 * @see ime_event_set_option_window_created_cb()
1876 * @see ime_option_window_created_cb()
1877 * @see ime_destroy_option_window()
1879 int ime_create_option_window(void);
1882 * @brief Requests to destroy an option window.
1884 * @details The input panel can call this function to close the option window which
1885 * is created from either the input panel or Settings application.
1887 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1891 * @privilege %http://tizen.org/privilege/ime
1893 * @param[in] window The option window to destroy
1895 * @return 0 on success, otherwise a negative error value
1896 * @retval #IME_ERROR_NONE No error
1897 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1898 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1899 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1900 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1902 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1903 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1904 * ime_event_set_option_window_destroyed_cb() respectively.
1906 * @post This function calls ime_option_window_destroyed_cb() callback function
1907 * to destroy the option window.
1909 * @see ime_event_set_option_window_destroyed_cb()
1910 * @see ime_option_window_destroyed_cb()
1911 * @see ime_create_option_window()
1913 int ime_destroy_option_window(Evas_Object *window);
1916 * @brief Gets the layout information from the given input context.
1918 * @details Each edit field has various attributes for input panel. This function can be
1919 * called to get the layout information in ime_show_cb() callback function.
1921 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1925 * @privilege %http://tizen.org/privilege/ime
1927 * @param[in] context The input context information of an associated text input UI control
1928 * @param[out] layout Layout information
1930 * @return 0 on success, otherwise a negative error value
1931 * @retval #IME_ERROR_NONE No error
1932 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1933 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1934 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1936 * @post Input panel UI should be drawn or operated by this information accordingly.
1938 * @see ime_show_cb()
1939 * @see ime_layout_set_cb()
1941 int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout);
1944 * @brief Gets the layout variation information from the given input context.
1946 * @details Each edit field has various attributes for input panel. This function can be
1947 * called to get the layout variation information in ime_show_cb() callback function.
1949 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1953 * @privilege %http://tizen.org/privilege/ime
1955 * @param[in] context The input context information of an associated text input UI control
1956 * @param[out] layout_variation Layout variation information
1958 * @return 0 on success, otherwise a negative error value
1959 * @retval #IME_ERROR_NONE No error
1960 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1961 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1962 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1964 * @post Input panel UI should be drawn or operated by this information accordingly.
1966 * @see ime_show_cb()
1967 * @see ime_layout_variation_e
1969 int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation);
1972 * @brief Gets the cursor position information from the given input context.
1974 * @details Each edit field has various attributes for input panel. This function can be
1975 * called to get the cursor position information in ime_show_cb() callback function.
1977 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1981 * @privilege %http://tizen.org/privilege/ime
1983 * @param[in] context The input context information of an associated text input UI control
1984 * @param[out] cursor_pos Cursor position information
1986 * @return 0 on success, otherwise a negative error value
1987 * @retval #IME_ERROR_NONE No error
1988 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1989 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1990 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1992 * @post Input panel UI should be drawn or operated by this information accordingly.
1994 * @see ime_show_cb()
1995 * @see ime_cursor_position_updated_cb()
1997 int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos);
2000 * @brief Gets the autocapital type information from the given input context.
2002 * @details Each edit field has various attributes for input panel. This function can be
2003 * called to get the autocapital type information in ime_show_cb() callback function.
2005 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2009 * @privilege %http://tizen.org/privilege/ime
2011 * @param[in] context The input context information of an associated text input UI control
2012 * @param[out] autocapital_type Autocapital type information
2014 * @return 0 on success, otherwise a negative error value
2015 * @retval #IME_ERROR_NONE No error
2016 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2017 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2018 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2020 * @post Input panel UI should be drawn or operated by this information accordingly.
2022 * @see ime_show_cb()
2024 int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type);
2027 * @brief Gets the @c Return key label type information from the given input context.
2029 * @details Each edit field has various attributes for input panel. This function can be
2030 * called to get the @c Return key label type information in ime_show_cb() callback function.
2032 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2036 * @privilege %http://tizen.org/privilege/ime
2038 * @param[in] context The input context information of an associated text input UI control
2039 * @param[out] return_key_type The @c Return key label type information
2041 * @return 0 on success, otherwise a negative error value
2042 * @retval #IME_ERROR_NONE No error
2043 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2044 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2045 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2047 * @post Input panel UI should be drawn or operated by this information accordingly.
2049 * @see ime_show_cb()
2050 * @see ime_return_key_type_set_cb()
2052 int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type);
2055 * @brief Gets the @c Return key state information from the given input context.
2057 * @details Each edit field has various attributes for input panel. This function can be
2058 * called to get the @c Return key state information in ime_show_cb() callback function.
2060 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2064 * @privilege %http://tizen.org/privilege/ime
2066 * @param[in] context The input context information of an associated text input UI control
2067 * @param[out] return_key_state The @c Return key state information \n @c true to enable @c Return key
2068 * button, @c false to disable @c Return key button
2070 * @return 0 on success, otherwise a negative error value
2071 * @retval #IME_ERROR_NONE No error
2072 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2073 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2074 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2076 * @post Input panel UI should be drawn or operated by this information accordingly.
2078 * @see ime_show_cb()
2079 * @see ime_return_key_state_set_cb()
2081 int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state);
2084 * @brief Gets the prediction mode information from the given input context.
2086 * @details Each edit field has various attributes for input panel. This function can be
2087 * called to get the prediction mode information in ime_show_cb() callback function.
2089 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2093 * @privilege %http://tizen.org/privilege/ime
2095 * @param[in] context The input context information of an associated text input UI control
2096 * @param[out] prediction_mode Prediction mode information \n @c true to allow the predictive
2097 * text feature if available, @c false to disable the predictive text feature
2099 * @return 0 on success, otherwise a negative error value
2100 * @retval #IME_ERROR_NONE No error
2101 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2102 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2103 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2105 * @post Input panel UI should be drawn or operated by this information accordingly.
2107 * @see ime_show_cb()
2109 int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode);
2112 * @brief Gets the password mode information from the given input context.
2114 * @details Each edit field has various attributes for input panel. This function can be
2115 * called to get the password mode information in ime_show_cb() callback function.
2117 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2121 * @privilege %http://tizen.org/privilege/ime
2123 * @remarks If @a password_mode is @c true, the input panel is advised not to support the predictive text.
2125 * @param[in] context The input context information of an associated text input UI control
2126 * @param[out] password_mode Password mode information \n @c true to indicate that a password being inputted,
2127 * @c false to indicate non-password edit field.
2129 * @return 0 on success, otherwise a negative error value
2130 * @retval #IME_ERROR_NONE No error
2131 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2132 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2133 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2135 * @post Input panel UI should be drawn or operated by this information accordingly.
2137 * @see ime_show_cb()
2139 int ime_context_get_password_mode(ime_context_h context, bool *password_mode);
2142 * @brief Gets the input hint information from the given input context.
2144 * @details Each edit field has various attributes for input panel. This function can be
2145 * called to get the input hint information in ime_show_cb() callback function.
2147 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2151 * @privilege %http://tizen.org/privilege/ime
2153 * @remarks @a input_hint is a bit-wise value which recommends the input panel provide
2154 * an auto completion and so on if it is capable of supporting such features.
2156 * @param[in] context The input context information of an associated text input UI control
2157 * @param[out] input_hint Input hint information
2159 * @return 0 on success, otherwise a negative error value
2160 * @retval #IME_ERROR_NONE No error
2161 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2162 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2163 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2165 * @post Input panel UI should be drawn or operated by this information accordingly.
2167 * @see ime_show_cb()
2169 int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint);
2172 * @brief Gets the text bidirectional information from the given input context.
2174 * @details Each edit field has various attributes for input panel. This function can be
2175 * called to get the bidirectional information in ime_show_cb() callback function.
2177 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2181 * @privilege %http://tizen.org/privilege/ime
2183 * @param[in] context The input context information of an associated text input UI control
2184 * @param[out] bidi Text bidirectional information
2186 * @return 0 on success, otherwise a negative error value
2187 * @retval #IME_ERROR_NONE No error
2188 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2189 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2190 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2192 * @post Input panel UI should be drawn or operated by this information accordingly.
2194 * @see ime_show_cb()
2196 int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi);
2199 * @brief Gets the preferred language information from the given input context.
2201 * @details Each edit field has various attributes for input panel. This function can be
2202 * called to get the preferred language information in ime_show_cb() callback function.
2204 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2208 * @privilege %http://tizen.org/privilege/ime
2210 * @param[in] context The input context information of an associated text input UI control
2211 * @param[out] language Preferred language information
2213 * @return 0 on success, otherwise a negative error value
2214 * @retval #IME_ERROR_NONE No error
2215 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2216 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2217 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2219 * @post Input panel UI should be drawn or operated by this information accordingly.
2221 * @see ime_show_cb()
2223 int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language);
2226 * @brief Gets the device name of the key event.
2228 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2232 * @privilege %http://tizen.org/privilege/ime
2234 * @remarks @a dev_name must be released using free().
2236 * @param[in] dev_info The device information from the key event
2237 * @param[out] dev_name The name of key input device. This can be an empty string if the device name is not available
2239 * @return 0 on success, otherwise a negative error value
2240 * @retval #IME_ERROR_NONE No error
2241 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2242 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2243 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2245 * @see ime_process_key_event_cb()
2246 * @see ime_device_info_get_class()
2247 * @see ime_device_info_get_subclass()
2249 int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name);
2252 * @brief Gets the device class of the key event.
2254 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2258 * @privilege %http://tizen.org/privilege/ime
2260 * @param[in] dev_info The device information from the key event
2261 * @param[out] dev_class The class of key input device. This can be #ECORE_IMF_DEVICE_CLASS_NONE if the device class is not available
2263 * @return 0 on success, otherwise a negative error value
2264 * @retval #IME_ERROR_NONE No error
2265 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2266 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2267 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2269 * @see ime_process_key_event_cb()
2270 * @see ime_device_info_get_name()
2271 * @see ime_device_info_get_subclass()
2273 int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class);
2275 * @brief Gets the device subclass of the key event.
2277 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2281 * @privilege %http://tizen.org/privilege/ime
2283 * @param[in] dev_info The device information from the key event
2284 * @param[out] dev_subclass The subclass of key input device. This can be #ECORE_IMF_DEVICE_SUBCLASS_NONE if the device subclass is not available
2286 * @return 0 on success, otherwise a negative error value
2287 * @retval #IME_ERROR_NONE No error
2288 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2289 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2290 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2292 * @see ime_process_key_event_cb()
2293 * @see ime_device_info_get_name()
2294 * @see ime_device_info_get_class()
2296 int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass);
2299 * @brief Sets prediction hint event callback function.
2305 * @privilege %http://tizen.org/privilege/ime
2307 * @remarks The ime_prediction_hint_set_cb() callback function is called to set the prediction
2308 * hint string to deliver to the input panel.
2310 * @param[in] callback_func The prediction hint event callback function
2311 * @param[in] user_data User data to be passed to the callback function
2313 * @return 0 on success, otherwise a negative error value
2314 * @retval #IME_ERROR_NONE No error
2315 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2316 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2318 * @post The ime_run() function should be called to start the IME application's main loop.
2320 * @see ime_prediction_hint_set_cb()
2323 int ime_event_set_prediction_hint_set_cb(ime_prediction_hint_set_cb callback_func, void *user_data);
2326 * @brief Sets MIME type event callback function.
2332 * @privilege %http://tizen.org/privilege/ime
2334 * @remarks The ime_mime_type_set_request_cb() callback function is called when an associated text input
2335 * UI control requests the text entry to set the MIME type.
2337 * @param[in] callback_func MIME type event callback function
2338 * @param[in] user_data User data to be passed to the callback function
2340 * @return 0 on success, otherwise a negative error value
2341 * @retval #IME_ERROR_NONE No error
2342 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2343 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2345 * @post The ime_run() function should be called to start the IME application's main loop.
2347 * @see ime_mime_type_set_request_cb()
2350 int ime_event_set_mime_type_set_request_cb(ime_mime_type_set_request_cb callback_func, void *user_data);
2353 * @brief Sends a private command to the associated text input UI control.
2355 * @details This can be used by IME to deliver specific data to an application.
2356 * The data format MUST be negotiated by both application and IME.
2362 * @privilege %http://tizen.org/privilege/ime
2364 * @param[in] command The UTF-8 string to be sent
2366 * @return 0 on success, otherwise a negative error value
2367 * @retval #IME_ERROR_NONE No error
2368 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2369 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2370 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2372 int ime_send_private_command(const char *command);
2375 * @brief Commits contents such as image to the associated text input UI control.
2381 * @privilege %http://tizen.org/privilege/ime
2383 * @param[in] content The content URI to be sent
2384 * @param[in] description The content description
2385 * @param[in] mime_type The MIME type received from the ime_mime_type_set_request_cb()
2387 * @return 0 on success, otherwise a negative error value
2388 * @retval #IME_ERROR_NONE No error
2389 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2390 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2391 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2393 * @see ime_mime_type_set_request_cb()
2394 * @see ime_event_set_mime_type_set_request_cb()
2396 int ime_commit_content(const char *content, const char *description, const char *mime_type);
2399 * @brief Sets the floating mode or not.
2405 * @privilege %http://tizen.org/privilege/ime
2407 * @param[in] floating_mode @c true - floating mode on, @c false - floating mode off
2409 * @return 0 on success, otherwise a negative error value
2410 * @retval #IME_ERROR_NONE No error
2411 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2412 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2414 * @see ime_set_floating_drag_start()
2415 * @see ime_set_floating_drag_end()
2417 int ime_set_floating_mode(bool floating_mode);
2420 * @brief Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed.
2426 * @privilege %http://tizen.org/privilege/ime
2428 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2430 * @return 0 on success, otherwise a negative error value
2431 * @retval #IME_ERROR_NONE No error
2432 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2433 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2435 * @pre The floating mode was turned on with ime_set_floating_mode().
2437 * @see ime_set_floating_mode()
2438 * @see ime_set_floating_drag_end()
2440 int ime_set_floating_drag_start(void);
2443 * @brief Disallows the movement of the floating input panel window with the mouse pointer when the mouse is pressed.
2445 * @details This function must be called after invoking ime_set_floating_drag_start(). Otherwise the call is ignored.
2451 * @privilege %http://tizen.org/privilege/ime
2453 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2455 * @return 0 on success, otherwise a negative error value
2456 * @retval #IME_ERROR_NONE No error
2457 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2458 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2460 * @pre The floating mode was turned on with ime_set_floating_mode().
2461 * @pre ime_set_floating_drag_start() was called before.
2463 * @see ime_set_floating_mode()
2464 * @see ime_set_floating_drag_start()
2466 int ime_set_floating_drag_end(void);
2469 * @brief Sets prediction hint data event callback function.
2475 * @privilege %http://tizen.org/privilege/ime
2477 * @remarks The ime_prediction_hint_data_set_cb() callback function is called to provide the prediction
2478 * hint key and value which can be delivered to the input panel.
2480 * @param[in] callback_func The prediction hint event callback function
2481 * @param[in] user_data User data to be passed to the callback function
2483 * @return 0 on success, otherwise a negative error value
2484 * @retval #IME_ERROR_NONE No error
2485 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2486 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2488 * @post The ime_run() function should be called to start the IME application's main loop.
2490 * @see ime_prediction_hint_data_set_cb()
2493 int ime_event_set_prediction_hint_data_set_cb(ime_prediction_hint_data_set_cb callback_func, void *user_data);
2496 * @brief Sends the request to hide IME.
2502 * @privilege %http://tizen.org/privilege/ime
2504 * @return 0 on success, otherwise a negative error value
2505 * @retval #IME_ERROR_NONE No error
2506 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2507 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2509 int ime_request_hide(void);
2512 * @brief Updates the state of input panel event.
2518 * @privilege %http://tizen.org/privilege/ime
2520 * @param[in] type The input panel event type
2521 * @param[in] value The value of event type
2523 * @return 0 on success, otherwise a negative error value
2524 * @retval #IME_ERROR_NONE No error
2525 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2526 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2527 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2529 * @see ime_event_type_e
2531 int ime_update_input_panel_event(ime_event_type_e type, unsigned int value);
2534 * @brief Sets the candidate visibility state.
2540 * @privilege %http://tizen.org/privilege/ime
2542 * @param[in] visible @c true - show candidate string, @c false - hide candidate string
2544 * @return 0 on success, otherwise a negative error value
2545 * @retval #IME_ERROR_NONE No error
2546 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2547 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
2549 int ime_set_candidate_visibility_state(bool visible);
2559 #endif /* __TIZEN_UIX_INPUTMETHOD_H__ */