Tizen(Headed) Native API  6.5
Ecore Input Method Context Module Functions

Functions that should be used by Ecore Input Method Context modules.

Functions

Ecore_IMF_Contextecore_imf_context_new (const Ecore_IMF_Context_Class *ctxc)
 Creates a new Input Method Context with klass specified by ctxc.
void ecore_imf_context_data_set (Ecore_IMF_Context *ctx, void *data)
void * ecore_imf_context_data_get (Ecore_IMF_Context *ctx)
 Gets the Input Method Context specific data.
Eina_Bool ecore_imf_context_surrounding_get (Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
 Retrieves context around insertion point. Input methods typically want context in order to constrain input text based on existing text; this is important for languages such as Thai where only some sequences of characters are allowed. In addition, the text around the insertion point can be used for supporting autocapital feature.
Eina_Bool ecore_imf_context_selection_get (Ecore_IMF_Context *ctx, char **text)
 Retrieves the selected text.
EINA_DEPRECATED void ecore_imf_context_preedit_start_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
EINA_DEPRECATED void ecore_imf_context_preedit_end_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
EINA_DEPRECATED void ecore_imf_context_preedit_changed_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
EINA_DEPRECATED void ecore_imf_context_commit_event_add (Ecore_IMF_Context *ctx, const char *str)
 Adds ECORE_IMF_EVENT_COMMIT to the event queue.
EINA_DEPRECATED void ecore_imf_context_delete_surrounding_event_add (Ecore_IMF_Context *ctx, int offset, int n_chars)
 Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
void ecore_imf_context_event_callback_call (Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info)
 Calls a given callback on the context ctx.

Function Documentation

Adds ECORE_IMF_EVENT_COMMIT to the event queue.

Deprecated:
Deprecated since 5.5. Use ecore_imf_context_event_callback_call() instead.

It's asynchronous method to put event to the event queue. ecore_imf_context_event_callback_call() can be used as synchronous method.

Parameters:
ctxAn Ecore_IMF_Context.
strThe committed string.
Since :
2.3.1

Gets the Input Method Context specific data.

See ecore_imf_context_data_set for more details.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
The Input Method Context specific data.
Since :
2.3.1
void ecore_imf_context_data_set ( Ecore_IMF_Context ctx,
void *  data 
)

Sets the Input Method Context specific data.

Note that this method should be used by modules to set the Input Method Context specific data and it's not meant to be used by applications to store application specific data.

Parameters:
ctxAn Ecore_IMF_Context.
dataThe Input Method Context specific data.
Returns:
A new Ecore_IMF_Context; on failure it returns NULL.
Since :
2.3.1
EINA_DEPRECATED void ecore_imf_context_delete_surrounding_event_add ( Ecore_IMF_Context ctx,
int  offset,
int  n_chars 
)

Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.

Deprecated:
Deprecated since 5.5. Use ecore_imf_context_event_callback_call() instead.

Asks the widget that the input context is attached to to delete characters around the cursor position by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue. Note that offset and n_chars are in characters not in bytes.

It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue. ecore_imf_context_event_callback_call() can be used as synchronous method.

Parameters:
ctxAn Ecore_IMF_Context.
offsetThe start offset of surrounding to be deleted.
n_charsThe number of characters to be deleted.
Since :
2.3.1
void ecore_imf_context_event_callback_call ( Ecore_IMF_Context ctx,
Ecore_IMF_Callback_Type  type,
void *  event_info 
)

Calls a given callback on the context ctx.

ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(), ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous because those API adds each event to the event queue.

This API provides the way to call each callback function immediately.

Parameters:
ctxEcore_IMF_Context.
typeThe type of event that will trigger the callback
event_infoThe pointer to event specific struct or information to pass to the callback functions registered on this event
Since (EFL) :
1.2.0
Since :
2.3.1

Creates a new Input Method Context with klass specified by ctxc.

This method should be used by modules implementing the Input Method Context interface.

Parameters:
ctxcAn Ecore_IMF_Context_Class.
Returns:
A new Ecore_IMF_Context; on failure it returns NULL.
Since :
2.3.1

Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.

Deprecated:
Deprecated since 5.5. Use ecore_imf_context_event_callback_call() instead.

It's asynchronous method to put event to the event queue. ecore_imf_context_event_callback_call() can be used as synchronous method.

Parameters:
ctxAn Ecore_IMF_Context.
Since :
2.3.1

Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.

Deprecated:
Deprecated since 5.5. Use ecore_imf_context_event_callback_call() instead.

ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled. It's asynchronous method to put event to the event queue. ecore_imf_context_event_callback_call() can be used as synchronous method.

Parameters:
ctxAn Ecore_IMF_Context.
Since :
2.3.1

Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.

Deprecated:
Deprecated since 5.5. Use ecore_imf_context_event_callback_call() instead.

ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts. It's asynchronous method to put event to the event queue. ecore_imf_context_event_callback_call() can be used as synchronous method.

Parameters:
ctxAn Ecore_IMF_Context.
Since :
2.3.1

Retrieves the selected text.

This function is implemented by calling the Ecore_IMF_Context::retrieve_selection_func ( set using ecore_imf_context_retrieve_selection_callback_set).

There is no obligation for a widget to respond to the retrieve_surrounding_func, so input methods must be prepared to function without context.

Parameters:
ctxAn Ecore_IMF_Context.
textLocation to store a UTF-8 encoded string of the selected text. If the function returns EINA_TRUE, then you must free the result stored in this location with free().
Returns:
EINA_TRUE if selected text was provided; otherwise EINA_FALSE.
Since (EFL) :
1.9.0
Since :
2.3.1
Eina_Bool ecore_imf_context_surrounding_get ( Ecore_IMF_Context ctx,
char **  text,
int *  cursor_pos 
)

Retrieves context around insertion point. Input methods typically want context in order to constrain input text based on existing text; this is important for languages such as Thai where only some sequences of characters are allowed. In addition, the text around the insertion point can be used for supporting autocapital feature.

This function is implemented by calling the Ecore_IMF_Context::retrieve_surrounding_func ( set using ecore_imf_context_retrieve_surrounding_callback_set).

There is no obligation for a widget to respond to the retrieve_surrounding_func, so input methods must be prepared to function without context.

Parameters:
ctxAn Ecore_IMF_Context.
textLocation to store a UTF-8 encoded string of text holding context around the insertion point. If the function returns EINA_TRUE, then you must free the result stored in this location with free().
cursor_posLocation to store the position in characters of the insertion cursor within text.
Returns:
EINA_TRUE if surrounding text was provided; otherwise EINA_FALSE.
Since :
2.3.1