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 is not 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.
240 * @a context should not be released.
242 * @param[in] context_id The input context identification value of an associated text input UI control
243 * @param[in] context The input context information handle
244 * @param[in] user_data User data to be passed from the callback registration function
247 * @see ime_get_main_window()
248 * @see ime_context_get_layout()
249 * @see ime_context_get_layout_variation()
250 * @see ime_context_get_cursor_position()
251 * @see ime_context_get_autocapital_type()
252 * @see ime_context_get_return_key_type()
253 * @see ime_context_get_return_key_state()
254 * @see ime_context_get_prediction_mode()
255 * @see ime_context_get_password_mode()
256 * @see ime_context_get_input_hint()
257 * @see ime_context_get_bidi_direction()
258 * @see ime_context_get_language()
260 typedef void (*ime_show_cb)(int context_id, ime_context_h context, void *user_data);
263 * @brief Called when an associated text input UI control requests the input panel to hide itself.
265 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
269 * @privilege %http://tizen.org/privilege/ime
271 * @remarks This callback function is mandatory and must be registered using ime_run(). The
272 * ime_get_main_window() can be used to get the created input panel window.
274 * @param[in] context_id The input context identification value of an associated text input UI control
275 * @param[in] user_data User data to be passed from the callback registration function
278 * @see ime_get_main_window()
280 typedef void (*ime_hide_cb)(int context_id, void *user_data);
283 * @brief Called when an associated text input UI control has focus.
285 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
289 * @privilege %http://tizen.org/privilege/ime
291 * @param[in] context_id The input context identification value of an associated text input UI control
292 * @param[in] user_data User data to be passed from the callback registration function
294 * @pre The callback can be registered using ime_event_set_focus_in_cb() function.
296 * @see ime_event_set_focus_in_cb()
298 typedef void (*ime_focus_in_cb)(int context_id, void *user_data);
301 * @brief Called when an associated text input UI control loses focus.
303 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
307 * @privilege %http://tizen.org/privilege/ime
309 * @param[in] context_id The input context identification value of an associated text input UI control
310 * @param[in] user_data User data to be passed from the callback registration function
312 * @pre The callback can be registered using ime_event_set_focus_out_cb() function.
314 * @see ime_event_set_focus_out_cb()
316 typedef void (*ime_focus_out_cb)(int context_id, void *user_data);
319 * @brief Called when an associated text input UI control responds to a request with the surrounding text.
321 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
325 * @privilege %http://tizen.org/privilege/ime
327 * @remarks The ime_request_surrounding_text() must be called to invoke this callback function, asynchronously.
328 * @remarks @a text can be used only in the callback. To use outside, make a copy.
330 * @param[in] context_id The input context identification value of an associated text input UI control
331 * @param[in] text The UTF-8 string requested
332 * @param[in] cursor_pos The cursor position
333 * @param[in] user_data User data to be passed from the callback registration function
335 * @pre The callback can be registered using ime_event_set_surrounding_text_updated_cb() function.
337 * @see ime_event_set_surrounding_text_updated_cb()
338 * @see ime_request_surrounding_text()
340 typedef void (*ime_surrounding_text_updated_cb)(int context_id, const char *text, int cursor_pos, void *user_data);
343 * @brief Called to reset the input context of an associated text input UI control.
345 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
349 * @privilege %http://tizen.org/privilege/ime
351 * @param[in] user_data User data to be passed from the callback registration function
353 * @pre The callback can be registered using ime_event_set_input_context_reset_cb() function.
355 * @see ime_event_set_input_context_reset_cb()
357 typedef void (*ime_input_context_reset_cb)(void *user_data);
360 * @brief Called when the position of the cursor in an associated text input UI control changes.
362 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
366 * @privilege %http://tizen.org/privilege/ime
368 * @param[in] cursor_pos The cursor position
369 * @param[in] user_data User data to be passed from the callback registration function
371 * @pre The callback can be registered using ime_event_set_cursor_position_updated_cb() function.
373 * @see ime_event_set_cursor_position_updated_cb()
375 typedef void (*ime_cursor_position_updated_cb)(int cursor_pos, void *user_data);
378 * @brief Called when an associated text input UI control requests the language from the input panel.
380 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
384 * @privilege %http://tizen.org/privilege/ime
386 * @remarks The allocated @a lang_code will be released internally.
388 * @param[in] user_data User data to be passed from the callback registration function
389 * @param[out] lang_code Input panel's current input language code (e.g., "en_US")
391 * @pre The callback can be registered using ime_event_set_language_requested_cb() function.
393 * @see ime_event_set_language_requested_cb()
395 typedef void (*ime_language_requested_cb)(void *user_data, char **lang_code);
398 * @brief Called to set the preferred language to the input panel.
400 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
404 * @privilege %http://tizen.org/privilege/ime
406 * @remarks @a language information is already set to the input panel when it is shown
407 * through #ime_context_h. This callback function will be only called when the client
408 * application changes the edit field's language attribute after the input panel is shown.
410 * @param[in] language The preferred language that the client application wants
411 * @param[in] user_data User data to be passed from the callback registration function
413 * @pre The callback can be registered using ime_event_set_language_set_cb() function.
415 * @see ime_event_set_language_set_cb()
417 typedef void (*ime_language_set_cb)(Ecore_IMF_Input_Panel_Lang language, void *user_data);
420 * @brief Called to set the application specific data to deliver to the input panel.
422 * @details This function is used by the applications to deliver the specific data to the input panel.
423 * The data format MUST be negotiated by both application and input panel.
425 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
429 * @privilege %http://tizen.org/privilege/ime
431 * @remarks @a data should not be released.
433 * @param[in] data The specific data to be set to the input panel
434 * @param[in] data_length The length of data, in bytes, to send to the input panel
435 * @param[in] user_data User data to be passed from the callback registration function
437 * @pre The callback can be registered using ime_event_set_imdata_set_cb() function.
439 * @see ime_event_set_imdata_set_cb()
441 typedef void (*ime_imdata_set_cb)(void *data, unsigned int data_length, void *user_data);
444 * @brief Called when an associated text input UI control requests the application specific data from the input panel.
446 * @details This function is used by the applications to request the specific data from the input panel.
447 * The data format MUST be negotiated by both application and input panel.
449 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
453 * @privilege %http://tizen.org/privilege/ime
455 * @remarks The allocated @a data and @a data_length will be released internally.
457 * @param[in] user_data User data to be passed from the callback registration function
458 * @param[out] data Input panel's data to be set to the application
459 * @param[out] data_length The length of data, in bytes, to send to the application
461 * @pre The callback can be registered using ime_event_set_imdata_requested_cb() function.
463 * @see ime_event_set_imdata_requested_cb()
465 typedef void (*ime_imdata_requested_cb)(void *user_data, void **data, unsigned int *data_length);
468 * @brief Called when an associated text input UI control requests the input panel to set its layout.
470 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
474 * @privilege %http://tizen.org/privilege/ime
476 * @remarks @a layout information is already set to the input panel when it is shown
477 * through #ime_context_h. This callback function will be only called when the client
478 * application changes the edit field's layout attribute after the input panel is shown.
480 * @param[in] layout The input panel layout
481 * @param[in] user_data User data to be passed from the callback registration function
483 * @pre The callback can be registered using ime_event_set_layout_set_cb() function.
485 * @see ime_event_set_layout_set_cb()
487 typedef void (*ime_layout_set_cb)(Ecore_IMF_Input_Panel_Layout layout, void *user_data);
490 * @brief Called when an associated text input UI control requests the input panel to set the @c Return key label.
491 * The input panel can show text or image on the @c Return button according to the @c Return key action.
493 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
497 * @privilege %http://tizen.org/privilege/ime
499 * @remarks @a type information is already set to the input panel when it is shown
500 * through #ime_context_h. This callback function will be only called when the client
501 * application changes the edit field's @c Return key type attribute after the input panel
504 * @param[in] type The type of @c Return key on the input panel
505 * @param[in] user_data User data to be passed from the callback registration function
507 * @pre The callback can be registered using ime_event_set_return_key_type_set_cb() function.
509 * @see ime_event_set_return_key_type_set_cb()
511 typedef void (*ime_return_key_type_set_cb)(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data);
514 * @brief Called when an associated text input UI control requests the input panel to enable
515 * or disable the @c Return key state.
517 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
521 * @privilege %http://tizen.org/privilege/ime
523 * @remarks @a disabled information is already set to the input panel when it is shown
524 * through #ime_context_h. This callback function will be only called when the client
525 * application changes the edit field's @c Return key disable attribute after the input panel
528 * @param[in] disabled The Boolean state to disable @c Return key. The @c Return key is enabled by default
529 * @param[in] user_data User data to be passed from the callback registration function
531 * @pre The callback can be registered using ime_event_set_return_key_state_set_cb() function.
533 * @see ime_event_set_return_key_state_set_cb()
535 typedef void (*ime_return_key_state_set_cb)(bool disabled, void *user_data);
538 * @brief Called when an associated text input UI control requests the position and size from the input panel.
540 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
544 * @privilege %http://tizen.org/privilege/ime
546 * @remarks @a x, @a y, @a w, and @a h should not be released.
548 * @param[in] user_data User data to be passed from the callback registration function
549 * @param[out] x The x position in screen
550 * @param[out] y The y position in screen
551 * @param[out] w The window width
552 * @param[out] h The window height
554 * @pre The callback can be registered using ime_event_set_geometry_requested_cb() function.
556 * @see ime_event_set_geometry_requested_cb()
558 typedef void (*ime_geometry_requested_cb)(void *user_data, int *x, int *y, int *w, int *h);
561 * @brief Called when a key event is received from external devices or ime_send_key_event().
563 * @details This function processes the key event before an associated text input UI control does.
565 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
569 * @privilege %http://tizen.org/privilege/ime
571 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
572 * @a dev_info should not be released by the application. The platform manages the handle; the handle is released when ime_process_key_event_cb() exits.
574 * @param[in] key_code The key code to be sent
575 * @param[in] key_mask The modifier key mask
576 * @param[in] dev_info The device information handle
577 * @param[in] user_data User data to be passed from the callback registration function
579 * @return @c true if the event was processed, otherwise the event was not processed and was forwarded to the client application.
581 * @pre The callback should be registered using ime_event_set_process_key_event_cb() function.
583 * @see ime_event_set_process_key_event_cb()
584 * @see ime_device_info_get_name()
585 * @see ime_device_info_get_class()
586 * @see ime_device_info_get_subclass()
587 * @see ime_send_key_event()
588 * @see ime_commit_string()
589 * @see ime_show_preedit_string()
590 * @see ime_hide_preedit_string()
591 * @see ime_update_preedit_string()
593 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);
596 * @brief Called when a key event is received from external devices or ime_send_key_event().
598 * @details This function processes a key event with a keycode before an associated UI control for the text input deals with the key event.
604 * @privilege %http://tizen.org/privilege/ime
606 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
607 * @a dev_info should not be released by the application. The platform manages the handle; the handle is released when ime_process_key_event_with_keycode_cb() exits.
609 * @param[in] key_code The X11 key code to be sent
610 * @param[in] key_sym The key symbol to be sent
611 * @param[in] key_mask The modifier key mask
612 * @param[in] dev_info The device information handle
613 * @param[in] user_data User data to be passed from the callback registration function
615 * @return @c true if the event was processed, otherwise @c false. When @c false returns, the event was not processed and was forwarded to the client application.
617 * @pre The callback should be registered using ime_event_set_process_key_event_with_keycode_cb() function.
619 * @see ime_event_set_process_key_event_with_keycode_cb()
620 * @see ime_device_info_get_name()
621 * @see ime_device_info_get_class()
622 * @see ime_device_info_get_subclass()
623 * @see ime_send_key_event()
624 * @see ime_commit_string()
625 * @see ime_show_preedit_string()
626 * @see ime_hide_preedit_string()
627 * @see ime_update_preedit_string()
629 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);
632 * @brief Called when the system display language is changed.
634 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
638 * @privilege %http://tizen.org/privilege/ime
640 * @param[in] language The language code
641 * @param[in] user_data User data to be passed from the callback registration function
643 * @pre The callback can be registered using ime_event_set_display_language_changed_cb() function.
645 * @see ime_event_set_display_language_changed_cb()
647 typedef void (*ime_display_language_changed_cb)(const char *language, void *user_data);
650 * @brief Called when the device is rotated.
652 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
656 * @privilege %http://tizen.org/privilege/ime
658 * @param[in] degree The rotation degree
659 * @param[in] user_data User data to be passed from the callback registration function
661 * @pre The callback can be registered using ime_event_set_rotation_degree_changed_cb() function.
663 * @see ime_event_set_rotation_degree_changed_cb()
665 typedef void (*ime_rotation_degree_changed_cb)(int degree, void *user_data);
668 * @brief Called when Accessibility in Settings application is on or off.
670 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
674 * @privilege %http://tizen.org/privilege/ime
676 * @param[in] state Accessibility option state
677 * @param[in] user_data User data to be passed from the callback registration function
679 * @pre The callback can be registered using ime_event_set_accessibility_state_changed_cb() function.
681 * @see ime_event_set_accessibility_state_changed_cb()
683 typedef void (*ime_accessibility_state_changed_cb)(bool state, void *user_data);
686 * @brief Called to create the option window.
688 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
692 * @privilege %http://tizen.org/privilege/ime
694 * @remarks if Input panel requests to open the option window, @a type will be #IME_OPTION_WINDOW_TYPE_KEYBOARD.
695 * And if Settings application requests to open it, @a type will be #IME_OPTION_WINDOW_TYPE_SETTING_APPLICATION.
696 * The @a window should not be released. The @a window can be used until ime_option_window_destroyed_cb() will be called.
698 * @param[in] window The created window object
699 * @param[in] type The type of option window
700 * @param[in] user_data User data to be passed from the callback registration function
702 * @pre The callback can be registered using ime_event_set_option_window_created_cb() function. The
703 * ime_create_option_window() calls this callback function or Settings application can call this callback function.
705 * @see ime_event_set_option_window_created_cb()
706 * @see ime_create_option_window()
708 typedef void (*ime_option_window_created_cb)(Evas_Object *window, ime_option_window_type_e type, void *user_data);
711 * @brief Called to destroy the option window.
713 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
717 * @privilege %http://tizen.org/privilege/ime
719 * @remarks The @a window should be released using evas_object_del().
721 * @param[in] window The window object to destroy
722 * @param[in] user_data User data to be passed to the callback function
724 * @pre The callback can be registered using ime_event_set_option_window_destroyed_cb() function.
725 * ime_destroy_option_window() calls this callback function.
727 * @see ime_event_set_option_window_destroyed_cb()
729 typedef void (*ime_option_window_destroyed_cb)(Evas_Object *window, void *user_data);
732 * @brief Called to set the prediction hint string to deliver to the input panel.
738 * @privilege %http://tizen.org/privilege/ime
740 * @remarks @a prediction_hint is valid only in the callback. To use outside the callback, make a copy.
741 * This function is used by the applications to deliver the prediction hint message to the input panel.
743 * @param[in] prediction_hint The prediction hint to be set to the input panel
744 * @param[in] user_data User data to be passed to the callback function
746 * @pre The callback can be registered using ime_event_set_prediction_hint_set_cb() function.
748 * @see ime_event_set_prediction_hint_set_cb()
750 typedef void (*ime_prediction_hint_set_cb)(const char *prediction_hint, void *user_data);
753 * @brief Called when an associated text input UI control requests the text entry to set the MIME type.
759 * @privilege %http://tizen.org/privilege/ime
761 * @remarks @a mime_type is valid only in the callback. To use outside the callback, make a copy.
762 * This function is used by the applications to deliver the MIME type to the input panel.
764 * @param[in] mime_type The MIME type to be set to the input panel
765 * @param[in] user_data User data to be passed to the callback function
767 * @pre The callback can be registered using ime_event_set_mime_type_set_request_cb() function.
769 * @see ime_event_set_mime_type_set_request_cb()
771 typedef void (*ime_mime_type_set_request_cb)(const char *mime_type, void *user_data);
774 * @brief Called to set key-value pairs of predicting messages to deliver to the input panel.
780 * @privilege %http://tizen.org/privilege/ime
782 * @remarks @a key and @a value is valid only in the callback. To use outside the callback, make a copy.
783 * This function is used by applications to deliver predicted hint messages to the input panel.
785 * @param[in] key The prediction hint key to be set to the input panel
786 * @param[in] value The prediction hint value to be set to the input panel
787 * @param[in] user_data User data to be passed to the callback function
789 * @pre The callback can be registered using ime_event_set_prediction_hint_data_set_cb() function.
791 * @see ime_event_set_prediction_hint_data_set_cb()
793 typedef void (*ime_prediction_hint_data_set_cb)(const char *key, const char *value, void *user_data);
796 * @brief The structure type to contain the set of the essential callback functions for IME application lifecycle and appearance.
798 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
800 * @remarks These four callback functions are mandatory for IME application.
805 ime_create_cb create; /**< Called when the input panel is created */
806 ime_terminate_cb terminate; /**< Called when the input panel is terminated */
807 ime_show_cb show; /**< Called when the input panel is requested to show itself */
808 ime_hide_cb hide; /**< Called when the input panel is requested to hide itself */
812 * @brief Runs the main loop of IME application.
814 * @details This function starts to run IME application's main loop. The ime_create_cb()
815 * callback function is called to initialize IME application before the main loop starts up. And
816 * the ime_terminate_cb() callback function is called when IME application is terminated.
818 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
822 * @privilege %http://tizen.org/privilege/ime
824 * @remarks IME application MUST implement ime_app_main() function which is the main
825 * entry point of IME application. In ime_app_main() function, the ime_run()
826 * function MUST be called with the necessary callback functions; ime_create_cb(),
827 * ime_terminate_cb(), ime_show_cb(), and ime_hide_cb() callback functions
828 * are mandatory for IME application.
830 * @param[in] basic_cb The structure pointer of the essential callback functions
831 * @param[in] user_data User data to be passed to the callback functions
833 * @return 0 if IME application ends successfully, otherwise a negative error value
834 * @retval #IME_ERROR_NONE No error
835 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
836 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
837 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
838 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
840 * @pre The ime_event_set_***() functions can be called to set the event handling callback functions.
842 * @see ime_callback_s()
843 * @see ime_event_set_focus_in_cb()
844 * @see ime_event_set_focus_out_cb()
845 * @see ime_event_set_surrounding_text_updated_cb()
846 * @see ime_event_set_input_context_reset_cb()
847 * @see ime_event_set_cursor_position_updated_cb()
848 * @see ime_event_set_language_requested_cb()
849 * @see ime_event_set_language_set_cb()
850 * @see ime_event_set_imdata_set_cb()
851 * @see ime_event_set_layout_set_cb()
852 * @see ime_event_set_return_key_type_set_cb()
853 * @see ime_event_set_return_key_state_set_cb()
854 * @see ime_event_set_geometry_requested_cb()
855 * @see ime_event_set_display_language_changed_cb()
856 * @see ime_event_set_rotation_degree_changed_cb()
857 * @see ime_event_set_accessibility_state_changed_cb()
858 * @see ime_event_set_option_window_created_cb()
859 * @see ime_event_set_option_window_destroyed_cb()
860 * @see ime_event_set_prediction_hint_set_cb()
863 static void inputmethod_create_cb(void *user_data);
864 static void inputmethod_terminate_cb(void *user_data);
865 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
866 static void inputmethod_hide_cb(int context_id, void *user_data);
867 static void inputmethod_focus_in_cb(int context_id, void *user_data);
868 static void inputmethod_focus_out_cb(int context_id, void *user_data);
869 static void inputmethod_cursor_position_updated_cb(int cursor_pos, void *user_data);
871 static void inputmethod_create_cb(void *user_data)
873 Evas_Object *ime_win = NULL;
875 ime_set_size(480, 400, 800, 400);
876 ime_win = ime_get_main_window();
878 // Prepare before showing IME window.
882 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data)
884 Ecore_IMF_Input_Panel_Layout layout;
885 ime_layout_variation_e layout_variation;
886 Evas_Object *ime_win;
888 ime_context_get_layout(context, &layout);
889 ime_context_get_layout_variation(context, &layout_variation);
891 ime_win = ime_get_main_window();
893 // Compose IME UI properly with the context information and show.
895 evas_object_show(ime_win);
899 static void inputmethod_hide_cb(int context_id, void *user_data)
901 Evas_Object *ime_win = ime_get_main_window();
903 evas_object_hide(ime_win);
907 void ime_app_main(int argc, char **argv)
909 ime_callback_s basic_callback = {
910 inputmethod_create_cb,
911 inputmethod_terminate_cb,
916 ime_event_set_focus_in_cb(inputmethod_focus_in_cb, NULL);
917 ime_event_set_focus_out_cb(inputmethod_focus_out_cb, NULL);
918 ime_event_set_cursor_position_updated_cb(inputmethod_cursor_position_updated_cb, NULL);
920 ime_run(&basic_callback, NULL);
924 int ime_run(ime_callback_s *basic_cb, void *user_data);
927 * @brief Sets @c focus_in event callback function.
929 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
933 * @privilege %http://tizen.org/privilege/ime
935 * @remarks The ime_focus_in_cb() callback function is called when an associated text input
936 * UI control has focus.
938 * @param[in] callback_func @c focus_in event callback function
939 * @param[in] user_data User data to be passed to the callback function
941 * @return 0 on success, otherwise a negative error value
942 * @retval #IME_ERROR_NONE No error
943 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
944 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
945 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
947 * @post The ime_run() function should be called to start the IME application's main loop.
949 * @see ime_focus_in_cb()
952 int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data);
955 * @brief Sets @c focus_out event callback function.
957 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
961 * @privilege %http://tizen.org/privilege/ime
963 * @remarks The ime_focus_out_cb() callback function is called when an associated text input
964 * UI control loses focus.
966 * @param[in] callback_func @c focus_out event callback function
967 * @param[in] user_data User data to be passed to the callback function
969 * @return 0 on success, otherwise a negative error value
970 * @retval #IME_ERROR_NONE No error
971 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
972 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
973 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
975 * @post The ime_run() function should be called to start the IME application's main loop.
977 * @see ime_focus_out_cb()
980 int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data);
983 * @brief Sets @c surrounding_text_updated event callback function.
985 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
989 * @privilege %http://tizen.org/privilege/ime
991 * @remarks The ime_surrounding_text_updated_cb() callback function is called when an
992 * associated text input UI control responds to a request with the surrounding text.
994 * @param[in] callback_func @c surrounding_text_updated event callback function
995 * @param[in] user_data User data to be passed to the callback function
997 * @return 0 on success, otherwise a negative error value
998 * @retval #IME_ERROR_NONE No error
999 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1000 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1001 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1003 * @post The ime_run() function should be called to start the IME application's main loop.
1005 * @see ime_surrounding_text_updated_cb()
1008 int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb callback_func, void *user_data);
1011 * @brief Sets @c input_context_reset event callback function.
1013 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1017 * @privilege %http://tizen.org/privilege/ime
1019 * @remarks The ime_input_context_reset_cb() callback function is called to reset the input
1020 * context of an associated text input UI control.
1022 * @param[in] callback_func @c input_context_reset event callback function
1023 * @param[in] user_data User data to be passed to the callback function
1025 * @return 0 on success, otherwise a negative error value
1026 * @retval #IME_ERROR_NONE No error
1027 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1028 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1029 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1031 * @post The ime_run() function should be called to start the IME application's main loop.
1033 * @see ime_input_context_reset_cb()
1036 int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_func, void *user_data);
1039 * @brief Sets @c cursor_position_updated event callback function.
1041 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1045 * @privilege %http://tizen.org/privilege/ime
1047 * @remarks The ime_cursor_position_updated_cb() callback function is called when the position
1048 * of the cursor in an associated text input UI control changes.
1050 * @param[in] callback_func @c cursor_position_updated event callback function
1051 * @param[in] user_data User data to be passed to the callback function
1053 * @return 0 on success, otherwise a negative error value
1054 * @retval #IME_ERROR_NONE No error
1055 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1056 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1057 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1059 * @post The ime_run() function should be called to start the IME application's main loop.
1061 * @see ime_cursor_position_updated_cb()
1064 int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb callback_func, void *user_data);
1067 * @brief Sets @c language_requested event callback function.
1069 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1073 * @privilege %http://tizen.org/privilege/ime
1075 * @remarks The ime_language_requested_cb() callback function is called when an associated
1076 * text input UI control requests the language from the input panel.
1078 * @param[in] callback_func @c language_requested event callback function
1079 * @param[in] user_data User data to be passed to the callback function
1081 * @return 0 on success, otherwise a negative error value
1082 * @retval #IME_ERROR_NONE No error
1083 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1084 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1085 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1087 * @post The ime_run() function should be called to start the IME application's main loop.
1089 * @see ime_language_requested_cb()
1092 int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, void *user_data);
1095 * @brief Sets @c language_set event callback function.
1097 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1101 * @privilege %http://tizen.org/privilege/ime
1103 * @remarks The ime_language_set_cb() callback function is called to set the preferred
1104 * language to the input panel.
1106 * @param[in] callback_func @c language_set event callback function
1107 * @param[in] user_data User data to be passed to the callback function
1109 * @return 0 on success, otherwise a negative error value
1110 * @retval #IME_ERROR_NONE No error
1111 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1112 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1113 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1115 * @post The ime_run() function should be called to start the IME application's main loop.
1117 * @see ime_language_set_cb()
1120 int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_data);
1123 * @brief Sets @c imdata_set event callback function.
1125 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1129 * @privilege %http://tizen.org/privilege/ime
1131 * @remarks The ime_imdata_set_cb() callback function is called to set the application
1132 * specific data to deliver to the input panel.
1134 * @param[in] callback_func @c imdata_set event callback function
1135 * @param[in] user_data User data to be passed to the callback function
1137 * @return 0 on success, otherwise a negative error value
1138 * @retval #IME_ERROR_NONE No error
1139 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1140 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1141 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1143 * @post The ime_run() function should be called to start the IME application's main loop.
1145 * @see ime_imdata_set_cb()
1146 * @see ime_event_set_imdata_requested_cb()
1149 int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data);
1152 * @brief Sets @c imdata_requested event callback function.
1154 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1158 * @privilege %http://tizen.org/privilege/ime
1160 * @remarks The ime_imdata_requested_cb() callback function is called when an associated
1161 * text input UI control requests the application specific data from the input panel.
1163 * @param[in] callback_func @c imdata_requested event callback function
1164 * @param[in] user_data User data to be passed to the callback function
1166 * @return 0 on success, otherwise a negative error value
1167 * @retval #IME_ERROR_NONE No error
1168 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1169 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1170 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1172 * @post The ime_run() function should be called to start the IME application's main loop.
1174 * @see ime_imdata_requested_cb()
1175 * @see ime_event_set_imdata_set_cb()
1178 int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, void *user_data);
1181 * @brief Sets @c layout_set event callback function.
1183 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1187 * @privilege %http://tizen.org/privilege/ime
1189 * @remarks The ime_layout_set_cb() callback function is called when an associated text input
1190 * UI control requests the input panel to set its layout.
1192 * @param[in] callback_func @c layout_set event callback function
1193 * @param[in] user_data User data to be passed to the callback function
1195 * @return 0 on success, otherwise a negative error value
1196 * @retval #IME_ERROR_NONE No error
1197 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1198 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1199 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1201 * @post The ime_run() function should be called to start the IME application's main loop.
1203 * @see ime_layout_set_cb()
1206 int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data);
1209 * @brief Sets @c return_key_type_set event callback function.
1211 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1215 * @privilege %http://tizen.org/privilege/ime
1217 * @remarks The ime_return_key_type_set_cb() callback function is called when an associated
1218 * text input UI control requests the input panel to set the @c Return key label.
1220 * @param[in] callback_func @c return_key_type_set event callback function
1221 * @param[in] user_data User data to be passed to the callback function
1223 * @return 0 on success, otherwise a negative error value
1224 * @retval #IME_ERROR_NONE No error
1225 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1226 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1227 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1229 * @post The ime_run() function should be called to start the IME application's main loop.
1231 * @see ime_return_key_type_set_cb()
1234 int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_func, void *user_data);
1237 * @brief Sets @c return_key_state_set event callback function.
1239 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1243 * @privilege %http://tizen.org/privilege/ime
1245 * @remarks The ime_return_key_state_set_cb() callback function is called when an associated
1246 * text input UI control requests the input panel to enable or disable the @c Return key state.
1248 * @param[in] callback_func @c return_key_state_set event callback function
1249 * @param[in] user_data User data to be passed to the callback function
1251 * @return 0 on success, otherwise a negative error value
1252 * @retval #IME_ERROR_NONE No error
1253 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1254 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1255 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1257 * @post The ime_run() function should be called to start the IME application's main loop.
1259 * @see ime_return_key_state_set_cb()
1262 int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_func, void *user_data);
1265 * @brief Sets @c geometry_requested event callback function.
1267 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1271 * @privilege %http://tizen.org/privilege/ime
1273 * @remarks The ime_geometry_requested_cb() callback function is called when an associated
1274 * text input UI control requests the position and size from the input panel.
1276 * @param[in] callback_func @c geometry_requested event callback function
1277 * @param[in] user_data User data to be passed to the callback function
1279 * @return 0 on success, otherwise a negative error value
1280 * @retval #IME_ERROR_NONE No error
1281 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1282 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1283 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1285 * @post The ime_run() function should be called to start the IME application's main loop.
1287 * @see ime_geometry_requested_cb()
1290 int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, void *user_data);
1293 * @brief Sets @c process_key_event event callback function.
1295 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1299 * @privilege %http://tizen.org/privilege/ime
1301 * @remarks The ime_process_key_event_cb() callback function is called when the key event
1302 * is received from the external keyboard devices or ime_send_key_event() function.
1304 * @param[in] callback_func @c process_key_event event callback function
1305 * @param[in] user_data User data to be passed to the callback function
1307 * @return 0 on success, otherwise a negative error value
1308 * @retval #IME_ERROR_NONE No error
1309 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1310 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1311 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1313 * @post The ime_run() function should be called to start the IME application's main loop.
1315 * @see ime_process_key_event_cb()
1319 static void inputmethod_create_cb(void *user_data);
1320 static void inputmethod_terminate_cb(void *user_data);
1321 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
1322 static void inputmethod_hide_cb(int context_id, void *user_data);
1324 static bool inputmethod_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, void *user_data);
1326 if (keymask & IME_KEY_MASK_CONTROL) {
1327 return false; // e.g., Control+C key event would be forwarded to UI control of the client application
1329 if (keymask & IME_KEY_MASK_ALT) {
1333 if (!(keymask & IME_KEY_MASK_RELEASED)) { // The key is pressed
1334 if (keycode == IME_KEY_1) {
1335 ime_update_preedit_string("1"); // Show "1" preedit string
1338 else if (keycode == IME_KEY_2) {
1339 ime_commit_string("12"); // Input "12" string
1347 void ime_app_main(int argc, char **argv)
1349 ime_callback_s basic_callback = {
1350 inputmethod_create_cb,
1351 inputmethod_terminate_cb,
1352 inputmethod_show_cb,
1353 inputmethod_hide_cb,
1356 ime_event_set_process_key_event_cb(inputmethod_process_key_event_cb, NULL);
1358 ime_run(&basic_callback, NULL);
1362 int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, void *user_data);
1365 * @brief Sets @c process_key_event_with_keycode callback function to handle the key event with a keycode.
1371 * @privilege %http://tizen.org/privilege/ime
1373 * @remarks The ime_process_key_event_with_keycode_cb() callback function is called when the key event
1374 * is received from external keyboard devices or ime_send_key_event().
1376 * @param[in] callback_func @c process_key_event_with_keycode() event callback function
1377 * @param[in] user_data User data to be passed to the callback function
1379 * @return 0 on success, otherwise a negative error value
1380 * @retval #IME_ERROR_NONE No error
1381 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1382 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1383 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1385 * @post The ime_run() function should be called to start the IME application's main loop.
1387 * @see ime_process_key_event_with_keycode_cb()
1390 int ime_event_set_process_key_event_with_keycode_cb(ime_process_key_event_with_keycode_cb callback_func, void *user_data);
1393 * @brief Sets @c display_language_changed event callback function.
1395 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1399 * @privilege %http://tizen.org/privilege/ime
1401 * @remarks The ime_display_language_changed_cb() callback function is called when the system
1402 * display language is changed.
1404 * @param[in] callback_func @c display_language_changed event callback function
1405 * @param[in] user_data User data to be passed to the callback function
1407 * @return 0 on success, otherwise a negative error value
1408 * @retval #IME_ERROR_NONE No error
1409 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1410 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1411 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1413 * @post The ime_run() function should be called to start the IME application's main loop.
1415 * @see ime_display_language_changed_cb()
1418 int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb callback_func, void *user_data);
1421 * @brief Sets @c rotation_degree_changed event callback function.
1423 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1427 * @privilege %http://tizen.org/privilege/ime
1429 * @remarks The ime_rotation_degree_changed_cb() callback function is called when the device
1432 * @param[in] callback_func @c rotation_degree_changed event callback function
1433 * @param[in] user_data User data to be passed to the callback function
1435 * @return 0 on success, otherwise a negative error value
1436 * @retval #IME_ERROR_NONE No error
1437 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1438 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1439 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1441 * @post The ime_run() function should be called to start the IME application's main loop.
1443 * @see ime_rotation_degree_changed_cb()
1446 int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb callback_func, void *user_data);
1449 * @brief Sets @c accessibility_state_changed event callback function.
1451 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1455 * @privilege %http://tizen.org/privilege/ime
1457 * @remarks The ime_accessibility_state_changed_cb() callback function is called when
1458 * Accessibility in Settings application is on or off.
1460 * @param[in] callback_func @c accessibility_state_changed event callback function
1461 * @param[in] user_data User data to be passed to the callback function
1463 * @return 0 on success, otherwise a negative error value
1464 * @retval #IME_ERROR_NONE No error
1465 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1466 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1467 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1469 * @post The ime_run() function should be called to start the IME application's main loop.
1471 * @see ime_accessibility_state_changed_cb()
1474 int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed_cb callback_func, void *user_data);
1477 * @brief Sets @c option_window_created event callback function.
1479 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1483 * @privilege %http://tizen.org/privilege/ime
1485 * @remarks The ime_option_window_created_cb() callback function is called to create the option window.
1487 * @param[in] callback_func @c option_window_created event callback function
1488 * @param[in] user_data User data to be passed to the callback function
1490 * @return 0 on success, otherwise a negative error value
1491 * @retval #IME_ERROR_NONE No error
1492 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1493 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1494 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1496 * @post The ime_run() function should be called to start the IME application's main loop.
1498 * @see ime_option_window_created_cb()
1501 int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback_func, void *user_data);
1504 * @brief Sets @c option_window_destroyed event callback function.
1506 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1510 * @privilege %http://tizen.org/privilege/ime
1512 * @remarks The ime_option_window_destroyed_cb() callback function is called to destroy the option window.
1514 * @param[in] callback_func @c option_window_destroyed event callback function
1515 * @param[in] user_data User data to be passed to the callback function
1517 * @return 0 on success, otherwise a negative error value
1518 * @retval #IME_ERROR_NONE No error
1519 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1520 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1521 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1523 * @post The ime_run() function should be called to start the IME application's main loop.
1525 * @see ime_option_window_destroyed_cb()
1528 int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb callback_func, void *user_data);
1531 * @brief Sends a key event to the associated text input UI control.
1533 * @details This function sends key down or up event with key mask to the client application.
1534 * If @a forward_key is @c true, this key event goes to the edit field directly. And if @a forward_key
1535 * is @c false, the ime_process_key_event_cb() callback function receives the key event before the edit field.
1537 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1541 * @privilege %http://tizen.org/privilege/ime
1543 * @param[in] keycode The key code to be sent
1544 * @param[in] keymask The modifier key mask
1545 * @param[in] forward_key The flag to send the key event directly to the edit field
1547 * @return 0 on success, otherwise a negative error value
1548 * @retval #IME_ERROR_NONE No error
1549 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1550 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1552 * @post If @a forward_key is @c false, the ime_process_key_event_cb() callback function can compose the text with the key events.
1554 * @see ime_key_code_e
1555 * @see ime_key_mask_e
1556 * @see ime_process_key_event_cb()
1558 int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key);
1561 * @brief Sends the text to the associated text input UI control.
1563 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1567 * @privilege %http://tizen.org/privilege/ime
1569 * @param[in] str The UTF-8 string to be committed
1571 * @return 0 on success, otherwise a negative error value
1572 * @retval #IME_ERROR_NONE No error
1573 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1574 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1575 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1577 * @see ime_show_preedit_string()
1578 * @see ime_hide_preedit_string()
1579 * @see ime_update_preedit_string()
1581 int ime_commit_string(const char *str);
1584 * @brief Requests to show preedit string.
1586 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1590 * @privilege %http://tizen.org/privilege/ime
1592 * @return 0 on success, otherwise a negative error value
1593 * @retval #IME_ERROR_NONE No error
1594 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1595 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1597 * @see ime_commit_string()
1598 * @see ime_hide_preedit_string()
1599 * @see ime_update_preedit_string()
1601 int ime_show_preedit_string(void);
1604 * @brief Requests to hide preedit string.
1606 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1610 * @privilege %http://tizen.org/privilege/ime
1612 * @return 0 on success, otherwise a negative error value
1613 * @retval #IME_ERROR_NONE No error
1614 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1615 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1617 * @see ime_commit_string()
1618 * @see ime_show_preedit_string()
1619 * @see ime_update_preedit_string()
1621 int ime_hide_preedit_string(void);
1624 * @brief Updates a new preedit string.
1626 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1630 * @privilege %http://tizen.org/privilege/ime
1632 * @param[in] str The UTF-8 string to be updated in preedit
1633 * @param[in] attrs The Eina_List which has #ime_preedit_attribute lists; @a str can be composed of multiple
1634 * string attributes: underline, highlight color and reversal color. The @a attrs will be released internally
1635 * on success and it can be NULL if no attributes to set
1637 * @return 0 on success, otherwise a negative error value
1638 * @retval #IME_ERROR_NONE No error
1639 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1640 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1641 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1643 * @post This function is supposed to be followed by the ime_show_preedit_string() function.
1645 * @see ime_preedit_attribute
1646 * @see ime_commit_string()
1647 * @see ime_show_preedit_string()
1648 * @see ime_hide_preedit_string()
1653 Eina_List *list = NULL;
1655 ime_preedit_attribute *attr = calloc(1, sizeof(ime_preedit_attribute));
1658 attr->type = IME_ATTR_FONTSTYLE;
1659 attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
1660 list = eina_list_append(list, attr);
1662 attr = calloc(1, sizeof(ime_preedit_attribute));
1665 attr->type = IME_ATTR_FONTSTYLE;
1666 attr->value = IME_ATTR_FONTSTYLE_HIGHLIGHT;
1667 list = eina_list_append(list, attr);
1669 attr = calloc(1, sizeof(ime_preedit_attribute));
1672 attr->type = IME_ATTR_FONTSTYLE;
1673 attr->value = IME_ATTR_FONTSTYLE_REVERSAL;
1674 list = eina_list_append(list, attr);
1676 ret = ime_update_preedit_string("abcd", list);
1677 if (ret != IME_ERROR_NONE) {
1678 EINA_LIST_FREE(list, attr)
1684 int ime_update_preedit_string(const char *str, Eina_List *attrs);
1687 * @brief Requests the surrounding text from the position of the cursor, asynchronously.
1689 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1693 * @privilege %http://tizen.org/privilege/ime
1695 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1696 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1698 * @return 0 on success, otherwise a negative error value
1699 * @retval #IME_ERROR_NONE No error
1700 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1701 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1702 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1704 * @pre The ime_surrounding_text_updated_cb() callback function MUST be set by ime_event_set_surrounding_text_updated_cb().
1706 * @post The requested surrounding text can be received using the ime_surrounding_text_updated_cb() callback function.
1708 * @see ime_delete_surrounding_text()
1709 * @see ime_event_set_surrounding_text_updated_cb()
1710 * @see ime_surrounding_text_updated_cb()
1712 int ime_request_surrounding_text(int maxlen_before, int maxlen_after);
1715 * @brief Requests to delete surrounding text.
1717 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1721 * @privilege %http://tizen.org/privilege/ime
1723 * @param[in] offset The offset value from the cursor position
1724 * @param[in] len The length of the text to delete
1726 * @return 0 on success, otherwise a negative error value
1727 * @retval #IME_ERROR_NONE No error
1728 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1729 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1730 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1732 * @see ime_request_surrounding_text()
1734 int ime_delete_surrounding_text(int offset, int len);
1737 * @brief Gets the surrounding text from the position of the cursor, synchronously.
1743 * @privilege %http://tizen.org/privilege/ime
1745 * @remarks @a text must be released using free().
1747 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1748 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1749 * @param[out] text The surrounding text
1750 * @param[out] cursor_pos The cursor position
1752 * @return 0 on success, otherwise a negative error value
1753 * @retval #IME_ERROR_NONE No error
1754 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1755 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1756 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1757 * @retval #IME_ERROR_OUT_OF_MEMORY Failed to obtain text due to out of memory
1759 * @see ime_delete_surrounding_text()
1761 int ime_get_surrounding_text(int maxlen_before, int maxlen_after, char **text, int *cursor_pos);
1764 * @brief Requests to set selection.
1770 * @privilege %http://tizen.org/privilege/ime
1772 * @param[in] start The start cursor position in text (in characters not bytes)
1773 * @param[in] end The end cursor position in text (in characters not bytes)
1775 * @return 0 on success, otherwise a negative error value
1776 * @retval #IME_ERROR_NONE No error
1777 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1778 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1779 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1781 int ime_set_selection(int start, int end);
1784 * @brief Gets the selected text synchronously.
1786 * @details If multi-line text is selected, the result will contain '\n' for each newline character.
1787 * And if the selected text is empty, the result will be an empty string.
1793 * @privilege %http://tizen.org/privilege/ime
1795 * @remarks @a text must be released using free().
1797 * @param[out] text The selected text
1799 * @return 0 on success, otherwise a negative error value
1800 * @retval #IME_ERROR_NONE No error
1801 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1802 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1803 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1805 int ime_get_selected_text(char **text);
1808 * @brief Gets the pointer of input panel main window.
1810 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1814 * @privilege %http://tizen.org/privilege/ime
1816 * @remarks The specific error code can be obtained using the get_last_result() method if this function returns NULL.
1817 * @remarks The returned value should not be released. The returned value is managed by the platform and will be released when terminating this process.
1819 * @return The input panel main window object on success, otherwise NULL
1821 * @exception #IME_ERROR_NONE Successful
1822 * @exception #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1823 * @exception #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1824 * @exception #IME_ERROR_OPERATION_FAILED Operation failed
1826 * @see get_last_result()
1827 * @see ime_create_cb()
1828 * @see ime_terminate_cb()
1829 * @see ime_show_cb()
1830 * @see ime_hide_cb()
1832 Evas_Object* ime_get_main_window(void);
1835 * @brief Updates the input panel window's size information.
1837 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1841 * @privilege %http://tizen.org/privilege/ime
1843 * @param[in] portrait_width The width in portrait mode
1844 * @param[in] portrait_height The height in portrait mode
1845 * @param[in] landscape_width The width in landscape mode
1846 * @param[in] landscape_height The height in landscape mode
1848 * @return 0 on success, otherwise a negative error value
1849 * @retval #IME_ERROR_NONE No error
1850 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1851 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1852 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1854 * @see ime_create_cb()
1856 int ime_set_size(int portrait_width, int portrait_height, int landscape_width, int landscape_height);
1859 * @brief Requests to create an option window from the input panel.
1861 * @details The input panel can call this function to open the option window. This
1862 * function calls ime_option_window_created_cb() callback function with
1863 * #IME_OPTION_WINDOW_TYPE_KEYBOARD parameter.
1865 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1869 * @privilege %http://tizen.org/privilege/ime
1871 * @return 0 on success, otherwise a negative error value
1872 * @retval #IME_ERROR_NONE No error
1873 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1874 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1875 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1876 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1878 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1879 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1880 * ime_event_set_option_window_destroyed_cb() respectively.
1882 * @post This function calls ime_option_window_created_cb() callback function to
1883 * create the option window. And ime_destroy_option_window() function can be called
1884 * to close the option window.
1886 * @see ime_event_set_option_window_created_cb()
1887 * @see ime_option_window_created_cb()
1888 * @see ime_destroy_option_window()
1890 int ime_create_option_window(void);
1893 * @brief Requests to destroy an option window.
1895 * @details The input panel can call this function to close the option window which
1896 * is created from either the input panel or Settings application.
1898 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1902 * @privilege %http://tizen.org/privilege/ime
1904 * @param[in] window The option window to destroy
1906 * @return 0 on success, otherwise a negative error value
1907 * @retval #IME_ERROR_NONE No error
1908 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1909 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1910 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1911 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1913 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1914 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1915 * ime_event_set_option_window_destroyed_cb() respectively.
1917 * @post This function calls ime_option_window_destroyed_cb() callback function
1918 * to destroy the option window.
1920 * @see ime_event_set_option_window_destroyed_cb()
1921 * @see ime_option_window_destroyed_cb()
1922 * @see ime_create_option_window()
1924 int ime_destroy_option_window(Evas_Object *window);
1927 * @brief Gets the layout information from the given input context.
1929 * @details Each edit field has various attributes for input panel. This function can be
1930 * called to get the layout information in ime_show_cb() callback function.
1932 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1936 * @privilege %http://tizen.org/privilege/ime
1938 * @param[in] context The input context information of an associated text input UI control
1939 * @param[out] layout Layout information
1941 * @return 0 on success, otherwise a negative error value
1942 * @retval #IME_ERROR_NONE No error
1943 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1944 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1945 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1947 * @post Input panel UI should be drawn or operated by this information accordingly.
1949 * @see ime_show_cb()
1950 * @see ime_layout_set_cb()
1952 int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout);
1955 * @brief Gets the layout variation information from the given input context.
1957 * @details Each edit field has various attributes for input panel. This function can be
1958 * called to get the layout variation information in ime_show_cb() callback function.
1960 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1964 * @privilege %http://tizen.org/privilege/ime
1966 * @param[in] context The input context information of an associated text input UI control
1967 * @param[out] layout_variation Layout variation information
1969 * @return 0 on success, otherwise a negative error value
1970 * @retval #IME_ERROR_NONE No error
1971 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1972 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1973 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1975 * @post Input panel UI should be drawn or operated by this information accordingly.
1977 * @see ime_show_cb()
1978 * @see ime_layout_variation_e
1980 int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation);
1983 * @brief Gets the cursor position information from the given input context.
1985 * @details Each edit field has various attributes for input panel. This function can be
1986 * called to get the cursor position information in ime_show_cb() callback function.
1988 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
1992 * @privilege %http://tizen.org/privilege/ime
1994 * @param[in] context The input context information of an associated text input UI control
1995 * @param[out] cursor_pos Cursor position information
1997 * @return 0 on success, otherwise a negative error value
1998 * @retval #IME_ERROR_NONE No error
1999 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2000 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2001 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2003 * @post Input panel UI should be drawn or operated by this information accordingly.
2005 * @see ime_show_cb()
2006 * @see ime_cursor_position_updated_cb()
2008 int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos);
2011 * @brief Gets the autocapital type information from the given input context.
2013 * @details Each edit field has various attributes for input panel. This function can be
2014 * called to get the autocapital type information in ime_show_cb() callback function.
2016 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2020 * @privilege %http://tizen.org/privilege/ime
2022 * @param[in] context The input context information of an associated text input UI control
2023 * @param[out] autocapital_type Autocapital type information
2025 * @return 0 on success, otherwise a negative error value
2026 * @retval #IME_ERROR_NONE No error
2027 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2028 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2029 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2031 * @post Input panel UI should be drawn or operated by this information accordingly.
2033 * @see ime_show_cb()
2035 int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type);
2038 * @brief Gets the @c Return key label type information from the given input context.
2040 * @details Each edit field has various attributes for input panel. This function can be
2041 * called to get the @c Return key label type information in ime_show_cb() callback function.
2043 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2047 * @privilege %http://tizen.org/privilege/ime
2049 * @param[in] context The input context information of an associated text input UI control
2050 * @param[out] return_key_type The @c Return key label type information
2052 * @return 0 on success, otherwise a negative error value
2053 * @retval #IME_ERROR_NONE No error
2054 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2055 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2056 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2058 * @post Input panel UI should be drawn or operated by this information accordingly.
2060 * @see ime_show_cb()
2061 * @see ime_return_key_type_set_cb()
2063 int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type);
2066 * @brief Gets the @c Return key state information from the given input context.
2068 * @details Each edit field has various attributes for input panel. This function can be
2069 * called to get the @c Return key state information in ime_show_cb() callback function.
2071 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2075 * @privilege %http://tizen.org/privilege/ime
2077 * @param[in] context The input context information of an associated text input UI control
2078 * @param[out] return_key_state The @c Return key state information \n @c true to enable @c Return key
2079 * button, @c false to disable @c Return key button
2081 * @return 0 on success, otherwise a negative error value
2082 * @retval #IME_ERROR_NONE No error
2083 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2084 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2085 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2087 * @post Input panel UI should be drawn or operated by this information accordingly.
2089 * @see ime_show_cb()
2090 * @see ime_return_key_state_set_cb()
2092 int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state);
2095 * @brief Gets the prediction mode information from the given input context.
2097 * @details Each edit field has various attributes for input panel. This function can be
2098 * called to get the prediction mode information in ime_show_cb() callback function.
2100 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2104 * @privilege %http://tizen.org/privilege/ime
2106 * @param[in] context The input context information of an associated text input UI control
2107 * @param[out] prediction_mode Prediction mode information \n @c true to allow the predictive
2108 * text feature if available, @c false to disable the predictive text feature
2110 * @return 0 on success, otherwise a negative error value
2111 * @retval #IME_ERROR_NONE No error
2112 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2113 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2114 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2116 * @post Input panel UI should be drawn or operated by this information accordingly.
2118 * @see ime_show_cb()
2120 int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode);
2123 * @brief Gets the password mode information from the given input context.
2125 * @details Each edit field has various attributes for input panel. This function can be
2126 * called to get the password mode information in ime_show_cb() callback function.
2128 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2132 * @privilege %http://tizen.org/privilege/ime
2134 * @remarks If @a password_mode is @c true, the input panel is advised not to support the predictive text.
2136 * @param[in] context The input context information of an associated text input UI control
2137 * @param[out] password_mode Password mode information \n @c true to indicate that a password being inputted,
2138 * @c false to indicate non-password edit field.
2140 * @return 0 on success, otherwise a negative error value
2141 * @retval #IME_ERROR_NONE No error
2142 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2143 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2144 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2146 * @post Input panel UI should be drawn or operated by this information accordingly.
2148 * @see ime_show_cb()
2150 int ime_context_get_password_mode(ime_context_h context, bool *password_mode);
2153 * @brief Gets the input hint information from the given input context.
2155 * @details Each edit field has various attributes for input panel. This function can be
2156 * called to get the input hint information in ime_show_cb() callback function.
2158 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2162 * @privilege %http://tizen.org/privilege/ime
2164 * @remarks @a input_hint is a bit-wise value which recommends the input panel provide
2165 * an auto completion and so on if it is capable of supporting such features.
2167 * @param[in] context The input context information of an associated text input UI control
2168 * @param[out] input_hint Input hint information
2170 * @return 0 on success, otherwise a negative error value
2171 * @retval #IME_ERROR_NONE No error
2172 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2173 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2174 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2176 * @post Input panel UI should be drawn or operated by this information accordingly.
2178 * @see ime_show_cb()
2180 int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint);
2183 * @brief Gets the text bidirectional information from the given input context.
2185 * @details Each edit field has various attributes for input panel. This function can be
2186 * called to get the bidirectional information in ime_show_cb() callback function.
2188 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2192 * @privilege %http://tizen.org/privilege/ime
2194 * @param[in] context The input context information of an associated text input UI control
2195 * @param[out] bidi Text bidirectional information
2197 * @return 0 on success, otherwise a negative error value
2198 * @retval #IME_ERROR_NONE No error
2199 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2200 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2201 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2203 * @post Input panel UI should be drawn or operated by this information accordingly.
2205 * @see ime_show_cb()
2207 int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi);
2210 * @brief Gets the preferred language information from the given input context.
2212 * @details Each edit field has various attributes for input panel. This function can be
2213 * called to get the preferred language information in ime_show_cb() callback function.
2215 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2219 * @privilege %http://tizen.org/privilege/ime
2221 * @param[in] context The input context information of an associated text input UI control
2222 * @param[out] language Preferred language information
2224 * @return 0 on success, otherwise a negative error value
2225 * @retval #IME_ERROR_NONE No error
2226 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2227 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2228 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2230 * @post Input panel UI should be drawn or operated by this information accordingly.
2232 * @see ime_show_cb()
2234 int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language);
2237 * @brief Gets the device name of the key event.
2239 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2243 * @privilege %http://tizen.org/privilege/ime
2245 * @remarks @a dev_name must be released using free().
2247 * @param[in] dev_info The device information from the key event
2248 * @param[out] dev_name The name of key input device. This can be an empty string if the device name is not available
2250 * @return 0 on success, otherwise a negative error value
2251 * @retval #IME_ERROR_NONE No error
2252 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2253 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2254 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2256 * @see ime_process_key_event_cb()
2257 * @see ime_device_info_get_class()
2258 * @see ime_device_info_get_subclass()
2260 int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name);
2263 * @brief Gets the device class of the key event.
2265 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2269 * @privilege %http://tizen.org/privilege/ime
2271 * @param[in] dev_info The device information from the key event
2272 * @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
2274 * @return 0 on success, otherwise a negative error value
2275 * @retval #IME_ERROR_NONE No error
2276 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2277 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2278 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2280 * @see ime_process_key_event_cb()
2281 * @see ime_device_info_get_name()
2282 * @see ime_device_info_get_subclass()
2284 int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class);
2286 * @brief Gets the device subclass of the key event.
2288 * @since_tizen @if MOBILE 2.4 @else 3.0 @endif
2292 * @privilege %http://tizen.org/privilege/ime
2294 * @param[in] dev_info The device information from the key event
2295 * @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
2297 * @return 0 on success, otherwise a negative error value
2298 * @retval #IME_ERROR_NONE No error
2299 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2300 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2301 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2303 * @see ime_process_key_event_cb()
2304 * @see ime_device_info_get_name()
2305 * @see ime_device_info_get_class()
2307 int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass);
2310 * @brief Sets prediction hint event callback function.
2316 * @privilege %http://tizen.org/privilege/ime
2318 * @remarks The ime_prediction_hint_set_cb() callback function is called to set the prediction
2319 * hint string to deliver to the input panel.
2321 * @param[in] callback_func The prediction hint event callback function
2322 * @param[in] user_data User data to be passed to the callback function
2324 * @return 0 on success, otherwise a negative error value
2325 * @retval #IME_ERROR_NONE No error
2326 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2327 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2329 * @post The ime_run() function should be called to start the IME application's main loop.
2331 * @see ime_prediction_hint_set_cb()
2334 int ime_event_set_prediction_hint_set_cb(ime_prediction_hint_set_cb callback_func, void *user_data);
2337 * @brief Sets MIME type event callback function.
2343 * @privilege %http://tizen.org/privilege/ime
2345 * @remarks The ime_mime_type_set_request_cb() callback function is called when an associated text input
2346 * UI control requests the text entry to set the MIME type.
2348 * @param[in] callback_func MIME type event callback function
2349 * @param[in] user_data User data to be passed to the callback function
2351 * @return 0 on success, otherwise a negative error value
2352 * @retval #IME_ERROR_NONE No error
2353 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2354 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2356 * @post The ime_run() function should be called to start the IME application's main loop.
2358 * @see ime_mime_type_set_request_cb()
2361 int ime_event_set_mime_type_set_request_cb(ime_mime_type_set_request_cb callback_func, void *user_data);
2364 * @brief Sends a private command to the associated text input UI control.
2366 * @details This can be used by IME to deliver specific data to an application.
2367 * The data format MUST be negotiated by both application and IME.
2373 * @privilege %http://tizen.org/privilege/ime
2375 * @param[in] command The UTF-8 string to be sent
2377 * @return 0 on success, otherwise a negative error value
2378 * @retval #IME_ERROR_NONE No error
2379 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2380 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2381 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2383 int ime_send_private_command(const char *command);
2386 * @brief Commits contents such as image to the associated text input UI control.
2392 * @privilege %http://tizen.org/privilege/ime
2394 * @param[in] content The content URI to be sent
2395 * @param[in] description The content description
2396 * @param[in] mime_type The MIME type received from the ime_mime_type_set_request_cb()
2398 * @return 0 on success, otherwise a negative error value
2399 * @retval #IME_ERROR_NONE No error
2400 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2401 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2402 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2404 * @see ime_mime_type_set_request_cb()
2405 * @see ime_event_set_mime_type_set_request_cb()
2407 int ime_commit_content(const char *content, const char *description, const char *mime_type);
2410 * @brief Sets the floating mode or not.
2416 * @privilege %http://tizen.org/privilege/ime
2418 * @param[in] floating_mode @c true - floating mode on, @c false - floating mode off
2420 * @return 0 on success, otherwise a negative error value
2421 * @retval #IME_ERROR_NONE No error
2422 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2423 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2425 * @see ime_set_floating_drag_start()
2426 * @see ime_set_floating_drag_end()
2428 int ime_set_floating_mode(bool floating_mode);
2431 * @brief Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed.
2437 * @privilege %http://tizen.org/privilege/ime
2439 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2441 * @return 0 on success, otherwise a negative error value
2442 * @retval #IME_ERROR_NONE No error
2443 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2444 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2446 * @pre The floating mode was turned on with ime_set_floating_mode().
2448 * @see ime_set_floating_mode()
2449 * @see ime_set_floating_drag_end()
2451 int ime_set_floating_drag_start(void);
2454 * @brief Disallows the movement of the floating input panel window with the mouse pointer when the mouse is pressed.
2456 * @details This function must be called after invoking ime_set_floating_drag_start(). Otherwise the call is ignored.
2462 * @privilege %http://tizen.org/privilege/ime
2464 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2466 * @return 0 on success, otherwise a negative error value
2467 * @retval #IME_ERROR_NONE No error
2468 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2469 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2471 * @pre The floating mode was turned on with ime_set_floating_mode().
2472 * @pre ime_set_floating_drag_start() was called before.
2474 * @see ime_set_floating_mode()
2475 * @see ime_set_floating_drag_start()
2477 int ime_set_floating_drag_end(void);
2480 * @brief Sets a callback function to give a hint about predicted words.
2486 * @privilege %http://tizen.org/privilege/ime
2488 * @remarks The ime_prediction_hint_data_set_cb() callback function is called to provide the prediction
2489 * hint key and value which can be delivered to the input panel.
2491 * @param[in] callback_func The callback function to give hints
2492 * @param[in] user_data User data to be passed to the callback function
2494 * @return 0 on success, otherwise a negative error value
2495 * @retval #IME_ERROR_NONE No error
2496 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2497 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2499 * @post The ime_run() function should be called to start the IME application's main loop.
2501 * @see ime_prediction_hint_data_set_cb()
2504 int ime_event_set_prediction_hint_data_set_cb(ime_prediction_hint_data_set_cb callback_func, void *user_data);
2507 * @brief Sends the request to hide IME.
2513 * @privilege %http://tizen.org/privilege/ime
2515 * @return 0 on success, otherwise a negative error value
2516 * @retval #IME_ERROR_NONE No error
2517 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2518 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2520 int ime_request_hide(void);
2523 * @brief Updates the state of input panel event.
2529 * @privilege %http://tizen.org/privilege/ime
2531 * @param[in] type The input panel event type
2532 * @param[in] value The value of event type
2534 * @return 0 on success, otherwise a negative error value
2535 * @retval #IME_ERROR_NONE No error
2536 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2537 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2538 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2540 * @see ime_event_type_e
2542 int ime_update_input_panel_event(ime_event_type_e type, unsigned int value);
2545 * @brief Enables whether candidate strings show or not.
2551 * @privilege %http://tizen.org/privilege/ime
2553 * @param[in] visible @c true if candidate strings show, @c false otherwise.
2555 * @return 0 on success, otherwise a negative error value
2556 * @retval #IME_ERROR_NONE No error
2557 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2558 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2560 int ime_set_candidate_visibility_state(bool visible);
2570 #endif /* __TIZEN_UIX_INPUTMETHOD_H__ */