Tizen Native API
5.5
|
The Input Method API provides the functions for starting IME application lifecycle, methods to interact with current UI state of IME, and getting attributes/events.
#include <inputmethod.h>
Input method editor (IME) is an input panel that lets users provide input and the platform receive the text data entered. Custom keyboards can be built according to the application's necessity by these API sets. Tizen provides a framework to create such input method editors. Such extra input methods can be selected from Settings.
Functions | |
int | ime_run (ime_callback_s *basic_cb, void *user_data) |
Runs the main loop of IME application. | |
int | ime_event_set_focus_in_cb (ime_focus_in_cb callback_func, void *user_data) |
Sets focus_in event callback function. | |
int | ime_event_set_focus_out_cb (ime_focus_out_cb callback_func, void *user_data) |
Sets focus_out event callback function. | |
int | ime_event_set_surrounding_text_updated_cb (ime_surrounding_text_updated_cb callback_func, void *user_data) |
Sets surrounding_text_updated event callback function. | |
int | ime_event_set_input_context_reset_cb (ime_input_context_reset_cb callback_func, void *user_data) |
Sets input_context_reset event callback function. | |
int | ime_event_set_cursor_position_updated_cb (ime_cursor_position_updated_cb callback_func, void *user_data) |
Sets cursor_position_updated event callback function. | |
int | ime_event_set_language_requested_cb (ime_language_requested_cb callback_func, void *user_data) |
Sets language_requested event callback function. | |
int | ime_event_set_language_set_cb (ime_language_set_cb callback_func, void *user_data) |
Sets language_set event callback function. | |
int | ime_event_set_imdata_set_cb (ime_imdata_set_cb callback_func, void *user_data) |
Sets imdata_set event callback function. | |
int | ime_event_set_imdata_requested_cb (ime_imdata_requested_cb callback_func, void *user_data) |
Sets imdata_requested event callback function. | |
int | ime_event_set_layout_set_cb (ime_layout_set_cb callback_func, void *user_data) |
Sets layout_set event callback function. | |
int | ime_event_set_return_key_type_set_cb (ime_return_key_type_set_cb callback_func, void *user_data) |
Sets return_key_type_set event callback function. | |
int | ime_event_set_return_key_state_set_cb (ime_return_key_state_set_cb callback_func, void *user_data) |
Sets return_key_state_set event callback function. | |
int | ime_event_set_geometry_requested_cb (ime_geometry_requested_cb callback_func, void *user_data) |
Sets geometry_requested event callback function. | |
int | ime_event_set_process_key_event_cb (ime_process_key_event_cb callback_func, void *user_data) |
Sets process_key_event event callback function. | |
int | ime_event_set_process_key_event_with_keycode_cb (ime_process_key_event_with_keycode_cb callback_func, void *user_data) |
Sets process_key_event_with_keycode callback function to handle the key event with a keycode. | |
int | ime_event_set_display_language_changed_cb (ime_display_language_changed_cb callback_func, void *user_data) |
Sets display_language_changed event callback function. | |
int | ime_event_set_rotation_degree_changed_cb (ime_rotation_degree_changed_cb callback_func, void *user_data) |
Sets rotation_degree_changed event callback function. | |
int | ime_event_set_accessibility_state_changed_cb (ime_accessibility_state_changed_cb callback_func, void *user_data) |
Sets accessibility_state_changed event callback function. | |
int | ime_event_set_option_window_created_cb (ime_option_window_created_cb callback_func, void *user_data) |
Sets option_window_created event callback function. | |
int | ime_event_set_option_window_destroyed_cb (ime_option_window_destroyed_cb callback_func, void *user_data) |
Sets option_window_destroyed event callback function. | |
int | ime_send_key_event (ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key) |
Sends a key event to the associated text input UI control. | |
int | ime_commit_string (const char *str) |
Sends the text to the associated text input UI control. | |
int | ime_show_preedit_string (void) |
Requests to show preedit string. | |
int | ime_hide_preedit_string (void) |
Requests to hide preedit string. | |
int | ime_update_preedit_string (const char *str, Eina_List *attrs) |
Updates a new preedit string. | |
int | ime_request_surrounding_text (int maxlen_before, int maxlen_after) |
Requests the surrounding text from the position of the cursor, asynchronously. | |
int | ime_delete_surrounding_text (int offset, int len) |
Requests to delete surrounding text. | |
int | ime_get_surrounding_text (int maxlen_before, int maxlen_after, char **text, int *cursor_pos) |
Gets the surrounding text from the position of the cursor, synchronously. | |
int | ime_set_selection (int start, int end) |
Requests to set selection. | |
int | ime_get_selected_text (char **text) |
Gets the selected text synchronously. | |
Evas_Object * | ime_get_main_window (void) |
Gets the pointer of input panel main window. | |
int | ime_set_size (int portrait_width, int portrait_height, int landscape_width, int landscape_height) |
Updates the input panel window's size information. | |
int | ime_create_option_window (void) |
Requests to create an option window from the input panel. | |
int | ime_destroy_option_window (Evas_Object *window) |
Requests to destroy an option window. | |
int | ime_context_get_layout (ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout) |
Gets the layout information from the given input context. | |
int | ime_context_get_layout_variation (ime_context_h context, ime_layout_variation_e *layout_variation) |
Gets the layout variation information from the given input context. | |
int | ime_context_get_cursor_position (ime_context_h context, int *cursor_pos) |
Gets the cursor position information from the given input context. | |
int | ime_context_get_autocapital_type (ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type) |
Gets the autocapital type information from the given input context. | |
int | ime_context_get_return_key_type (ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type) |
Gets the Return key label type information from the given input context. | |
int | ime_context_get_return_key_state (ime_context_h context, bool *return_key_state) |
Gets the Return key state information from the given input context. | |
int | ime_context_get_prediction_mode (ime_context_h context, bool *prediction_mode) |
Gets the prediction mode information from the given input context. | |
int | ime_context_get_password_mode (ime_context_h context, bool *password_mode) |
Gets the password mode information from the given input context. | |
int | ime_context_get_input_hint (ime_context_h context, Ecore_IMF_Input_Hints *input_hint) |
Gets the input hint information from the given input context. | |
int | ime_context_get_bidi_direction (ime_context_h context, Ecore_IMF_BiDi_Direction *bidi) |
Gets the text bidirectional information from the given input context. | |
int | ime_context_get_language (ime_context_h context, Ecore_IMF_Input_Panel_Lang *language) |
Gets the preferred language information from the given input context. | |
int | ime_device_info_get_name (ime_device_info_h dev_info, char **dev_name) |
Gets the device name of the key event. | |
int | ime_device_info_get_class (ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class) |
Gets the device class of the key event. | |
int | ime_device_info_get_subclass (ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass) |
Gets the device subclass of the key event. | |
int | ime_event_set_prediction_hint_set_cb (ime_prediction_hint_set_cb callback_func, void *user_data) |
Sets prediction hint event callback function. | |
int | ime_event_set_mime_type_set_request_cb (ime_mime_type_set_request_cb callback_func, void *user_data) |
Sets MIME type event callback function. | |
int | ime_send_private_command (const char *command) |
Sends a private command to the associated text input UI control. | |
int | ime_commit_content (const char *content, const char *description, const char *mime_type) |
Commits contents such as image to the associated text input UI control. | |
int | ime_set_floating_mode (bool floating_mode) |
Sets the floating mode or not. | |
int | ime_set_floating_drag_start (void) |
Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed. | |
int | ime_set_floating_drag_end (void) |
Disallows the movement of the floating input panel window with the mouse pointer when the mouse is pressed. | |
int | ime_event_set_prediction_hint_data_set_cb (ime_prediction_hint_data_set_cb callback_func, void *user_data) |
Sets a callback function to give a hint about predicted words. | |
int | ime_request_hide (void) |
Sends the request to hide IME. | |
int | ime_update_input_panel_event (ime_event_type_e type, unsigned int value) |
Updates the state of input panel event. | |
int | ime_set_candidate_visibility_state (bool visible) |
Enables whether candidate strings show or not. | |
int | ime_event_set_process_input_device_event_cb (ime_process_input_device_event_cb callback_func, void *user_data) |
Sets process_input_device_event event callback function. | |
int | ime_event_unset_process_input_device_event_cb (void) |
Unsets process_input_device_event event callback function. | |
int | ime_input_device_rotary_get_direction (ime_input_device_event_h event_handle, ime_input_device_rotary_direction_e *direction) |
Gets the direction of the rotary input device event. | |
Typedefs | |
typedef struct _ime_context * | ime_context_h |
Handle of an associated text input UI control's input context. | |
typedef struct _ime_device_info * | ime_device_info_h |
Handle of the device information of the key event. | |
typedef void(* | ime_create_cb )(void *user_data) |
Called when the input panel is created. | |
typedef void(* | ime_terminate_cb )(void *user_data) |
Called when the input panel is terminated. | |
typedef void(* | ime_show_cb )(int context_id, ime_context_h context, void *user_data) |
Called when an associated text input UI control requests the input panel to show itself. | |
typedef void(* | ime_hide_cb )(int context_id, void *user_data) |
Called when an associated text input UI control requests the input panel to hide itself. | |
typedef void(* | ime_focus_in_cb )(int context_id, void *user_data) |
Called when an associated text input UI control has focus. | |
typedef void(* | ime_focus_out_cb )(int context_id, void *user_data) |
Called when an associated text input UI control loses focus. | |
typedef void(* | ime_surrounding_text_updated_cb )(int context_id, const char *text, int cursor_pos, void *user_data) |
Called when an associated text input UI control responds to a request with the surrounding text. | |
typedef void(* | ime_input_context_reset_cb )(void *user_data) |
Called to reset the input context of an associated text input UI control. | |
typedef void(* | ime_cursor_position_updated_cb )(int cursor_pos, void *user_data) |
Called when the position of the cursor in an associated text input UI control changes. | |
typedef void(* | ime_language_requested_cb )(void *user_data, char **lang_code) |
Called when an associated text input UI control requests the language from the input panel. | |
typedef void(* | ime_language_set_cb )(Ecore_IMF_Input_Panel_Lang language, void *user_data) |
Called to set the preferred language to the input panel. | |
typedef void(* | ime_imdata_set_cb )(void *data, unsigned int data_length, void *user_data) |
Called to set the application specific data to deliver to the input panel. | |
typedef void(* | ime_imdata_requested_cb )(void *user_data, void **data, unsigned int *data_length) |
Called when an associated text input UI control requests the application specific data from the input panel. | |
typedef void(* | ime_layout_set_cb )(Ecore_IMF_Input_Panel_Layout layout, void *user_data) |
Called when an associated text input UI control requests the input panel to set its layout. | |
typedef void(* | ime_return_key_type_set_cb )(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data) |
Called when an associated text input UI control requests the input panel to set the Return key label. The input panel can show text or image on the Return button according to the Return key action. | |
typedef void(* | ime_return_key_state_set_cb )(bool disabled, void *user_data) |
Called when an associated text input UI control requests the input panel to enable or disable the Return key state. | |
typedef void(* | ime_geometry_requested_cb )(void *user_data, int *x, int *y, int *w, int *h) |
Called when an associated text input UI control requests the position and size from the input panel. | |
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) |
Called when a key event is received from external devices or ime_send_key_event(). | |
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) |
Called when a key event is received from external devices or ime_send_key_event(). | |
typedef void(* | ime_display_language_changed_cb )(const char *language, void *user_data) |
Called when the system display language is changed. | |
typedef void(* | ime_rotation_degree_changed_cb )(int degree, void *user_data) |
Called when the device is rotated. | |
typedef void(* | ime_accessibility_state_changed_cb )(bool state, void *user_data) |
Called when Accessibility in Settings application is on or off. | |
typedef void(* | ime_option_window_created_cb )(Evas_Object *window, ime_option_window_type_e type, void *user_data) |
Called to create the option window. | |
typedef void(* | ime_option_window_destroyed_cb )(Evas_Object *window, void *user_data) |
Called to destroy the option window. | |
typedef void(* | ime_prediction_hint_set_cb )(const char *prediction_hint, void *user_data) |
Called to set the prediction hint string to deliver to the input panel. | |
typedef void(* | ime_mime_type_set_request_cb )(const char *mime_type, void *user_data) |
Called when an associated text input UI control requests the text entry to set the MIME type. | |
typedef void(* | ime_prediction_hint_data_set_cb )(const char *key, const char *value, void *user_data) |
Called to set key-value pairs of predicting messages to deliver to the input panel. | |
typedef void * | ime_input_device_event_h |
The handle to retrieve unconventional input device specific event data. | |
typedef void(* | ime_process_input_device_event_cb )(ime_input_device_type_e device_type, ime_input_device_event_h device_event, void *user_data) |
Called when the input event is received from an unconventional input device that does not generate key events. | |
Defines | |
#define | IME_ATTR_FONTSTYLE_UNDERLINE 1 |
Value for IME_ATTR_FONTSTYLE. Draw a line under the text. | |
#define | IME_ATTR_FONTSTYLE_HIGHLIGHT 2 |
Value for IME_ATTR_FONTSTYLE. Draw text in highlighted color. | |
#define | IME_ATTR_FONTSTYLE_REVERSAL 4 |
Value for IME_ATTR_FONTSTYLE. Draw text in reversal color. |
#define IME_ATTR_FONTSTYLE_HIGHLIGHT 2 |
Value for IME_ATTR_FONTSTYLE. Draw text in highlighted color.
#define IME_ATTR_FONTSTYLE_REVERSAL 4 |
Value for IME_ATTR_FONTSTYLE. Draw text in reversal color.
#define IME_ATTR_FONTSTYLE_UNDERLINE 1 |
Value for IME_ATTR_FONTSTYLE. Draw a line under the text.
typedef void(* ime_accessibility_state_changed_cb)(bool state, void *user_data) |
Called when Accessibility in Settings application is on or off.
[in] | state | Accessibility option state |
[in] | user_data | User data to be passed from the callback registration function |
typedef struct _ime_context* ime_context_h |
Handle of an associated text input UI control's input context.
This is one of parameters of ime_show_cb() callback function. IME application should configure its input panel with this structure information.
typedef void(* ime_create_cb)(void *user_data) |
Called when the input panel is created.
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_cursor_position_updated_cb)(int cursor_pos, void *user_data) |
Called when the position of the cursor in an associated text input UI control changes.
[in] | cursor_pos | The cursor position |
[in] | user_data | User data to be passed from the callback registration function |
typedef struct _ime_device_info* ime_device_info_h |
Handle of the device information of the key event.
This is one of parameters of ime_process_key_event_cb() callback function. IME application may distinguish the key event by using this if necessary.
typedef void(* ime_display_language_changed_cb)(const char *language, void *user_data) |
Called when the system display language is changed.
[in] | language | The language code |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_focus_in_cb)(int context_id, void *user_data) |
Called when an associated text input UI control has focus.
[in] | context_id | The input context identification value of an associated text input UI control |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_focus_out_cb)(int context_id, void *user_data) |
Called when an associated text input UI control loses focus.
[in] | context_id | The input context identification value of an associated text input UI control |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_geometry_requested_cb)(void *user_data, int *x, int *y, int *w, int *h) |
Called when an associated text input UI control requests the position and size from the input panel.
[in] | user_data | User data to be passed from the callback registration function |
[out] | x | The x position in screen |
[out] | y | The y position in screen |
[out] | w | The window width |
[out] | h | The window height |
typedef void(* ime_hide_cb)(int context_id, void *user_data) |
Called when an associated text input UI control requests the input panel to hide itself.
[in] | context_id | The input context identification value of an associated text input UI control |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_imdata_requested_cb)(void *user_data, void **data, unsigned int *data_length) |
Called when an associated text input UI control requests the application specific data from the input panel.
This function is used by the applications to request the specific data from the input panel. The data format MUST be negotiated by both application and input panel.
[in] | user_data | User data to be passed from the callback registration function |
[out] | data | Input panel's data to be set to the application |
[out] | data_length | The length of data, in bytes, to send to the application |
typedef void(* ime_imdata_set_cb)(void *data, unsigned int data_length, void *user_data) |
Called to set the application specific data to deliver to the input panel.
This function is used by the applications to deliver the specific data to the input panel. The data format MUST be negotiated by both application and input panel.
[in] | data | The specific data to be set to the input panel |
[in] | data_length | The length of data, in bytes, to send to the input panel |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_input_context_reset_cb)(void *user_data) |
Called to reset the input context of an associated text input UI control.
[in] | user_data | User data to be passed from the callback registration function |
typedef void* ime_input_device_event_h |
The handle to retrieve unconventional input device specific event data.
typedef void(* ime_language_requested_cb)(void *user_data, char **lang_code) |
Called when an associated text input UI control requests the language from the input panel.
[in] | user_data | User data to be passed from the callback registration function |
[out] | lang_code | Input panel's current input language code (e.g., "en_US") |
typedef void(* ime_language_set_cb)(Ecore_IMF_Input_Panel_Lang language, void *user_data) |
Called to set the preferred language to the input panel.
[in] | language | The preferred language that the client application wants |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_layout_set_cb)(Ecore_IMF_Input_Panel_Layout layout, void *user_data) |
Called when an associated text input UI control requests the input panel to set its layout.
[in] | layout | The input panel layout |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_mime_type_set_request_cb)(const char *mime_type, void *user_data) |
Called when an associated text input UI control requests the text entry to set the MIME type.
[in] | mime_type | The MIME type to be set to the input panel |
[in] | user_data | User data to be passed to the callback function |
typedef void(* ime_option_window_created_cb)(Evas_Object *window, ime_option_window_type_e type, void *user_data) |
Called to create the option window.
[in] | window | The created window object |
[in] | type | The type of option window |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_option_window_destroyed_cb)(Evas_Object *window, void *user_data) |
Called to destroy the option window.
[in] | window | The window object to destroy |
[in] | user_data | User data to be passed to the callback function |
typedef void(* ime_prediction_hint_data_set_cb)(const char *key, const char *value, void *user_data) |
Called to set key-value pairs of predicting messages to deliver to the input panel.
[in] | key | The prediction hint key to be set to the input panel |
[in] | value | The prediction hint value to be set to the input panel |
[in] | user_data | User data to be passed to the callback function |
typedef void(* ime_prediction_hint_set_cb)(const char *prediction_hint, void *user_data) |
Called to set the prediction hint string to deliver to the input panel.
[in] | prediction_hint | The prediction hint to be set to the input panel |
[in] | user_data | User data to be passed to the callback function |
typedef void(* ime_process_input_device_event_cb)(ime_input_device_type_e device_type, ime_input_device_event_h device_event, void *user_data) |
Called when the input event is received from an unconventional input device that does not generate key events.
This function processes the input event before an associated text input UI control does.
[in] | device_type | The unconventional input device type |
[in] | device_event | The handle for device_type specific input device event |
[in] | user_data | User data to be passed to the callback function |
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) |
Called when a key event is received from external devices or ime_send_key_event().
This function processes the key event before an associated text input UI control does.
[in] | key_code | The key code to be sent |
[in] | key_mask | The modifier key mask |
[in] | dev_info | The device information handle |
[in] | user_data | User data to be passed from the callback registration function |
true
if the event was processed, otherwise the event was not processed and was forwarded to the client application.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) |
Called when a key event is received from external devices or ime_send_key_event().
This function processes a key event with a keycode before an associated UI control for the text input deals with the key event.
[in] | key_code | The X11 key code to be sent |
[in] | key_sym | The key symbol to be sent |
[in] | key_mask | The modifier key mask |
[in] | dev_info | The device information handle |
[in] | user_data | User data to be passed from the callback registration function |
true
if the event was processed, otherwise false
. When false
returns, the event was not processed and was forwarded to the client application.typedef void(* ime_return_key_state_set_cb)(bool disabled, void *user_data) |
Called when an associated text input UI control requests the input panel to enable or disable the Return
key state.
Return
key disable attribute after the input panel is shown.[in] | disabled | The Boolean state to disable Return key. The Return key is enabled by default |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_return_key_type_set_cb)(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data) |
Called when an associated text input UI control requests the input panel to set the Return
key label. The input panel can show text or image on the Return
button according to the Return
key action.
Return
key type attribute after the input panel is shown.[in] | type | The type of Return key on the input panel |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_rotation_degree_changed_cb)(int degree, void *user_data) |
Called when the device is rotated.
[in] | degree | The rotation degree |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_show_cb)(int context_id, ime_context_h context, void *user_data) |
Called when an associated text input UI control requests the input panel to show itself.
[in] | context_id | The input context identification value of an associated text input UI control |
[in] | context | The input context information handle |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_surrounding_text_updated_cb)(int context_id, const char *text, int cursor_pos, void *user_data) |
Called when an associated text input UI control responds to a request with the surrounding text.
[in] | context_id | The input context identification value of an associated text input UI control |
[in] | text | The UTF-8 string requested |
[in] | cursor_pos | The cursor position |
[in] | user_data | User data to be passed from the callback registration function |
typedef void(* ime_terminate_cb)(void *user_data) |
Called when the input panel is terminated.
[in] | user_data | User data to be passed from the callback registration function |
enum ime_attribute_type |
Enumeration of string attribute type.
enum ime_error_e |
Enumeration for input method function error.
enum ime_event_type_e |
Enumeration of directions for rotary input device's rotation event.
Enumeration of unconventional input devices.
enum ime_key_code_e |
Enumeration for the key codes. If keycode & 0xff000000 == 0x01000000 then this key code is directly encoded 24-bit UCS character. The UCS value is keycode & 0x00ffffff.
Defines the list of keys supported by the system. Note that certain keys may not be available on all devices.
enum ime_key_mask_e |
Enumeration for the key masks. The key masks indicate which modifier keys is pressed down during the keyboard hit. The special IME_KEY_MASK_RELEASED indicates the key release event.
Enumeration of layout variation.
int ime_commit_content | ( | const char * | content, |
const char * | description, | ||
const char * | mime_type | ||
) |
Commits contents such as image to the associated text input UI control.
[in] | content | The content URI to be sent |
[in] | description | The content description |
[in] | mime_type | The MIME type received from the ime_mime_type_set_request_cb() |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_commit_string | ( | const char * | str | ) |
Sends the text to the associated text input UI control.
[in] | str | The UTF-8 string to be committed |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_autocapital_type | ( | ime_context_h | context, |
Ecore_IMF_Autocapital_Type * | autocapital_type | ||
) |
Gets the autocapital type information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the autocapital type information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | autocapital_type | Autocapital type information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_bidi_direction | ( | ime_context_h | context, |
Ecore_IMF_BiDi_Direction * | bidi | ||
) |
Gets the text bidirectional information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the bidirectional information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | bidi | Text bidirectional information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_cursor_position | ( | ime_context_h | context, |
int * | cursor_pos | ||
) |
Gets the cursor position information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the cursor position information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | cursor_pos | Cursor position information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_input_hint | ( | ime_context_h | context, |
Ecore_IMF_Input_Hints * | input_hint | ||
) |
Gets the input hint information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the input hint information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | input_hint | Input hint information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_language | ( | ime_context_h | context, |
Ecore_IMF_Input_Panel_Lang * | language | ||
) |
Gets the preferred language information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the preferred language information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | language | Preferred language information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_layout | ( | ime_context_h | context, |
Ecore_IMF_Input_Panel_Layout * | layout | ||
) |
Gets the layout information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the layout information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | layout | Layout information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_layout_variation | ( | ime_context_h | context, |
ime_layout_variation_e * | layout_variation | ||
) |
Gets the layout variation information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the layout variation information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | layout_variation | Layout variation information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_password_mode | ( | ime_context_h | context, |
bool * | password_mode | ||
) |
Gets the password mode information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the password mode information in ime_show_cb() callback function.
true
, the input panel is advised not to support the predictive text.[in] | context | The input context information of an associated text input UI control |
[out] | password_mode | Password mode information true to indicate that a password being inputted, false to indicate non-password edit field. |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_prediction_mode | ( | ime_context_h | context, |
bool * | prediction_mode | ||
) |
Gets the prediction mode information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the prediction mode information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | prediction_mode | Prediction mode information true to allow the predictive text feature if available, false to disable the predictive text feature |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_return_key_state | ( | ime_context_h | context, |
bool * | return_key_state | ||
) |
Gets the Return
key state information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the Return
key state information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | return_key_state | The Return key state information true to enable Return key button, false to disable Return key button |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_context_get_return_key_type | ( | ime_context_h | context, |
Ecore_IMF_Input_Panel_Return_Key_Type * | return_key_type | ||
) |
Gets the Return
key label type information from the given input context.
Each edit field has various attributes for input panel. This function can be called to get the Return
key label type information in ime_show_cb() callback function.
[in] | context | The input context information of an associated text input UI control |
[out] | return_key_type | The Return key label type information |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_create_option_window | ( | void | ) |
Requests to create an option window from the input panel.
The input panel can call this function to open the option window. This function calls ime_option_window_created_cb() callback function with IME_OPTION_WINDOW_TYPE_KEYBOARD parameter.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NO_CALLBACK_FUNCTION | Necessary callback function is not set |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_delete_surrounding_text | ( | int | offset, |
int | len | ||
) |
Requests to delete surrounding text.
[in] | offset | The offset value from the cursor position |
[in] | len | The length of the text to delete |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_destroy_option_window | ( | Evas_Object * | window | ) |
Requests to destroy an option window.
The input panel can call this function to close the option window which is created from either the input panel or Settings application.
[in] | window | The option window to destroy |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NO_CALLBACK_FUNCTION | Necessary callback function is not set |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_device_info_get_class | ( | ime_device_info_h | dev_info, |
Ecore_IMF_Device_Class * | dev_class | ||
) |
Gets the device class of the key event.
[in] | dev_info | The device information from the key event |
[out] | dev_class | The class of key input device. This can be ECORE_IMF_DEVICE_CLASS_NONE if the device class is not available |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_device_info_get_name | ( | ime_device_info_h | dev_info, |
char ** | dev_name | ||
) |
Gets the device name of the key event.
[in] | dev_info | The device information from the key event |
[out] | dev_name | The name of key input device. This can be an empty string if the device name is not available |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_device_info_get_subclass | ( | ime_device_info_h | dev_info, |
Ecore_IMF_Device_Subclass * | dev_subclass | ||
) |
Gets the device subclass of the key event.
[in] | dev_info | The device information from the key event |
[out] | dev_subclass | The subclass of key input device. This can be ECORE_IMF_DEVICE_SUBCLASS_NONE if the device subclass is not available |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_event_set_accessibility_state_changed_cb | ( | ime_accessibility_state_changed_cb | callback_func, |
void * | user_data | ||
) |
Sets accessibility_state_changed
event callback function.
[in] | callback_func | accessibility_state_changed event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_cursor_position_updated_cb | ( | ime_cursor_position_updated_cb | callback_func, |
void * | user_data | ||
) |
Sets cursor_position_updated
event callback function.
[in] | callback_func | cursor_position_updated event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_display_language_changed_cb | ( | ime_display_language_changed_cb | callback_func, |
void * | user_data | ||
) |
Sets display_language_changed
event callback function.
[in] | callback_func | display_language_changed event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_focus_in_cb | ( | ime_focus_in_cb | callback_func, |
void * | user_data | ||
) |
Sets focus_in
event callback function.
[in] | callback_func | focus_in event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_focus_out_cb | ( | ime_focus_out_cb | callback_func, |
void * | user_data | ||
) |
Sets focus_out
event callback function.
[in] | callback_func | focus_out event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_geometry_requested_cb | ( | ime_geometry_requested_cb | callback_func, |
void * | user_data | ||
) |
Sets geometry_requested
event callback function.
[in] | callback_func | geometry_requested event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_imdata_requested_cb | ( | ime_imdata_requested_cb | callback_func, |
void * | user_data | ||
) |
Sets imdata_requested
event callback function.
[in] | callback_func | imdata_requested event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_imdata_set_cb | ( | ime_imdata_set_cb | callback_func, |
void * | user_data | ||
) |
Sets imdata_set
event callback function.
[in] | callback_func | imdata_set event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_input_context_reset_cb | ( | ime_input_context_reset_cb | callback_func, |
void * | user_data | ||
) |
Sets input_context_reset
event callback function.
[in] | callback_func | input_context_reset event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_language_requested_cb | ( | ime_language_requested_cb | callback_func, |
void * | user_data | ||
) |
Sets language_requested
event callback function.
[in] | callback_func | language_requested event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_language_set_cb | ( | ime_language_set_cb | callback_func, |
void * | user_data | ||
) |
Sets language_set
event callback function.
[in] | callback_func | language_set event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_layout_set_cb | ( | ime_layout_set_cb | callback_func, |
void * | user_data | ||
) |
Sets layout_set
event callback function.
[in] | callback_func | layout_set event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_mime_type_set_request_cb | ( | ime_mime_type_set_request_cb | callback_func, |
void * | user_data | ||
) |
Sets MIME type event callback function.
[in] | callback_func | MIME type event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
int ime_event_set_option_window_created_cb | ( | ime_option_window_created_cb | callback_func, |
void * | user_data | ||
) |
Sets option_window_created
event callback function.
[in] | callback_func | option_window_created event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_option_window_destroyed_cb | ( | ime_option_window_destroyed_cb | callback_func, |
void * | user_data | ||
) |
Sets option_window_destroyed
event callback function.
[in] | callback_func | option_window_destroyed event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_prediction_hint_data_set_cb | ( | ime_prediction_hint_data_set_cb | callback_func, |
void * | user_data | ||
) |
Sets a callback function to give a hint about predicted words.
[in] | callback_func | The callback function to give hints |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
int ime_event_set_prediction_hint_set_cb | ( | ime_prediction_hint_set_cb | callback_func, |
void * | user_data | ||
) |
Sets prediction hint event callback function.
[in] | callback_func | The prediction hint event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
int ime_event_set_process_input_device_event_cb | ( | ime_process_input_device_event_cb | callback_func, |
void * | user_data | ||
) |
Sets process_input_device_event
event callback function.
[in] | callback_func | inputmethod_process_input_device_event_cb callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
static void inputmethod_create_cb(void *user_data); static void inputmethod_terminate_cb(void *user_data); static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data); static void inputmethod_hide_cb(int context_id, void *user_data); static void inputmethod_process_input_device_event_cb(ime_input_device_type_e device_type, ime_input_device_event_h device_event, void *user_data) { if (device_type == IME_INPUT_DEVICE_TYPE_ROTARY) { dlog_print(DLOG_INFO, "INPUTMETHOD", "Input device type is rotary\n"); } } void ime_app_main(int argc, char **argv) { ime_callback_s basic_callback = { inputmethod_create_cb, inputmethod_terminate_cb, inputmethod_show_cb, inputmethod_hide_cb, }; ime_event_set_process_input_device_event_cb(inputmethod_process_input_device_event_cb, NULL); ime_run(&basic_callback, NULL); }
int ime_event_set_process_key_event_cb | ( | ime_process_key_event_cb | callback_func, |
void * | user_data | ||
) |
Sets process_key_event
event callback function.
[in] | callback_func | process_key_event event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
static void inputmethod_create_cb(void *user_data); static void inputmethod_terminate_cb(void *user_data); static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data); static void inputmethod_hide_cb(int context_id, void *user_data); static bool inputmethod_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e keymask, void *user_data); { if (keymask & IME_KEY_MASK_CONTROL) { return false; // e.g., Control+C key event would be forwarded to UI control of the client application } if (keymask & IME_KEY_MASK_ALT) { return false; } if (!(keymask & IME_KEY_MASK_RELEASED)) { // The key is pressed if (keycode == IME_KEY_1) { ime_update_preedit_string("1"); // Show "1" preedit string return true; } else if (keycode == IME_KEY_2) { ime_commit_string("12"); // Input "12" string return true; } } return false; } void ime_app_main(int argc, char **argv) { ime_callback_s basic_callback = { inputmethod_create_cb, inputmethod_terminate_cb, inputmethod_show_cb, inputmethod_hide_cb, }; ime_event_set_process_key_event_cb(inputmethod_process_key_event_cb, NULL); ime_run(&basic_callback, NULL); }
int ime_event_set_process_key_event_with_keycode_cb | ( | ime_process_key_event_with_keycode_cb | callback_func, |
void * | user_data | ||
) |
Sets process_key_event_with_keycode
callback function to handle the key event with a keycode.
[in] | callback_func | process_key_event_with_keycode() event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_return_key_state_set_cb | ( | ime_return_key_state_set_cb | callback_func, |
void * | user_data | ||
) |
Sets return_key_state_set
event callback function.
Return
key state.[in] | callback_func | return_key_state_set event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_return_key_type_set_cb | ( | ime_return_key_type_set_cb | callback_func, |
void * | user_data | ||
) |
Sets return_key_type_set
event callback function.
Return
key label.[in] | callback_func | return_key_type_set event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_rotation_degree_changed_cb | ( | ime_rotation_degree_changed_cb | callback_func, |
void * | user_data | ||
) |
Sets rotation_degree_changed
event callback function.
[in] | callback_func | rotation_degree_changed event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_set_surrounding_text_updated_cb | ( | ime_surrounding_text_updated_cb | callback_func, |
void * | user_data | ||
) |
Sets surrounding_text_updated
event callback function.
[in] | callback_func | surrounding_text_updated event callback function |
[in] | user_data | User data to be passed to the callback function |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_event_unset_process_input_device_event_cb | ( | void | ) |
Unsets process_input_device_event
event callback function.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
IME_ERROR_OPERATION_FAILED | Operation failed |
Evas_Object* ime_get_main_window | ( | void | ) |
Gets the pointer of input panel main window.
IME_ERROR_NONE | Successful |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
IME_ERROR_OPERATION_FAILED | Operation failed |
int ime_get_selected_text | ( | char ** | text | ) |
Gets the selected text synchronously.
If multi-line text is selected, the result will contain '
' for each newline character. And if the selected text is empty, the result will be an empty string.
[out] | text | The selected text |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_get_surrounding_text | ( | int | maxlen_before, |
int | maxlen_after, | ||
char ** | text, | ||
int * | cursor_pos | ||
) |
Gets the surrounding text from the position of the cursor, synchronously.
[in] | maxlen_before | The maximum length of string to be retrieved before the cursor; -1 means unlimited |
[in] | maxlen_after | The maximum length of string to be retrieved after the cursor; -1 means unlimited |
[out] | text | The surrounding text |
[out] | cursor_pos | The cursor position |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
IME_ERROR_OUT_OF_MEMORY | Failed to obtain text due to out of memory |
int ime_hide_preedit_string | ( | void | ) |
Requests to hide preedit string.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_input_device_rotary_get_direction | ( | ime_input_device_event_h | event_handle, |
ime_input_device_rotary_direction_e * | direction | ||
) |
Gets the direction of the rotary input device event.
If the device_type parameter of the ime_process_input_device_event_cb() function indicates the current input device type is IME_INPUT_DEVICE_TYPE_ROTARY, then the device_event parameter can be used to retrieve rotary device specific parameters, such as direction, as shown in the sample code.
[in] | event_handle | The input device event handle |
[out] | direction | The direction that the rotary input device was rotated to |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop isn't started yet |
static void inputmethod_process_input_device_event_cb(ime_input_device_type_e device_type, ime_input_device_event_h device_event) { if (device_type == IME_INPUT_DEVICE_TYPE_ROTARY) { ime_input_device_rotary_direction_e direction; if (IME_ERROR_NONE == ime_input_device_rotary_get_direction(device_event, &direction)) { dlog_print(DLOG_INFO, "INPUTMETHOD", "Direction : %d", direction); } } }
int ime_request_hide | ( | void | ) |
Sends the request to hide IME.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_request_surrounding_text | ( | int | maxlen_before, |
int | maxlen_after | ||
) |
Requests the surrounding text from the position of the cursor, asynchronously.
[in] | maxlen_before | The maximum length of string to be retrieved before the cursor; -1 means unlimited |
[in] | maxlen_after | The maximum length of string to be retrieved after the cursor; -1 means unlimited |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NO_CALLBACK_FUNCTION | Necessary callback function is not set |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_run | ( | ime_callback_s * | basic_cb, |
void * | user_data | ||
) |
Runs the main loop of IME application.
This function starts to run IME application's main loop. The ime_create_cb() callback function is called to initialize IME application before the main loop starts up. And the ime_terminate_cb() callback function is called when IME application is terminated.
[in] | basic_cb | The structure pointer of the essential callback functions |
[in] | user_data | User data to be passed to the callback functions |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NO_CALLBACK_FUNCTION | Necessary callback function is not set |
IME_ERROR_OPERATION_FAILED | Operation failed |
static void inputmethod_create_cb(void *user_data); static void inputmethod_terminate_cb(void *user_data); static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data); static void inputmethod_hide_cb(int context_id, void *user_data); static void inputmethod_focus_in_cb(int context_id, void *user_data); static void inputmethod_focus_out_cb(int context_id, void *user_data); static void inputmethod_cursor_position_updated_cb(int cursor_pos, void *user_data); static void inputmethod_create_cb(void *user_data) { Evas_Object *ime_win = NULL; ime_set_size(480, 400, 800, 400); ime_win = ime_get_main_window(); if (ime_win) { // Prepare before showing IME window. } } static void inputmethod_show_cb(int context_id, ime_context_h context, void *user_data) { Ecore_IMF_Input_Panel_Layout layout; ime_layout_variation_e layout_variation; Evas_Object *ime_win; ime_context_get_layout(context, &layout); ime_context_get_layout_variation(context, &layout_variation); ime_win = ime_get_main_window(); if (ime_win) { // Compose IME UI properly with the context information and show. evas_object_show(ime_win); } } static void inputmethod_hide_cb(int context_id, void *user_data) { Evas_Object *ime_win = ime_get_main_window(); if (ime_win) { evas_object_hide(ime_win); } } void ime_app_main(int argc, char **argv) { ime_callback_s basic_callback = { inputmethod_create_cb, inputmethod_terminate_cb, inputmethod_show_cb, inputmethod_hide_cb, }; ime_event_set_focus_in_cb(inputmethod_focus_in_cb, NULL); ime_event_set_focus_out_cb(inputmethod_focus_out_cb, NULL); ime_event_set_cursor_position_updated_cb(inputmethod_cursor_position_updated_cb, NULL); ime_run(&basic_callback, NULL); }
int ime_send_key_event | ( | ime_key_code_e | keycode, |
ime_key_mask_e | keymask, | ||
bool | forward_key | ||
) |
Sends a key event to the associated text input UI control.
This function sends key down or up event with key mask to the client application. If forward_key is true
, this key event goes to the edit field directly. And if forward_key is false
, the ime_process_key_event_cb() callback function receives the key event before the edit field.
[in] | keycode | The key code to be sent |
[in] | keymask | The modifier key mask |
[in] | forward_key | The flag to send the key event directly to the edit field |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
false
, the ime_process_key_event_cb() callback function can compose the text with the key events.int ime_send_private_command | ( | const char * | command | ) |
Sends a private command to the associated text input UI control.
This can be used by IME to deliver specific data to an application. The data format MUST be negotiated by both application and IME.
[in] | command | The UTF-8 string to be sent |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_candidate_visibility_state | ( | bool | visible | ) |
Enables whether candidate strings show or not.
[in] | visible | true if candidate strings show, false otherwise. |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_floating_drag_end | ( | void | ) |
Disallows the movement of the floating input panel window with the mouse pointer when the mouse is pressed.
This function must be called after invoking ime_set_floating_drag_start(). Otherwise the call is ignored.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_floating_drag_start | ( | void | ) |
Allows the floating input panel window to move along with the mouse pointer when the mouse is pressed.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_floating_mode | ( | bool | floating_mode | ) |
Sets the floating mode or not.
[in] | floating_mode | true - floating mode on, false - floating mode off |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_selection | ( | int | start, |
int | end | ||
) |
Requests to set selection.
[in] | start | The start cursor position in text (in characters not bytes) |
[in] | end | The end cursor position in text (in characters not bytes) |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_set_size | ( | int | portrait_width, |
int | portrait_height, | ||
int | landscape_width, | ||
int | landscape_height | ||
) |
Updates the input panel window's size information.
[in] | portrait_width | The width in portrait mode |
[in] | portrait_height | The height in portrait mode |
[in] | landscape_width | The width in landscape mode |
[in] | landscape_height | The height in landscape mode |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_show_preedit_string | ( | void | ) |
Requests to show preedit string.
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_update_input_panel_event | ( | ime_event_type_e | type, |
unsigned int | value | ||
) |
Updates the state of input panel event.
[in] | type | The input panel event type |
[in] | value | The value of event type |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
int ime_update_preedit_string | ( | const char * | str, |
Eina_List * | attrs | ||
) |
Updates a new preedit string.
[in] | str | The UTF-8 string to be updated in preedit |
[in] | attrs | The Eina_List which has ime_preedit_attribute lists; str can be composed of multiple string attributes: underline, highlight color and reversal color. The attrs will be released internally on success and it can be NULL if no attributes to set |
IME_ERROR_NONE | No error |
IME_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function. |
IME_ERROR_INVALID_PARAMETER | Invalid parameter |
IME_ERROR_NOT_RUNNING | IME main loop is not started yet |
{ int ret; Eina_List *list = NULL; ime_preedit_attribute *attr = calloc(1, sizeof(ime_preedit_attribute)); attr->start = 0; attr->length = 1; attr->type = IME_ATTR_FONTSTYLE; attr->value = IME_ATTR_FONTSTYLE_UNDERLINE; list = eina_list_append(list, attr); attr = calloc(1, sizeof(ime_preedit_attribute)); attr->start = 1; attr->length = 1; attr->type = IME_ATTR_FONTSTYLE; attr->value = IME_ATTR_FONTSTYLE_HIGHLIGHT; list = eina_list_append(list, attr); attr = calloc(1, sizeof(ime_preedit_attribute)); attr->start = 2; attr->length = 1; attr->type = IME_ATTR_FONTSTYLE; attr->value = IME_ATTR_FONTSTYLE_REVERSAL; list = eina_list_append(list, attr); ret = ime_update_preedit_string("abcd", list); if (ret != IME_ERROR_NONE) { EINA_LIST_FREE(list, attr) free(attr); } }