2 * Copyright (c) 2014-2021 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.
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.
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.
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.
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.
119 #define IME_ATTR_FONTSTYLE_UNDERLINE 1
122 * @brief Value for #IME_ATTR_FONTSTYLE. Draw text in highlighted color.
125 #define IME_ATTR_FONTSTYLE_HIGHLIGHT 2
128 * @brief Value for #IME_ATTR_FONTSTYLE. Draw text in reversal color.
131 #define IME_ATTR_FONTSTYLE_REVERSAL 4
134 * @brief The structure type to contain the attributes for preedit string.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 input hint.
496 * @privilege %http://tizen.org/privilege/ime
498 * @remarks @a input_hint information is already set to the input panel when it is shown
499 * through #ime_context_h. This callback function will be only called when the client
500 * application changes the edit field's input hint attribute after the input panel is shown.
502 * @param[in] input_hint The input hint
503 * @param[in] user_data User data to be passed from the callback registration function
505 * @pre The callback can be registered using ime_event_set_input_hint_set_cb() function.
507 * @see ime_event_set_input_hint_set_cb()
509 typedef void (*ime_input_hint_set_cb)(Ecore_IMF_Input_Hints input_hint, void *user_data);
512 * @brief Called when an associated text input UI control requests the input panel to set the @c Return key label.
513 * The input panel can show text or image on the @c Return button according to the @c Return key action.
519 * @privilege %http://tizen.org/privilege/ime
521 * @remarks @a type information is already set to the input panel when it is shown
522 * through #ime_context_h. This callback function will be only called when the client
523 * application changes the edit field's @c Return key type attribute after the input panel
526 * @param[in] type The type of @c Return key on the input panel
527 * @param[in] user_data User data to be passed from the callback registration function
529 * @pre The callback can be registered using ime_event_set_return_key_type_set_cb() function.
531 * @see ime_event_set_return_key_type_set_cb()
533 typedef void (*ime_return_key_type_set_cb)(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data);
536 * @brief Called when an associated text input UI control requests the input panel to enable
537 * or disable the @c Return key state.
543 * @privilege %http://tizen.org/privilege/ime
545 * @remarks @a disabled information is already set to the input panel when it is shown
546 * through #ime_context_h. This callback function will be only called when the client
547 * application changes the edit field's @c Return key disable attribute after the input panel
550 * @param[in] disabled The Boolean state to disable @c Return key. The @c Return key is enabled by default
551 * @param[in] user_data User data to be passed from the callback registration function
553 * @pre The callback can be registered using ime_event_set_return_key_state_set_cb() function.
555 * @see ime_event_set_return_key_state_set_cb()
557 typedef void (*ime_return_key_state_set_cb)(bool disabled, void *user_data);
560 * @brief Called when an associated text input UI control requests the position and size from the input panel.
566 * @privilege %http://tizen.org/privilege/ime
568 * @remarks @a x, @a y, @a w, and @a h should not be released.
570 * @param[in] user_data User data to be passed from the callback registration function
571 * @param[out] x The x position in screen
572 * @param[out] y The y position in screen
573 * @param[out] w The window width
574 * @param[out] h The window height
576 * @pre The callback can be registered using ime_event_set_geometry_requested_cb() function.
578 * @see ime_event_set_geometry_requested_cb()
580 typedef void (*ime_geometry_requested_cb)(void *user_data, int *x, int *y, int *w, int *h);
583 * @brief Called when a key event is received from external devices or ime_send_key_event().
585 * @details This function processes the key event before an associated text input UI control does.
591 * @privilege %http://tizen.org/privilege/ime
593 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
594 * @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.
596 * @param[in] key_code The key code to be sent
597 * @param[in] key_mask The modifier key mask
598 * @param[in] dev_info The device information handle
599 * @param[in] user_data User data to be passed from the callback registration function
601 * @return @c true if the event was processed, otherwise the event was not processed and was forwarded to the client application.
603 * @pre The callback should be registered using ime_event_set_process_key_event_cb() function.
605 * @see ime_event_set_process_key_event_cb()
606 * @see ime_device_info_get_name()
607 * @see ime_device_info_get_class()
608 * @see ime_device_info_get_subclass()
609 * @see ime_send_key_event()
610 * @see ime_commit_string()
611 * @see ime_show_preedit_string()
612 * @see ime_hide_preedit_string()
613 * @see ime_update_preedit_string()
615 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);
618 * @brief Called when a key event is received with a keycode from external devices or ime_send_key_event().
620 * @details This function processes a key event with a keycode before an associated UI control for the text input deals with the key event.
626 * @privilege %http://tizen.org/privilege/ime
628 * @remarks If the key event is from the external device, @a dev_info will have its name, class and subclass information.
629 * @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.
631 * @param[in] key_code The X11 key code to be sent
632 * @param[in] key_sym The key symbol to be sent
633 * @param[in] key_mask The modifier key mask
634 * @param[in] dev_info The device information handle
635 * @param[in] user_data User data to be passed from the callback registration function
637 * @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.
639 * @pre The callback should be registered using ime_event_set_process_key_event_with_keycode_cb() function.
641 * @see ime_event_set_process_key_event_with_keycode_cb()
642 * @see ime_device_info_get_name()
643 * @see ime_device_info_get_class()
644 * @see ime_device_info_get_subclass()
645 * @see ime_send_key_event()
646 * @see ime_commit_string()
647 * @see ime_show_preedit_string()
648 * @see ime_hide_preedit_string()
649 * @see ime_update_preedit_string()
651 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);
654 * @brief Called when the system display language is changed.
660 * @privilege %http://tizen.org/privilege/ime
662 * @param[in] language The language code
663 * @param[in] user_data User data to be passed from the callback registration function
665 * @pre The callback can be registered using ime_event_set_display_language_changed_cb() function.
667 * @see ime_event_set_display_language_changed_cb()
669 typedef void (*ime_display_language_changed_cb)(const char *language, void *user_data);
672 * @brief Called when the device is rotated.
678 * @privilege %http://tizen.org/privilege/ime
680 * @param[in] degree The rotation degree
681 * @param[in] user_data User data to be passed from the callback registration function
683 * @pre The callback can be registered using ime_event_set_rotation_degree_changed_cb() function.
685 * @see ime_event_set_rotation_degree_changed_cb()
687 typedef void (*ime_rotation_degree_changed_cb)(int degree, void *user_data);
690 * @brief Called when Accessibility in Settings application is on or off.
696 * @privilege %http://tizen.org/privilege/ime
698 * @param[in] state Accessibility option state
699 * @param[in] user_data User data to be passed from the callback registration function
701 * @pre The callback can be registered using ime_event_set_accessibility_state_changed_cb() function.
703 * @see ime_event_set_accessibility_state_changed_cb()
705 typedef void (*ime_accessibility_state_changed_cb)(bool state, void *user_data);
708 * @brief Called to create the option window.
714 * @privilege %http://tizen.org/privilege/ime
716 * @remarks if Input panel requests to open the option window, @a type will be #IME_OPTION_WINDOW_TYPE_KEYBOARD.
717 * And if Settings application requests to open it, @a type will be #IME_OPTION_WINDOW_TYPE_SETTING_APPLICATION.
718 * The @a window should not be released. The @a window can be used until ime_option_window_destroyed_cb() will be called.
720 * @param[in] window The created window object
721 * @param[in] type The type of option window
722 * @param[in] user_data User data to be passed from the callback registration function
724 * @pre The callback can be registered using ime_event_set_option_window_created_cb() function. The
725 * ime_create_option_window() calls this callback function or Settings application can call this callback function.
727 * @see ime_event_set_option_window_created_cb()
728 * @see ime_create_option_window()
730 typedef void (*ime_option_window_created_cb)(Evas_Object *window, ime_option_window_type_e type, void *user_data);
733 * @brief Called to destroy the option window.
739 * @privilege %http://tizen.org/privilege/ime
741 * @remarks The @a window should be released using evas_object_del().
743 * @param[in] window The window object to destroy
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_option_window_destroyed_cb() function.
747 * ime_destroy_option_window() calls this callback function.
749 * @see ime_event_set_option_window_destroyed_cb()
751 typedef void (*ime_option_window_destroyed_cb)(Evas_Object *window, void *user_data);
754 * @brief Called to set the prediction hint string to deliver to the input panel.
760 * @privilege %http://tizen.org/privilege/ime
762 * @remarks @a prediction_hint is valid only in the callback. To use outside the callback, make a copy.
763 * This function is used by the applications to deliver the prediction hint message to the input panel.
765 * @param[in] prediction_hint The prediction hint to be set to the input panel
766 * @param[in] user_data User data to be passed to the callback function
768 * @pre The callback can be registered using ime_event_set_prediction_hint_set_cb() function.
770 * @see ime_event_set_prediction_hint_set_cb()
772 typedef void (*ime_prediction_hint_set_cb)(const char *prediction_hint, void *user_data);
775 * @brief Called when an associated text input UI control requests the text entry to set the MIME type.
781 * @privilege %http://tizen.org/privilege/ime
783 * @remarks @a mime_type is valid only in the callback. To use outside the callback, make a copy.
784 * This function is used by the applications to deliver the MIME type to the input panel.
786 * @param[in] mime_type The MIME type 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_mime_type_set_request_cb() function.
791 * @see ime_event_set_mime_type_set_request_cb()
793 typedef void (*ime_mime_type_set_request_cb)(const char *mime_type, void *user_data);
796 * @brief Called to set key-value pairs of predicting messages to deliver to the input panel.
802 * @privilege %http://tizen.org/privilege/ime
804 * @remarks @a key and @a value is valid only in the callback. To use outside the callback, make a copy.
805 * This function is used by applications to deliver predicted hint messages to the input panel.
807 * @param[in] key The prediction hint key to be set to the input panel
808 * @param[in] value The prediction hint value to be set to the input panel
809 * @param[in] user_data User data to be passed to the callback function
811 * @pre The callback can be registered using ime_event_set_prediction_hint_data_set_cb() function.
813 * @see ime_event_set_prediction_hint_data_set_cb()
815 typedef void (*ime_prediction_hint_data_set_cb)(const char *key, const char *value, void *user_data);
818 * @brief The structure type to contain the set of the essential callback functions for IME application lifecycle and appearance.
822 * @remarks These four callback functions are mandatory for IME application.
827 ime_create_cb create; /**< Called when the input panel is created */
828 ime_terminate_cb terminate; /**< Called when the input panel is terminated */
829 ime_show_cb show; /**< Called when the input panel is requested to show itself */
830 ime_hide_cb hide; /**< Called when the input panel is requested to hide itself */
834 * @brief Runs the main loop of IME application.
836 * @details This function starts to run IME application's main loop. The ime_create_cb()
837 * callback function is called to initialize IME application before the main loop starts up. And
838 * the ime_terminate_cb() callback function is called when IME application is terminated.
844 * @privilege %http://tizen.org/privilege/ime
846 * @remarks IME application MUST implement ime_app_main() function which is the main
847 * entry point of IME application. In ime_app_main() function, the ime_run()
848 * function MUST be called with the necessary callback functions; ime_create_cb(),
849 * ime_terminate_cb(), ime_show_cb(), and ime_hide_cb() callback functions
850 * are mandatory for IME application.
852 * @param[in] basic_cb The structure pointer of the essential callback functions
853 * @param[in] user_data User data to be passed to the callback functions
855 * @return 0 if IME application ends successfully, otherwise a negative error value
856 * @retval #IME_ERROR_NONE No error
857 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
858 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
859 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
860 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
862 * @pre The ime_event_set_***() functions can be called to set the event handling callback functions.
864 * @see #ime_callback_s
865 * @see ime_event_set_focus_in_cb()
866 * @see ime_event_set_focus_out_cb()
867 * @see ime_event_set_surrounding_text_updated_cb()
868 * @see ime_event_set_input_context_reset_cb()
869 * @see ime_event_set_cursor_position_updated_cb()
870 * @see ime_event_set_language_requested_cb()
871 * @see ime_event_set_language_set_cb()
872 * @see ime_event_set_imdata_set_cb()
873 * @see ime_event_set_layout_set_cb()
874 * @see ime_event_set_return_key_type_set_cb()
875 * @see ime_event_set_return_key_state_set_cb()
876 * @see ime_event_set_geometry_requested_cb()
877 * @see ime_event_set_display_language_changed_cb()
878 * @see ime_event_set_rotation_degree_changed_cb()
879 * @see ime_event_set_accessibility_state_changed_cb()
880 * @see ime_event_set_option_window_created_cb()
881 * @see ime_event_set_option_window_destroyed_cb()
882 * @see ime_event_set_prediction_hint_set_cb()
885 static void inputmethod_create_cb(void *user_data);
886 static void inputmethod_terminate_cb(void *user_data);
887 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
888 static void inputmethod_hide_cb(int context_id, void *user_data);
889 static void inputmethod_focus_in_cb(int context_id, void *user_data);
890 static void inputmethod_focus_out_cb(int context_id, void *user_data);
891 static void inputmethod_cursor_position_updated_cb(int cursor_pos, void *user_data);
893 static void inputmethod_create_cb(void *user_data)
895 Evas_Object *ime_win = NULL;
897 ime_set_size(480, 400, 800, 400);
898 ime_win = ime_get_main_window();
900 // Prepare before showing IME window.
904 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data)
906 Ecore_IMF_Input_Panel_Layout layout;
907 ime_layout_variation_e layout_variation;
908 Evas_Object *ime_win;
910 ime_context_get_layout(context, &layout);
911 ime_context_get_layout_variation(context, &layout_variation);
913 ime_win = ime_get_main_window();
915 // Compose IME UI properly with the context information and show.
917 evas_object_show(ime_win);
921 static void inputmethod_hide_cb(int context_id, void *user_data)
923 Evas_Object *ime_win = ime_get_main_window();
925 evas_object_hide(ime_win);
929 void ime_app_main(int argc, char **argv)
931 ime_callback_s basic_callback = {
932 inputmethod_create_cb,
933 inputmethod_terminate_cb,
938 ime_event_set_focus_in_cb(inputmethod_focus_in_cb, NULL);
939 ime_event_set_focus_out_cb(inputmethod_focus_out_cb, NULL);
940 ime_event_set_cursor_position_updated_cb(inputmethod_cursor_position_updated_cb, NULL);
942 ime_run(&basic_callback, NULL);
946 int ime_run(ime_callback_s *basic_cb, void *user_data);
949 * @brief Sets @c focus_in event callback function.
955 * @privilege %http://tizen.org/privilege/ime
957 * @remarks The ime_focus_in_cb() callback function is called when an associated text input
958 * UI control has focus.
960 * @param[in] callback_func @c focus_in event callback function
961 * @param[in] user_data User data to be passed to the callback function
963 * @return 0 on success, otherwise a negative error value
964 * @retval #IME_ERROR_NONE No error
965 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
966 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
967 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
969 * @post The ime_run() function should be called to start the IME application's main loop.
971 * @see ime_focus_in_cb()
974 int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data);
977 * @brief Sets @c focus_out event callback function.
983 * @privilege %http://tizen.org/privilege/ime
985 * @remarks The ime_focus_out_cb() callback function is called when an associated text input
986 * UI control loses focus.
988 * @param[in] callback_func @c focus_out event callback function
989 * @param[in] user_data User data to be passed to the callback function
991 * @return 0 on success, otherwise a negative error value
992 * @retval #IME_ERROR_NONE No error
993 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
994 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
995 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
997 * @post The ime_run() function should be called to start the IME application's main loop.
999 * @see ime_focus_out_cb()
1002 int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data);
1005 * @brief Sets @c surrounding_text_updated event callback function.
1011 * @privilege %http://tizen.org/privilege/ime
1013 * @remarks The ime_surrounding_text_updated_cb() callback function is called when an
1014 * associated text input UI control responds to a request with the surrounding text.
1016 * @param[in] callback_func @c surrounding_text_updated event callback function
1017 * @param[in] user_data User data to be passed to the callback function
1019 * @return 0 on success, otherwise a negative error value
1020 * @retval #IME_ERROR_NONE No error
1021 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1022 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1023 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1025 * @post The ime_run() function should be called to start the IME application's main loop.
1027 * @see ime_surrounding_text_updated_cb()
1030 int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb callback_func, void *user_data);
1033 * @brief Sets @c input_context_reset event callback function.
1039 * @privilege %http://tizen.org/privilege/ime
1041 * @remarks The ime_input_context_reset_cb() callback function is called to reset the input
1042 * context of an associated text input UI control.
1044 * @param[in] callback_func @c input_context_reset event callback function
1045 * @param[in] user_data User data to be passed to the callback function
1047 * @return 0 on success, otherwise a negative error value
1048 * @retval #IME_ERROR_NONE No error
1049 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1050 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1051 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1053 * @post The ime_run() function should be called to start the IME application's main loop.
1055 * @see ime_input_context_reset_cb()
1058 int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_func, void *user_data);
1061 * @brief Sets @c cursor_position_updated event callback function.
1067 * @privilege %http://tizen.org/privilege/ime
1069 * @remarks The ime_cursor_position_updated_cb() callback function is called when the position
1070 * of the cursor in an associated text input UI control changes.
1072 * @param[in] callback_func @c cursor_position_updated event callback function
1073 * @param[in] user_data User data to be passed to the callback function
1075 * @return 0 on success, otherwise a negative error value
1076 * @retval #IME_ERROR_NONE No error
1077 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1078 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1079 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1081 * @post The ime_run() function should be called to start the IME application's main loop.
1083 * @see ime_cursor_position_updated_cb()
1086 int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb callback_func, void *user_data);
1089 * @brief Sets @c language_requested event callback function.
1095 * @privilege %http://tizen.org/privilege/ime
1097 * @remarks The ime_language_requested_cb() callback function is called when an associated
1098 * text input UI control requests the language from the input panel.
1100 * @param[in] callback_func @c language_requested event callback function
1101 * @param[in] user_data User data to be passed to the callback function
1103 * @return 0 on success, otherwise a negative error value
1104 * @retval #IME_ERROR_NONE No error
1105 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1106 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1107 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1109 * @post The ime_run() function should be called to start the IME application's main loop.
1111 * @see ime_language_requested_cb()
1114 int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, void *user_data);
1117 * @brief Sets @c language_set event callback function.
1123 * @privilege %http://tizen.org/privilege/ime
1125 * @remarks The ime_language_set_cb() callback function is called to set the preferred
1126 * language to the input panel.
1128 * @param[in] callback_func @c language_set event callback function
1129 * @param[in] user_data User data to be passed to the callback function
1131 * @return 0 on success, otherwise a negative error value
1132 * @retval #IME_ERROR_NONE No error
1133 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1134 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1135 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1137 * @post The ime_run() function should be called to start the IME application's main loop.
1139 * @see ime_language_set_cb()
1142 int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_data);
1145 * @brief Sets @c imdata_set event callback function.
1151 * @privilege %http://tizen.org/privilege/ime
1153 * @remarks The ime_imdata_set_cb() callback function is called to set the application
1154 * specific data to deliver to the input panel.
1156 * @param[in] callback_func @c imdata_set event callback function
1157 * @param[in] user_data User data to be passed to the callback function
1159 * @return 0 on success, otherwise a negative error value
1160 * @retval #IME_ERROR_NONE No error
1161 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1162 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1163 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1165 * @post The ime_run() function should be called to start the IME application's main loop.
1167 * @see ime_imdata_set_cb()
1168 * @see ime_event_set_imdata_requested_cb()
1171 int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data);
1174 * @brief Sets @c imdata_requested event callback function.
1180 * @privilege %http://tizen.org/privilege/ime
1182 * @remarks The ime_imdata_requested_cb() callback function is called when an associated
1183 * text input UI control requests the application specific data from the input panel.
1185 * @param[in] callback_func @c imdata_requested event callback function
1186 * @param[in] user_data User data to be passed to the callback function
1188 * @return 0 on success, otherwise a negative error value
1189 * @retval #IME_ERROR_NONE No error
1190 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1191 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1192 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1194 * @post The ime_run() function should be called to start the IME application's main loop.
1196 * @see ime_imdata_requested_cb()
1197 * @see ime_event_set_imdata_set_cb()
1200 int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, void *user_data);
1203 * @brief Sets @c layout_set event callback function.
1209 * @privilege %http://tizen.org/privilege/ime
1211 * @remarks The ime_layout_set_cb() callback function is called when an associated text input
1212 * UI control requests the input panel to set its layout.
1214 * @param[in] callback_func @c layout_set event callback function
1215 * @param[in] user_data User data to be passed to the callback function
1217 * @return 0 on success, otherwise a negative error value
1218 * @retval #IME_ERROR_NONE No error
1219 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1220 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1221 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1223 * @post The ime_run() function should be called to start the IME application's main loop.
1225 * @see ime_layout_set_cb()
1228 int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data);
1231 * @brief Sets @c return_key_type_set event callback function.
1237 * @privilege %http://tizen.org/privilege/ime
1239 * @remarks The ime_return_key_type_set_cb() callback function is called when an associated
1240 * text input UI control requests the input panel to set the @c Return key label.
1242 * @param[in] callback_func @c return_key_type_set event callback function
1243 * @param[in] user_data User data to be passed to the callback function
1245 * @return 0 on success, otherwise a negative error value
1246 * @retval #IME_ERROR_NONE No error
1247 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1248 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1249 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1251 * @post The ime_run() function should be called to start the IME application's main loop.
1253 * @see ime_return_key_type_set_cb()
1256 int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_func, void *user_data);
1259 * @brief Sets @c return_key_state_set event callback function.
1265 * @privilege %http://tizen.org/privilege/ime
1267 * @remarks The ime_return_key_state_set_cb() callback function is called when an associated
1268 * text input UI control requests the input panel to enable or disable the @c Return key state.
1270 * @param[in] callback_func @c return_key_state_set event callback function
1271 * @param[in] user_data User data to be passed to the callback function
1273 * @return 0 on success, otherwise a negative error value
1274 * @retval #IME_ERROR_NONE No error
1275 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1276 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1277 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1279 * @post The ime_run() function should be called to start the IME application's main loop.
1281 * @see ime_return_key_state_set_cb()
1284 int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_func, void *user_data);
1287 * @brief Sets @c geometry_requested event callback function.
1293 * @privilege %http://tizen.org/privilege/ime
1295 * @remarks The ime_geometry_requested_cb() callback function is called when an associated
1296 * text input UI control requests the position and size from the input panel.
1298 * @param[in] callback_func @c geometry_requested event callback function
1299 * @param[in] user_data User data to be passed to the callback function
1301 * @return 0 on success, otherwise a negative error value
1302 * @retval #IME_ERROR_NONE No error
1303 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1304 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1305 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1307 * @post The ime_run() function should be called to start the IME application's main loop.
1309 * @see ime_geometry_requested_cb()
1312 int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, void *user_data);
1315 * @brief Sets @c process_key_event event callback function.
1321 * @privilege %http://tizen.org/privilege/ime
1323 * @remarks The ime_process_key_event_cb() callback function is called when the key event
1324 * is received from the external keyboard devices or ime_send_key_event() function.
1326 * @param[in] callback_func @c process_key_event event callback function
1327 * @param[in] user_data User data to be passed to the callback function
1329 * @return 0 on success, otherwise a negative error value
1330 * @retval #IME_ERROR_NONE No error
1331 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1332 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1333 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1335 * @post The ime_run() function should be called to start the IME application's main loop.
1337 * @see ime_process_key_event_cb()
1341 static void inputmethod_create_cb(void *user_data);
1342 static void inputmethod_terminate_cb(void *user_data);
1343 static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data);
1344 static void inputmethod_hide_cb(int context_id, void *user_data);
1346 static bool inputmethod_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, void *user_data);
1348 if (keymask & IME_KEY_MASK_CONTROL) {
1349 return false; // e.g., Control+C key event would be forwarded to UI control of the client application
1351 if (keymask & IME_KEY_MASK_ALT) {
1355 if (!(keymask & IME_KEY_MASK_RELEASED)) { // The key is pressed
1356 if (keycode == IME_KEY_1) {
1357 ime_update_preedit_string("1"); // Show "1" preedit string
1360 else if (keycode == IME_KEY_2) {
1361 ime_commit_string("12"); // Input "12" string
1369 void ime_app_main(int argc, char **argv)
1371 ime_callback_s basic_callback = {
1372 inputmethod_create_cb,
1373 inputmethod_terminate_cb,
1374 inputmethod_show_cb,
1375 inputmethod_hide_cb,
1378 ime_event_set_process_key_event_cb(inputmethod_process_key_event_cb, NULL);
1380 ime_run(&basic_callback, NULL);
1384 int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, void *user_data);
1387 * @brief Sets @c process_key_event_with_keycode callback function to handle the key event with a keycode.
1393 * @privilege %http://tizen.org/privilege/ime
1395 * @remarks The ime_process_key_event_with_keycode_cb() callback function is called when the key event
1396 * is received from external keyboard devices or ime_send_key_event().
1398 * @param[in] callback_func @c process_key_event_with_keycode() event callback function
1399 * @param[in] user_data User data to be passed to the callback function
1401 * @return 0 on success, otherwise a negative error value
1402 * @retval #IME_ERROR_NONE No error
1403 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1404 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1405 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1407 * @post The ime_run() function should be called to start the IME application's main loop.
1409 * @see ime_process_key_event_with_keycode_cb()
1412 int ime_event_set_process_key_event_with_keycode_cb(ime_process_key_event_with_keycode_cb callback_func, void *user_data);
1415 * @brief Sets @c display_language_changed event callback function.
1421 * @privilege %http://tizen.org/privilege/ime
1423 * @remarks The ime_display_language_changed_cb() callback function is called when the system
1424 * display language is changed.
1426 * @param[in] callback_func @c display_language_changed event callback function
1427 * @param[in] user_data User data to be passed to the callback function
1429 * @return 0 on success, otherwise a negative error value
1430 * @retval #IME_ERROR_NONE No error
1431 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1432 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1433 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1435 * @post The ime_run() function should be called to start the IME application's main loop.
1437 * @see ime_display_language_changed_cb()
1440 int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb callback_func, void *user_data);
1443 * @brief Sets @c rotation_degree_changed event callback function.
1449 * @privilege %http://tizen.org/privilege/ime
1451 * @remarks The ime_rotation_degree_changed_cb() callback function is called when the device
1454 * @param[in] callback_func @c rotation_degree_changed event callback function
1455 * @param[in] user_data User data to be passed to the callback function
1457 * @return 0 on success, otherwise a negative error value
1458 * @retval #IME_ERROR_NONE No error
1459 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1460 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1461 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1463 * @post The ime_run() function should be called to start the IME application's main loop.
1465 * @see ime_rotation_degree_changed_cb()
1468 int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb callback_func, void *user_data);
1471 * @brief Sets @c accessibility_state_changed event callback function.
1477 * @privilege %http://tizen.org/privilege/ime
1479 * @remarks The ime_accessibility_state_changed_cb() callback function is called when
1480 * Accessibility in Settings application is on or off.
1482 * @param[in] callback_func @c accessibility_state_changed event callback function
1483 * @param[in] user_data User data to be passed to the callback function
1485 * @return 0 on success, otherwise a negative error value
1486 * @retval #IME_ERROR_NONE No error
1487 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1488 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1489 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1491 * @post The ime_run() function should be called to start the IME application's main loop.
1493 * @see ime_accessibility_state_changed_cb()
1496 int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed_cb callback_func, void *user_data);
1499 * @brief Sets @c option_window_created event callback function.
1505 * @privilege %http://tizen.org/privilege/ime
1507 * @remarks The ime_option_window_created_cb() callback function is called to create the option window.
1509 * @param[in] callback_func @c option_window_created event callback function
1510 * @param[in] user_data User data to be passed to the callback function
1512 * @return 0 on success, otherwise a negative error value
1513 * @retval #IME_ERROR_NONE No error
1514 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1515 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1516 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1518 * @post The ime_run() function should be called to start the IME application's main loop.
1520 * @see ime_option_window_created_cb()
1523 int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback_func, void *user_data);
1526 * @brief Sets @c option_window_destroyed event callback function.
1532 * @privilege %http://tizen.org/privilege/ime
1534 * @remarks The ime_option_window_destroyed_cb() callback function is called to destroy the option window.
1536 * @param[in] callback_func @c option_window_destroyed event callback function
1537 * @param[in] user_data User data to be passed to the callback function
1539 * @return 0 on success, otherwise a negative error value
1540 * @retval #IME_ERROR_NONE No error
1541 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1542 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1543 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1545 * @post The ime_run() function should be called to start the IME application's main loop.
1547 * @see ime_option_window_destroyed_cb()
1550 int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb callback_func, void *user_data);
1553 * @brief Sends a key event to the associated text input UI control.
1555 * @details This function sends key down or up event with key mask to the client application.
1556 * If @a forward_key is @c true, this key event goes to the edit field directly. And if @a forward_key
1557 * is @c false, the ime_process_key_event_cb() callback function receives the key event before the edit field.
1563 * @privilege %http://tizen.org/privilege/ime
1565 * @param[in] keycode The key code to be sent
1566 * @param[in] keymask The modifier key mask
1567 * @param[in] forward_key The flag to send the key event directly to the edit field
1569 * @return 0 on success, otherwise a negative error value
1570 * @retval #IME_ERROR_NONE No error
1571 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1572 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1574 * @post If @a forward_key is @c false, the ime_process_key_event_cb() callback function can compose the text with the key events.
1576 * @see ime_key_code_e
1577 * @see ime_key_mask_e
1578 * @see ime_process_key_event_cb()
1580 int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key);
1583 * @brief Sends the text to the associated text input UI control.
1589 * @privilege %http://tizen.org/privilege/ime
1591 * @param[in] str The UTF-8 string to be committed
1593 * @return 0 on success, otherwise a negative error value
1594 * @retval #IME_ERROR_NONE No error
1595 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1596 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1597 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1599 * @see ime_show_preedit_string()
1600 * @see ime_hide_preedit_string()
1601 * @see ime_update_preedit_string()
1603 int ime_commit_string(const char *str);
1606 * @brief Requests to show preedit string.
1612 * @privilege %http://tizen.org/privilege/ime
1614 * @return 0 on success, otherwise a negative error value
1615 * @retval #IME_ERROR_NONE No error
1616 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1617 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1619 * @see ime_commit_string()
1620 * @see ime_hide_preedit_string()
1621 * @see ime_update_preedit_string()
1623 int ime_show_preedit_string(void);
1626 * @brief Requests to hide preedit string.
1632 * @privilege %http://tizen.org/privilege/ime
1634 * @return 0 on success, otherwise a negative error value
1635 * @retval #IME_ERROR_NONE No error
1636 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1637 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1639 * @see ime_commit_string()
1640 * @see ime_show_preedit_string()
1641 * @see ime_update_preedit_string()
1643 int ime_hide_preedit_string(void);
1646 * @brief Updates a new preedit string.
1652 * @privilege %http://tizen.org/privilege/ime
1654 * @param[in] str The UTF-8 string to be updated in preedit
1655 * @param[in] attrs The Eina_List which has #ime_preedit_attribute lists; @a str can be composed of multiple
1656 * string attributes: underline, highlight color and reversal color. The @a attrs will be released internally
1657 * on success and it can be NULL if no attributes to set
1659 * @return 0 on success, otherwise a negative error value
1660 * @retval #IME_ERROR_NONE No error
1661 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1662 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1663 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1665 * @post This function is supposed to be followed by the ime_show_preedit_string() function.
1667 * @see #ime_preedit_attribute
1668 * @see ime_commit_string()
1669 * @see ime_show_preedit_string()
1670 * @see ime_hide_preedit_string()
1671 * @see ime_update_preedit_cursor()
1676 Eina_List *list = NULL;
1678 ime_preedit_attribute *attr = calloc(1, sizeof(ime_preedit_attribute));
1681 attr->type = IME_ATTR_FONTSTYLE;
1682 attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
1683 list = eina_list_append(list, attr);
1685 attr = calloc(1, sizeof(ime_preedit_attribute));
1688 attr->type = IME_ATTR_FONTSTYLE;
1689 attr->value = IME_ATTR_FONTSTYLE_HIGHLIGHT;
1690 list = eina_list_append(list, attr);
1692 attr = calloc(1, sizeof(ime_preedit_attribute));
1695 attr->type = IME_ATTR_FONTSTYLE;
1696 attr->value = IME_ATTR_FONTSTYLE_REVERSAL;
1697 list = eina_list_append(list, attr);
1699 ret = ime_update_preedit_string("abcd", list);
1700 if (ret != IME_ERROR_NONE) {
1701 EINA_LIST_FREE(list, attr)
1707 int ime_update_preedit_string(const char *str, Eina_List *attrs);
1710 * @brief Updates the cursor position in the preedit string.
1716 * @privilege %http://tizen.org/privilege/ime
1718 * @param[in] pos The cursor position in the preedit string
1720 * @return 0 on success, otherwise a negative error value
1721 * @retval #IME_ERROR_NONE No error
1722 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1723 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1725 * @post This function is supposed to be followed by the ime_update_preedit_string() function.
1727 * @see ime_show_preedit_string()
1728 * @see ime_hide_preedit_string()
1729 * @see ime_update_preedit_string()
1734 Eina_List *list = NULL;
1736 ime_preedit_attribute *attr = calloc(1, sizeof(ime_preedit_attribute));
1739 attr->type = IME_ATTR_FONTSTYLE;
1740 attr->value = IME_ATTR_FONTSTYLE_UNDERLINE;
1741 list = eina_list_append(list, attr);
1743 attr = calloc(1, sizeof(ime_preedit_attribute));
1746 attr->type = IME_ATTR_FONTSTYLE;
1747 attr->value = IME_ATTR_FONTSTYLE_REVERSAL;
1748 list = eina_list_append(list, attr);
1750 ret = ime_update_preedit_string("abcd", list);
1751 if (ret != IME_ERROR_NONE) {
1752 EINA_LIST_FREE(list, attr)
1755 ret = ime_update_preedit_cursor(1);
1759 int ime_update_preedit_cursor(unsigned int pos);
1762 * @brief Requests the surrounding text from the position of the cursor, asynchronously.
1768 * @privilege %http://tizen.org/privilege/ime
1770 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1771 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1773 * @return 0 on success, otherwise a negative error value
1774 * @retval #IME_ERROR_NONE No error
1775 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1776 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1777 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1779 * @pre The ime_surrounding_text_updated_cb() callback function MUST be set by ime_event_set_surrounding_text_updated_cb().
1781 * @post The requested surrounding text can be received using the ime_surrounding_text_updated_cb() callback function.
1783 * @see ime_delete_surrounding_text()
1784 * @see ime_event_set_surrounding_text_updated_cb()
1785 * @see ime_surrounding_text_updated_cb()
1787 int ime_request_surrounding_text(int maxlen_before, int maxlen_after);
1790 * @brief Requests to delete surrounding text.
1796 * @privilege %http://tizen.org/privilege/ime
1798 * @param[in] offset The offset value from the cursor position (in characters not bytes). For example, please use -3 if you want to remove 3 characters in front of current cursor position.
1799 * @param[in] len The length of the text to delete (in characters not bytes)
1801 * @return 0 on success, otherwise a negative error value
1802 * @retval #IME_ERROR_NONE No error
1803 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1804 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1805 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1807 * @see ime_request_surrounding_text()
1809 int ime_delete_surrounding_text(int offset, int len);
1812 * @brief Gets the surrounding text from the position of the cursor, synchronously.
1818 * @privilege %http://tizen.org/privilege/ime
1820 * @remarks @a text must be released using free().
1822 * @param[in] maxlen_before The maximum length of string to be retrieved before the cursor; -1 means unlimited
1823 * @param[in] maxlen_after The maximum length of string to be retrieved after the cursor; -1 means unlimited
1824 * @param[out] text The surrounding text
1825 * @param[out] cursor_pos The cursor position
1827 * @return 0 on success, otherwise a negative error value
1828 * @retval #IME_ERROR_NONE No error
1829 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1830 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1831 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1832 * @retval #IME_ERROR_OUT_OF_MEMORY Failed to obtain text due to out of memory
1834 * @see ime_delete_surrounding_text()
1836 int ime_get_surrounding_text(int maxlen_before, int maxlen_after, char **text, int *cursor_pos);
1839 * @brief Requests to set selection.
1845 * @privilege %http://tizen.org/privilege/ime
1847 * @param[in] start The start cursor position in text (in characters not bytes)
1848 * @param[in] end The end cursor position in text (in characters not bytes)
1850 * @return 0 on success, otherwise a negative error value
1851 * @retval #IME_ERROR_NONE No error
1852 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1853 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1854 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1856 int ime_set_selection(int start, int end);
1859 * @brief Gets the selected text synchronously.
1861 * @details If multi-line text is selected, the result will contain '\n' for each newline character.
1862 * And if the selected text is empty, the result will be an empty string.
1868 * @privilege %http://tizen.org/privilege/ime
1870 * @remarks @a text must be released using free().
1872 * @param[out] text The selected text
1874 * @return 0 on success, otherwise a negative error value
1875 * @retval #IME_ERROR_NONE No error
1876 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1877 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1878 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1880 int ime_get_selected_text(char **text);
1883 * @brief Gets the pointer of input panel main window.
1889 * @privilege %http://tizen.org/privilege/ime
1891 * @remarks The specific error code can be obtained using the get_last_result() method if this function returns NULL.
1892 * @remarks The returned value should not be released. The returned value is managed by the platform and will be released when terminating this process.
1894 * @return The input panel main window object on success, otherwise NULL
1896 * @exception #IME_ERROR_NONE Successful
1897 * @exception #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1898 * @exception #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1899 * @exception #IME_ERROR_OPERATION_FAILED Operation failed
1901 * @see get_last_result()
1902 * @see ime_create_cb()
1903 * @see ime_terminate_cb()
1904 * @see ime_show_cb()
1905 * @see ime_hide_cb()
1907 Evas_Object* ime_get_main_window(void);
1910 * @brief Updates the input panel window's size information.
1916 * @privilege %http://tizen.org/privilege/ime
1918 * @param[in] portrait_width The width in portrait mode
1919 * @param[in] portrait_height The height in portrait mode
1920 * @param[in] landscape_width The width in landscape mode
1921 * @param[in] landscape_height The height in landscape mode
1923 * @return 0 on success, otherwise a negative error value
1924 * @retval #IME_ERROR_NONE No error
1925 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1926 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1927 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1929 * @see ime_create_cb()
1931 int ime_set_size(int portrait_width, int portrait_height, int landscape_width, int landscape_height);
1934 * @brief Requests to create an option window from the input panel.
1936 * @details The input panel can call this function to open the option window. This
1937 * function calls ime_option_window_created_cb() callback function with
1938 * #IME_OPTION_WINDOW_TYPE_KEYBOARD parameter.
1944 * @privilege %http://tizen.org/privilege/ime
1946 * @return 0 on success, otherwise a negative error value
1947 * @retval #IME_ERROR_NONE No error
1948 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1949 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1950 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1951 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
1953 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1954 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1955 * ime_event_set_option_window_destroyed_cb() respectively.
1957 * @post This function calls ime_option_window_created_cb() callback function to
1958 * create the option window. And ime_destroy_option_window() function can be called
1959 * to close the option window.
1961 * @see ime_event_set_option_window_created_cb()
1962 * @see ime_option_window_created_cb()
1963 * @see ime_destroy_option_window()
1965 int ime_create_option_window(void);
1968 * @brief Requests to destroy an option window.
1970 * @details The input panel can call this function to close the option window which
1971 * is created from either the input panel or Settings application.
1977 * @privilege %http://tizen.org/privilege/ime
1979 * @param[in] window The option window to destroy
1981 * @return 0 on success, otherwise a negative error value
1982 * @retval #IME_ERROR_NONE No error
1983 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
1984 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1985 * @retval #IME_ERROR_NO_CALLBACK_FUNCTION Necessary callback function is not set
1986 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
1988 * @pre The ime_option_window_created_cb() and ime_option_window_destroyed_cb()
1989 * callback functions MUST be set by ime_event_set_option_window_created_cb() and
1990 * ime_event_set_option_window_destroyed_cb() respectively.
1992 * @post This function calls ime_option_window_destroyed_cb() callback function
1993 * to destroy the option window.
1995 * @see ime_event_set_option_window_destroyed_cb()
1996 * @see ime_option_window_destroyed_cb()
1997 * @see ime_create_option_window()
1999 int ime_destroy_option_window(Evas_Object *window);
2002 * @brief Gets the layout information from the given input context.
2004 * @details Each edit field has various attributes for input panel. This function can be
2005 * called to get the layout information in ime_show_cb() callback function.
2011 * @privilege %http://tizen.org/privilege/ime
2013 * @param[in] context The input context information of an associated text input UI control
2014 * @param[out] layout Layout information
2016 * @return 0 on success, otherwise a negative error value
2017 * @retval #IME_ERROR_NONE No error
2018 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2019 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2020 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2022 * @post Input panel UI should be drawn or operated by this information accordingly.
2024 * @see ime_show_cb()
2025 * @see ime_layout_set_cb()
2027 int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout);
2030 * @brief Gets the layout variation information from the given input context.
2032 * @details Each edit field has various attributes for input panel. This function can be
2033 * called to get the layout variation information in ime_show_cb() callback function.
2039 * @privilege %http://tizen.org/privilege/ime
2041 * @param[in] context The input context information of an associated text input UI control
2042 * @param[out] layout_variation Layout variation information
2044 * @return 0 on success, otherwise a negative error value
2045 * @retval #IME_ERROR_NONE No error
2046 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2047 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2048 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2050 * @post Input panel UI should be drawn or operated by this information accordingly.
2052 * @see ime_show_cb()
2053 * @see #ime_layout_variation_e
2055 int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation);
2058 * @brief Gets the cursor position information from the given input context.
2060 * @details Each edit field has various attributes for input panel. This function can be
2061 * called to get the cursor position information in ime_show_cb() callback function.
2067 * @privilege %http://tizen.org/privilege/ime
2069 * @param[in] context The input context information of an associated text input UI control
2070 * @param[out] cursor_pos Cursor position information
2072 * @return 0 on success, otherwise a negative error value
2073 * @retval #IME_ERROR_NONE No error
2074 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2075 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2076 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2078 * @post Input panel UI should be drawn or operated by this information accordingly.
2080 * @see ime_show_cb()
2081 * @see ime_cursor_position_updated_cb()
2083 int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos);
2086 * @brief Gets the autocapital type information from the given input context.
2088 * @details Each edit field has various attributes for input panel. This function can be
2089 * called to get the autocapital type information in ime_show_cb() callback function.
2095 * @privilege %http://tizen.org/privilege/ime
2097 * @param[in] context The input context information of an associated text input UI control
2098 * @param[out] autocapital_type Autocapital type information
2100 * @return 0 on success, otherwise a negative error value
2101 * @retval #IME_ERROR_NONE No error
2102 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2103 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2104 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2106 * @post Input panel UI should be drawn or operated by this information accordingly.
2108 * @see ime_show_cb()
2110 int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type);
2113 * @brief Gets the @c Return key label type information from the given input context.
2115 * @details Each edit field has various attributes for input panel. This function can be
2116 * called to get the @c Return key label type information in ime_show_cb() callback function.
2122 * @privilege %http://tizen.org/privilege/ime
2124 * @param[in] context The input context information of an associated text input UI control
2125 * @param[out] return_key_type The @c Return key label type information
2127 * @return 0 on success, otherwise a negative error value
2128 * @retval #IME_ERROR_NONE No error
2129 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2130 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2131 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2133 * @post Input panel UI should be drawn or operated by this information accordingly.
2135 * @see ime_show_cb()
2136 * @see ime_return_key_type_set_cb()
2138 int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type);
2141 * @brief Gets the @c Return key state information from the given input context.
2143 * @details Each edit field has various attributes for input panel. This function can be
2144 * called to get the @c Return key state information in ime_show_cb() callback function.
2150 * @privilege %http://tizen.org/privilege/ime
2152 * @param[in] context The input context information of an associated text input UI control
2153 * @param[out] return_key_state The @c Return key state information \n @c true to enable @c Return key
2154 * button, @c false to disable @c Return key button
2156 * @return 0 on success, otherwise a negative error value
2157 * @retval #IME_ERROR_NONE No error
2158 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2159 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2160 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2162 * @post Input panel UI should be drawn or operated by this information accordingly.
2164 * @see ime_show_cb()
2165 * @see ime_return_key_state_set_cb()
2167 int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state);
2170 * @brief Gets the prediction mode information from the given input context.
2172 * @details Each edit field has various attributes for input panel. This function can be
2173 * called to get the prediction mode information in ime_show_cb() callback function.
2179 * @privilege %http://tizen.org/privilege/ime
2181 * @param[in] context The input context information of an associated text input UI control
2182 * @param[out] prediction_mode Prediction mode information \n @c true to allow the predictive
2183 * text feature if available, @c false to disable the predictive text feature
2185 * @return 0 on success, otherwise a negative error value
2186 * @retval #IME_ERROR_NONE No error
2187 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2188 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2189 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2191 * @post Input panel UI should be drawn or operated by this information accordingly.
2193 * @see ime_show_cb()
2195 int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode);
2198 * @brief Gets the password mode information from the given input context.
2200 * @details Each edit field has various attributes for input panel. This function can be
2201 * called to get the password mode information in ime_show_cb() callback function.
2207 * @privilege %http://tizen.org/privilege/ime
2209 * @remarks If @a password_mode is @c true, the input panel is advised not to support the predictive text.
2211 * @param[in] context The input context information of an associated text input UI control
2212 * @param[out] password_mode Password mode information \n @c true to indicate that a password being inputted,
2213 * @c false to indicate non-password edit field.
2215 * @return 0 on success, otherwise a negative error value
2216 * @retval #IME_ERROR_NONE No error
2217 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2218 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2219 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2221 * @post Input panel UI should be drawn or operated by this information accordingly.
2223 * @see ime_show_cb()
2225 int ime_context_get_password_mode(ime_context_h context, bool *password_mode);
2228 * @brief Gets the input hint information from the given input context.
2230 * @details Each edit field has various attributes for input panel. This function can be
2231 * called to get the input hint information in ime_show_cb() callback function.
2237 * @privilege %http://tizen.org/privilege/ime
2239 * @remarks @a input_hint is a bit-wise value which recommends the input panel provide
2240 * an auto completion and so on if it is capable of supporting such features.
2242 * @param[in] context The input context information of an associated text input UI control
2243 * @param[out] input_hint Input hint information
2245 * @return 0 on success, otherwise a negative error value
2246 * @retval #IME_ERROR_NONE No error
2247 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2248 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2249 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2251 * @post Input panel UI should be drawn or operated by this information accordingly.
2253 * @see ime_show_cb()
2255 int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint);
2258 * @brief Gets the text bidirectional information from the given input context.
2260 * @details Each edit field has various attributes for input panel. This function can be
2261 * called to get the bidirectional information in ime_show_cb() callback function.
2267 * @privilege %http://tizen.org/privilege/ime
2269 * @param[in] context The input context information of an associated text input UI control
2270 * @param[out] bidi Text bidirectional information
2272 * @return 0 on success, otherwise a negative error value
2273 * @retval #IME_ERROR_NONE No error
2274 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2275 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2276 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2278 * @post Input panel UI should be drawn or operated by this information accordingly.
2280 * @see ime_show_cb()
2282 int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi);
2285 * @brief Gets the preferred language information from the given input context.
2287 * @details Each edit field has various attributes for input panel. This function can be
2288 * called to get the preferred language information in ime_show_cb() callback function.
2294 * @privilege %http://tizen.org/privilege/ime
2296 * @param[in] context The input context information of an associated text input UI control
2297 * @param[out] language Preferred language information
2299 * @return 0 on success, otherwise a negative error value
2300 * @retval #IME_ERROR_NONE No error
2301 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2302 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2303 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2305 * @post Input panel UI should be drawn or operated by this information accordingly.
2307 * @see ime_show_cb()
2309 int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language);
2312 * @brief Gets the device name of the key event.
2318 * @privilege %http://tizen.org/privilege/ime
2320 * @remarks @a dev_name must be released using free().
2322 * @param[in] dev_info The device information from the key event
2323 * @param[out] dev_name The name of key input device. This can be an empty string if the device name is not available
2325 * @return 0 on success, otherwise a negative error value
2326 * @retval #IME_ERROR_NONE No error
2327 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2328 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2329 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2331 * @see ime_process_key_event_cb()
2332 * @see ime_device_info_get_class()
2333 * @see ime_device_info_get_subclass()
2335 int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name);
2338 * @brief Gets the device class of the key event.
2344 * @privilege %http://tizen.org/privilege/ime
2346 * @param[in] dev_info The device information from the key event
2347 * @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
2349 * @return 0 on success, otherwise a negative error value
2350 * @retval #IME_ERROR_NONE No error
2351 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2352 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2353 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2355 * @see ime_process_key_event_cb()
2356 * @see ime_device_info_get_name()
2357 * @see ime_device_info_get_subclass()
2359 int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class);
2361 * @brief Gets the device subclass of the key event.
2367 * @privilege %http://tizen.org/privilege/ime
2369 * @param[in] dev_info The device information from the key event
2370 * @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
2372 * @return 0 on success, otherwise a negative error value
2373 * @retval #IME_ERROR_NONE No error
2374 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2375 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2376 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2378 * @see ime_process_key_event_cb()
2379 * @see ime_device_info_get_name()
2380 * @see ime_device_info_get_class()
2382 int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass);
2385 * @brief Sets prediction hint event callback function.
2391 * @privilege %http://tizen.org/privilege/ime
2393 * @remarks The ime_prediction_hint_set_cb() callback function is called to set the prediction
2394 * hint string to deliver to the input panel.
2396 * @param[in] callback_func The prediction hint event callback function
2397 * @param[in] user_data User data to be passed to the callback function
2399 * @return 0 on success, otherwise a negative error value
2400 * @retval #IME_ERROR_NONE No error
2401 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2402 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2404 * @post The ime_run() function should be called to start the IME application's main loop.
2406 * @see ime_prediction_hint_set_cb()
2409 int ime_event_set_prediction_hint_set_cb(ime_prediction_hint_set_cb callback_func, void *user_data);
2412 * @brief Sets MIME type event callback function.
2418 * @privilege %http://tizen.org/privilege/ime
2420 * @remarks The ime_mime_type_set_request_cb() callback function is called when an associated text input
2421 * UI control requests the text entry to set the MIME type.
2423 * @param[in] callback_func MIME type event callback function
2424 * @param[in] user_data User data to be passed to the callback function
2426 * @return 0 on success, otherwise a negative error value
2427 * @retval #IME_ERROR_NONE No error
2428 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2429 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2431 * @post The ime_run() function should be called to start the IME application's main loop.
2433 * @see ime_mime_type_set_request_cb()
2436 int ime_event_set_mime_type_set_request_cb(ime_mime_type_set_request_cb callback_func, void *user_data);
2439 * @brief Sends a private command to the associated text input UI control.
2441 * @details This can be used by IME to deliver specific data to an application.
2442 * The data format MUST be negotiated by both application and IME.
2448 * @privilege %http://tizen.org/privilege/ime
2450 * @param[in] command The UTF-8 string to be sent
2452 * @return 0 on success, otherwise a negative error value
2453 * @retval #IME_ERROR_NONE No error
2454 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2455 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2456 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2458 int ime_send_private_command(const char *command);
2461 * @brief Commits contents such as image to the associated text input UI control.
2467 * @privilege %http://tizen.org/privilege/ime
2469 * @param[in] content The content URI to be sent
2470 * @param[in] description The content description
2471 * @param[in] mime_type The MIME type received from the ime_mime_type_set_request_cb()
2473 * @return 0 on success, otherwise a negative error value
2474 * @retval #IME_ERROR_NONE No error
2475 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2476 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2477 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2479 * @see ime_mime_type_set_request_cb()
2480 * @see ime_event_set_mime_type_set_request_cb()
2482 int ime_commit_content(const char *content, const char *description, const char *mime_type);
2485 * @brief Sets the floating mode or not.
2491 * @privilege %http://tizen.org/privilege/ime
2493 * @param[in] floating_mode @c true - floating mode on, @c false - floating mode off
2495 * @return 0 on success, otherwise a negative error value
2496 * @retval #IME_ERROR_NONE No error
2497 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2498 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2500 * @see ime_set_floating_drag_start()
2501 * @see ime_set_floating_drag_end()
2503 int ime_set_floating_mode(bool floating_mode);
2506 * @brief Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed.
2512 * @privilege %http://tizen.org/privilege/ime
2514 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2516 * @return 0 on success, otherwise a negative error value
2517 * @retval #IME_ERROR_NONE No error
2518 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2519 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2521 * @pre The floating mode was turned on with ime_set_floating_mode().
2523 * @see ime_set_floating_mode()
2524 * @see ime_set_floating_drag_end()
2526 int ime_set_floating_drag_start(void);
2529 * @brief Disallows the movement of the floating input panel window with the mouse pointer when the mouse is pressed.
2531 * @details This function must be called after invoking ime_set_floating_drag_start(). Otherwise the call is ignored.
2537 * @privilege %http://tizen.org/privilege/ime
2539 * @remarks This function can be used in floating mode. If the floating mode is deactivated, calling this function has no effect.
2541 * @return 0 on success, otherwise a negative error value
2542 * @retval #IME_ERROR_NONE No error
2543 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2544 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2546 * @pre The floating mode was turned on with ime_set_floating_mode().
2547 * @pre ime_set_floating_drag_start() was called before.
2549 * @see ime_set_floating_mode()
2550 * @see ime_set_floating_drag_start()
2552 int ime_set_floating_drag_end(void);
2555 * @brief Sets a callback function to give a hint about predicted words.
2561 * @privilege %http://tizen.org/privilege/ime
2563 * @remarks The ime_prediction_hint_data_set_cb() callback function is called to provide the prediction
2564 * hint key and value which can be delivered to the input panel.
2566 * @param[in] callback_func The callback function to give hints
2567 * @param[in] user_data User data to be passed to the callback function
2569 * @return 0 on success, otherwise a negative error value
2570 * @retval #IME_ERROR_NONE No error
2571 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2572 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2574 * @post The ime_run() function should be called to start the IME application's main loop.
2576 * @see ime_prediction_hint_data_set_cb()
2579 int ime_event_set_prediction_hint_data_set_cb(ime_prediction_hint_data_set_cb callback_func, void *user_data);
2582 * @brief Sends the request to hide IME.
2588 * @privilege %http://tizen.org/privilege/ime
2590 * @return 0 on success, otherwise a negative error value
2591 * @retval #IME_ERROR_NONE No error
2592 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2593 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2595 int ime_request_hide(void);
2598 * @brief Updates the state of input panel event.
2604 * @privilege %http://tizen.org/privilege/ime
2606 * @param[in] type The input panel event type
2607 * @param[in] value The value of event type
2609 * @return 0 on success, otherwise a negative error value
2610 * @retval #IME_ERROR_NONE No error
2611 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2612 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2613 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2615 * @see #ime_event_type_e
2617 int ime_update_input_panel_event(ime_event_type_e type, unsigned int value);
2620 * @brief Enables whether candidate strings show or not.
2626 * @privilege %http://tizen.org/privilege/ime
2628 * @param[in] visible @c true if candidate strings show, @c false otherwise.
2630 * @return 0 on success, otherwise a negative error value
2631 * @retval #IME_ERROR_NONE No error
2632 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2633 * @retval #IME_ERROR_NOT_RUNNING IME main loop is not started yet
2635 int ime_set_candidate_visibility_state(bool visible);
2638 * @brief Sets @c input_hint_set event callback function.
2644 * @privilege %http://tizen.org/privilege/ime
2646 * @remarks The ime_input_hint_set_cb() callback function is called to set the input hint
2647 * to deliver to the input panel.
2649 * @param[in] callback_func @c input_hint_set event callback function
2650 * @param[in] user_data User data to be passed to the callback function
2652 * @return 0 on success, otherwise a negative error value
2653 * @retval #IME_ERROR_NONE No error
2654 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function.
2655 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
2656 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
2658 * @post The ime_run() function should be called to start the IME application's main loop.
2660 * @see ime_input_hint_set_cb()
2663 int ime_event_set_input_hint_set_cb(ime_input_hint_set_cb callback_func, void *user_data);
2666 * @brief Unsets @c input_hint_set event callback function.
2672 * @privilege %http://tizen.org/privilege/ime
2674 * @remarks The ime_input_hint_set_cb() callback function is called to set the input hint
2675 * to deliver to the input panel.
2677 * @return 0 on success, otherwise a negative error value
2678 * @retval #IME_ERROR_NONE No error
2679 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
2681 * @see ime_input_hint_set_cb()
2682 * @see ime_event_set_input_hint_set_cb()
2684 int ime_event_unset_input_hint_set_cb(void);
2694 #endif /* __TIZEN_UIX_INPUTMETHOD_H__ */