Ecore Input Method Context Functions

Functions that operate on Ecore Input Method Context objects. More...

Typedefs

typedef struct _Ecore_IMF_Context Ecore_IMF_Context
 An Input Method Context.
typedef struct
_Ecore_IMF_Context_Class 
Ecore_IMF_Context_Class
 An Input Method Context class.
typedef struct
_Ecore_IMF_Context_Info 
Ecore_IMF_Context_Info
 An Input Method Context info.

Enumerations

enum  Ecore_IMF_Callback_Type {
  ECORE_IMF_CALLBACK_PREEDIT_START,
  ECORE_IMF_CALLBACK_PREEDIT_END,
  ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
  ECORE_IMF_CALLBACK_COMMIT,
  ECORE_IMF_CALLBACK_DELETE_SURROUNDING
}
 Ecore IMF Event callback types. More...
enum  Ecore_IMF_Event_Type {
  ECORE_IMF_EVENT_MOUSE_DOWN,
  ECORE_IMF_EVENT_MOUSE_UP,
  ECORE_IMF_EVENT_MOUSE_IN,
  ECORE_IMF_EVENT_MOUSE_OUT,
  ECORE_IMF_EVENT_MOUSE_MOVE,
  ECORE_IMF_EVENT_MOUSE_WHEEL,
  ECORE_IMF_EVENT_KEY_DOWN,
  ECORE_IMF_EVENT_KEY_UP
}
 Ecore IMF event types. More...
enum  Ecore_IMF_Keyboard_Modifiers {
  ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0,
  ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0,
  ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1,
  ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2,
  ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3
}
enum  Ecore_IMF_Keyboard_Locks {
  ECORE_IMF_KEYBOARD_LOCK_NONE = 0,
  ECORE_IMF_KEYBOARD_LOCK_NUM = 1 << 0,
  ECORE_IMF_KEYBOARD_LOCK_CAPS = 1 << 1,
  ECORE_IMF_KEYBOARD_LOCK_SCROLL = 1 << 2
}
enum  Ecore_IMF_Mouse_Flags {
  ECORE_IMF_MOUSE_NONE = 0,
  ECORE_IMF_MOUSE_DOUBLE_CLICK = 1 << 0,
  ECORE_IMF_MOUSE_TRIPLE_CLICK = 1 << 1
}
enum  Ecore_IMF_Preedit_Type {
  ECORE_IMF_PREEDIT_TYPE_NONE,
  ECORE_IMF_PREEDIT_TYPE_SUB1,
  ECORE_IMF_PREEDIT_TYPE_SUB2,
  ECORE_IMF_PREEDIT_TYPE_SUB3
}
 Ecore IMF Preedit style types. More...
enum  Ecore_IMF_Autocapital_Type {
  ECORE_IMF_AUTOCAPITAL_TYPE_NONE,
  ECORE_IMF_AUTOCAPITAL_TYPE_WORD,
  ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,
  ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER
}
 Autocapitalization Types. More...
enum  Ecore_IMF_Input_Panel_Layout {
  ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,
  ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,
  ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,
  ECORE_IMF_INPUT_PANEL_LAYOUT_URL,
  ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,
  ECORE_IMF_INPUT_PANEL_LAYOUT_IP,
  ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,
  ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,
  ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID,
  ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,
  ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,
  ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD
}
 Input panel (virtual keyboard) layout types. More...
enum  Ecore_IMF_Input_Panel_Lang {
  ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,
  ECORE_IMF_INPUT_PANEL_LANG_ALPHABET
}
 Input panel (virtual keyboard) language modes. More...
enum  Ecore_IMF_Input_Panel_Return_Key_Type {
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,
  ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND
}
 "Return" Key types on the input panel (virtual keyboard). More...

Functions

EAPI int ecore_imf_init (void)
 Initialises the Ecore_IMF library.
EAPI int ecore_imf_shutdown (void)
 Shuts down the Ecore_IMF library.
EAPI Eina_List * ecore_imf_context_available_ids_get (void)
 Get the list of the available Input Method Context ids.
EAPI const char * ecore_imf_context_default_id_get (void)
 Get the id of the default Input Method Context.
EAPI const Ecore_IMF_Context_Infoecore_imf_context_info_by_id_get (const char *id)
 Retrieve the info for the Input Method Context with id.
EAPI Ecore_IMF_Contextecore_imf_context_add (const char *id)
 Create a new Input Method Context defined by the given id.
EAPI const Ecore_IMF_Context_Infoecore_imf_context_info_get (Ecore_IMF_Context *ctx)
 Retrieve the info for the given Input Method Context.
EAPI void ecore_imf_context_del (Ecore_IMF_Context *ctx)
 Delete the given Input Method Context and free its memory.
EAPI void ecore_imf_context_client_window_set (Ecore_IMF_Context *ctx, void *window)
 Set the client window for the Input Method Context; this is the Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
EAPI void * ecore_imf_context_client_window_get (Ecore_IMF_Context *ctx)
 Get the client window of the Input Method Context.
EAPI void ecore_imf_context_client_canvas_set (Ecore_IMF_Context *ctx, void *canvas)
 Set the client canvas for the Input Method Context; this is the canvas in which the input appears.
EAPI void * ecore_imf_context_client_canvas_get (Ecore_IMF_Context *ctx)
 Get the client canvas of the Input Method Context.
EAPI void ecore_imf_context_show (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to show itself.
EAPI void ecore_imf_context_hide (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to hide itself.
EAPI void ecore_imf_context_preedit_string_get (Ecore_IMF_Context *ctx, char **str, int *cursor_pos)
 Retrieve the current preedit string and cursor position for the Input Method Context.
EAPI void ecore_imf_context_preedit_string_with_attributes_get (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos)
 Retrieve the current preedit string, attributes and cursor position for the Input Method Context.
EAPI void ecore_imf_context_focus_in (Ecore_IMF_Context *ctx)
 Notify the Input Method Context that the widget to which its correspond has gained focus.
EAPI void ecore_imf_context_focus_out (Ecore_IMF_Context *ctx)
 Notify the Input Method Context that the widget to which its correspond has lost focus.
EAPI void ecore_imf_context_reset (Ecore_IMF_Context *ctx)
 Notify the Input Method Context that a change such as a change in cursor position has been made.
EAPI void ecore_imf_context_cursor_position_set (Ecore_IMF_Context *ctx, int cursor_pos)
 Notify the Input Method Context that a change in the cursor position has been made.
EAPI void ecore_imf_context_cursor_location_set (Ecore_IMF_Context *ctx, int x, int y, int w, int h)
 Notify the Input Method Context that a change in the cursor location has been made.
EAPI void ecore_imf_context_use_preedit_set (Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
 Set whether the IM context should use the preedit string to display feedback.
EAPI void ecore_imf_context_retrieve_surrounding_callback_set (Ecore_IMF_Context *ctx, Eina_Bool(*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data)
 Set the callback to be used on get_surrounding request.
EAPI void ecore_imf_context_input_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
 Set the input mode used by the Ecore Input Context.
EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get (Ecore_IMF_Context *ctx)
 Get the input mode being used by the Ecore Input Context.
EAPI Eina_Bool ecore_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
 Allow an Ecore Input Context to internally handle an event.
EAPI Ecore_IMF_Contextecore_imf_context_new (const Ecore_IMF_Context_Class *ctxc)
 Creates a new Input Method Context with klass specified by ctxc.
EAPI void ecore_imf_context_data_set (Ecore_IMF_Context *ctx, void *data)
 Set the Input Method Context specific data.
EAPI void * ecore_imf_context_data_get (Ecore_IMF_Context *ctx)
 Get the Input Method Context specific data.
EAPI Eina_Bool ecore_imf_context_surrounding_get (Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
 Retrieve context around insertion point.
EAPI void ecore_imf_context_preedit_start_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
EAPI void ecore_imf_context_preedit_end_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
EAPI void ecore_imf_context_preedit_changed_event_add (Ecore_IMF_Context *ctx)
 Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
EAPI void ecore_imf_context_commit_event_add (Ecore_IMF_Context *ctx, const char *str)
 Adds ECORE_IMF_EVENT_COMMIT to the event queue.
EAPI 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.
EAPI void ecore_imf_context_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)
 Add (register) a callback function to a given context event.
EAPI void * ecore_imf_context_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func)
 Delete (unregister) a callback function registered to a given context event.
EAPI void ecore_imf_context_event_callback_call (Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info)
 Call a given callback on the context ctx.
EAPI void ecore_imf_context_prediction_allow_set (Ecore_IMF_Context *ctx, Eina_Bool prediction)
 Set whether the IM context should allow to use the text prediction.
EAPI Eina_Bool ecore_imf_context_prediction_allow_get (Ecore_IMF_Context *ctx)
 Get whether the IM context should allow to use the text prediction.
EAPI void ecore_imf_context_autocapital_type_set (Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type)
 Set the autocapitalization type on the immodule.
EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get (Ecore_IMF_Context *ctx)
 Get the autocapitalization type.
EAPI void ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to show the control panel of using Input Method.
EAPI void ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to hide the control panel of using Input Method.
EAPI void ecore_imf_context_input_panel_show (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to show the input panel (virtual keyboard).
EAPI void ecore_imf_context_input_panel_hide (Ecore_IMF_Context *ctx)
 Ask the Input Method Context to hide the input panel.
EAPI void ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
 Set the layout of the input panel.
EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx)
 Get the layout of the current active input panel.
EAPI void ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
 Set the language of the input panel.
EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx)
 Get the language of the input panel.
EAPI void ecore_imf_context_input_panel_enabled_set (Ecore_IMF_Context *ctx, Eina_Bool enabled)
 Set whether the Input Method Context should request to show the input panel automatically when the widget has focus.
EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get (Ecore_IMF_Context *ctx)
 Get whether the Input Method Context requests to show the input panel automatically.
EAPI void ecore_imf_context_input_panel_imdata_set (Ecore_IMF_Context *ctx, const void *data, int len)
 Set the input panel-specific data to deliver to the input panel.
EAPI void ecore_imf_context_input_panel_imdata_get (Ecore_IMF_Context *ctx, void *data, int *len)
 Get the specific data of the current active input panel.
EAPI void ecore_imf_context_input_panel_return_key_type_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type)
 Set the "return" key type.
EAPI
Ecore_IMF_Input_Panel_Return_Key_Type 
ecore_imf_context_input_panel_return_key_type_get (Ecore_IMF_Context *ctx)
 Get the "return" key type.
EAPI void ecore_imf_context_input_panel_return_key_disabled_set (Ecore_IMF_Context *ctx, Eina_Bool disabled)
 Set the return key on the input panel to be disabled.
EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get (Ecore_IMF_Context *ctx)
 Get whether the return key on the input panel should be disabled or not.
EAPI void ecore_imf_context_input_panel_caps_lock_mode_set (Ecore_IMF_Context *ctx, Eina_Bool mode)
 Set the caps lock mode on the input panel.
EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get (Ecore_IMF_Context *ctx)
 Get the caps lock mode on the input panel.

Detailed Description

Functions that operate on Ecore Input Method Context objects.


Enumeration Type Documentation

Autocapitalization Types.

See also:
ecore_imf_context_autocapital_type_set()
Enumerator:
ECORE_IMF_AUTOCAPITAL_TYPE_NONE 

No auto-capitalization when typing.

ECORE_IMF_AUTOCAPITAL_TYPE_WORD 

Autocapitalize each word typed.

ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE 

Autocapitalize the start of each sentence.

ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER 

Autocapitalize all letters.

Ecore IMF Event callback types.

See also:
ecore_imf_context_event_callback_add()
Enumerator:
ECORE_IMF_CALLBACK_PREEDIT_START 

"PREEDIT_START" is called when a new preediting sequence starts.

ECORE_IMF_CALLBACK_PREEDIT_END 

"PREEDIT_END" is called when a preediting sequence has been completed or canceled.

ECORE_IMF_CALLBACK_PREEDIT_CHANGED 

"PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed.

ECORE_IMF_CALLBACK_COMMIT 

"COMMIT" is called when a complete input sequence has been entered by the user

ECORE_IMF_CALLBACK_DELETE_SURROUNDING 

"DELETE_SURROUNDING" is called when the input method needs to delete all or part of the context surrounding the cursor

Ecore IMF event types.

See also:
ecore_imf_context_filter_event()
Enumerator:
ECORE_IMF_EVENT_MOUSE_DOWN 

Mouse Down event.

ECORE_IMF_EVENT_MOUSE_UP 

Mouse Up event.

ECORE_IMF_EVENT_MOUSE_IN 

Mouse In event.

ECORE_IMF_EVENT_MOUSE_OUT 

Mouse Out event.

ECORE_IMF_EVENT_MOUSE_MOVE 

Mouse Move event.

ECORE_IMF_EVENT_MOUSE_WHEEL 

Mouse Wheel event.

ECORE_IMF_EVENT_KEY_DOWN 

Key Down event.

ECORE_IMF_EVENT_KEY_UP 

Key Up event.

Input panel (virtual keyboard) language modes.

See also:
ecore_imf_context_input_panel_language_set()
Enumerator:
ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC 

Automatic.

Since:
1.2
ECORE_IMF_INPUT_PANEL_LANG_ALPHABET 

Alphabet.

Since:
1.2

Input panel (virtual keyboard) layout types.

See also:
ecore_imf_context_input_panel_layout_set()
Enumerator:
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL 

Default layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER 

Number layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL 

Email layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_URL 

URL layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER 

Phone Number layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_IP 

IP layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH 

Month layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY 

Number Only layout.

ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID 

Never use this.

ECORE_IMF_INPUT_PANEL_LAYOUT_HEX 

Hexadecimal layout.

Since:
1.2
ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL 

Command-line terminal layout.

Since:
1.2
ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD 

Like normal, but no auto-correct, no auto-capitalization etc.

Since:
1.2

"Return" Key types on the input panel (virtual keyboard).

See also:
ecore_imf_context_input_panel_return_key_type_set()
Enumerator:
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT 

Default.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE 

Done.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO 

Go.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN 

Join.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN 

Login.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT 

Next.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH 

Search or magnifier icon.

Since:
1.2
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND 

Send.

Since:
1.2
Enumerator:
ECORE_IMF_KEYBOARD_LOCK_NONE 

No locks are active.

ECORE_IMF_KEYBOARD_LOCK_NUM 

"Num" lock is active

ECORE_IMF_KEYBOARD_LOCK_CAPS 

"Caps" lock is active

ECORE_IMF_KEYBOARD_LOCK_SCROLL 

"Scroll" lock is active

Enumerator:
ECORE_IMF_KEYBOARD_MODIFIER_NONE 

No active modifiers.

ECORE_IMF_KEYBOARD_MODIFIER_CTRL 

"Control" is pressed

ECORE_IMF_KEYBOARD_MODIFIER_ALT 

"Alt" is pressed

ECORE_IMF_KEYBOARD_MODIFIER_SHIFT 

"Shift" is pressed

ECORE_IMF_KEYBOARD_MODIFIER_WIN 

"Win" (between "Ctrl" and "Alt") is pressed

Enumerator:
ECORE_IMF_MOUSE_NONE 

A single click.

ECORE_IMF_MOUSE_DOUBLE_CLICK 

A double click.

ECORE_IMF_MOUSE_TRIPLE_CLICK 

A triple click.

Ecore IMF Preedit style types.

See also:
ecore_imf_context_preedit_string_with_attributes_get()
Enumerator:
ECORE_IMF_PREEDIT_TYPE_NONE 

None style.

ECORE_IMF_PREEDIT_TYPE_SUB1 

Substring style 1.

ECORE_IMF_PREEDIT_TYPE_SUB2 

Substring style 2.

ECORE_IMF_PREEDIT_TYPE_SUB3 

Substring style 3.


Function Documentation

EAPI Ecore_IMF_Context * ecore_imf_context_add ( const char *  id)

Create a new Input Method Context defined by the given id.

Parameters:
idThe Input Method Context id.
Returns:
A newly allocated Input Method Context; on failure it returns NULL.

References ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE, ecore_imf_context_autocapital_type_set(), ecore_imf_context_input_mode_set(), ecore_imf_context_input_panel_enabled_set(), ecore_imf_context_input_panel_layout_set(), ecore_imf_context_prediction_allow_set(), ecore_imf_context_use_preedit_set(), and ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL.

EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get ( Ecore_IMF_Context ctx)

Get the autocapitalization type.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
The autocapital type being used by ctx.
Since:
1.1.0

References ECORE_IMF_AUTOCAPITAL_TYPE_NONE.

EAPI void ecore_imf_context_autocapital_type_set ( Ecore_IMF_Context ctx,
Ecore_IMF_Autocapital_Type  autocapital_type 
)

Set the autocapitalization type on the immodule.

Parameters:
ctxAn Ecore_IMF_Context.
autocapital_typethe autocapitalization type.
Since:
1.1.0

Referenced by ecore_imf_context_add().

EAPI Eina_List * ecore_imf_context_available_ids_get ( void  )

Get the list of the available Input Method Context ids.

Note that the caller is responsible for freeing the Eina_List when finished with it. There is no need to finish the list strings.

Returns:
Return an Eina_List of strings; on failure it returns NULL.
EAPI void * ecore_imf_context_client_canvas_get ( Ecore_IMF_Context ctx)

Get the client canvas of the Input Method Context.

See ecore_imf_context_client_canvas_set for more details.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
Return the client canvas.
Since:
1.1.0
EAPI void ecore_imf_context_client_canvas_set ( Ecore_IMF_Context ctx,
void *  canvas 
)

Set the client canvas for the Input Method Context; this is the canvas in which the input appears.

The canvas type can be determined by using the context canvas type. Actually only canvas with type "evas" (Evas *) is supported. This canvas may be used in order to correctly position status windows, and may also be used for purposes internal to the Input Method Context.

Parameters:
ctxAn Ecore_IMF_Context.
canvasThe client canvas. This may be NULL to indicate that the previous client canvas no longer exists.
EAPI void * ecore_imf_context_client_window_get ( Ecore_IMF_Context ctx)

Get the client window of the Input Method Context.

See ecore_imf_context_client_window_set for more details.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
Return the client window.
Since:
1.1.0
EAPI void ecore_imf_context_client_window_set ( Ecore_IMF_Context ctx,
void *  window 
)

Set the client window for the Input Method Context; this is the Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.

This window is used in order to correctly position status windows, and may also be used for purposes internal to the Input Method Context.

Parameters:
ctxAn Ecore_IMF_Context.
windowThe client window. This may be NULL to indicate that the previous client window no longer exists.
EAPI void ecore_imf_context_commit_event_add ( Ecore_IMF_Context ctx,
const char *  str 
)

Adds ECORE_IMF_EVENT_COMMIT to the event queue.

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.

References ecore_event_add().

EAPI void ecore_imf_context_control_panel_hide ( Ecore_IMF_Context ctx)

Ask the Input Method Context to hide the control panel of using Input Method.

Parameters:
ctxAn Ecore_IMF_Context.
Since:
1.1.0
EAPI void ecore_imf_context_control_panel_show ( Ecore_IMF_Context ctx)

Ask the Input Method Context to show the control panel of using Input Method.

Parameters:
ctxAn Ecore_IMF_Context.
Since:
1.1.0
EAPI void ecore_imf_context_cursor_location_set ( Ecore_IMF_Context ctx,
int  x,
int  y,
int  w,
int  h 
)

Notify the Input Method Context that a change in the cursor location has been made.

The location is relative to the canvas. The cursor location can be used to determine the position of candidate word window in the immodule.

Parameters:
ctxAn Ecore_IMF_Context.
xcursor x position.
ycursor y position.
wcursor width.
hcursor height.
Since:
1.1.0
EAPI void ecore_imf_context_cursor_position_set ( Ecore_IMF_Context ctx,
int  cursor_pos 
)

Notify the Input Method Context that a change in the cursor position has been made.

Parameters:
ctxAn Ecore_IMF_Context.
cursor_posNew cursor position in characters.
EAPI void* ecore_imf_context_data_get ( Ecore_IMF_Context ctx)

Get 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.
EAPI void ecore_imf_context_data_set ( Ecore_IMF_Context ctx,
void *  data 
)

Set 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.
EAPI const char * ecore_imf_context_default_id_get ( void  )

Get the id of the default Input Method Context.

The id may to used to create a new instance of an Input Method Context object.

Returns:
Return a string containing the id of the default Input Method Context; on failure it returns NULL.
EAPI void ecore_imf_context_del ( Ecore_IMF_Context ctx)

Delete the given Input Method Context and free its memory.

Parameters:
ctxAn Ecore_IMF_Context.
EAPI 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.

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.

References ecore_event_add().

EAPI void ecore_imf_context_event_callback_add ( Ecore_IMF_Context ctx,
Ecore_IMF_Callback_Type  type,
Ecore_IMF_Event_Cb  func,
const void *  data 
)

Add (register) a callback function to a given context event.

This function adds a function callback to the context ctx when the event of type type occurs on it. The function pointer is func.

The event type type to trigger the function may be one of ECORE_IMF_CALLBACK_PREEDIT_START, ECORE_IMF_CALLBACK_PREEDIT_END, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, ECORE_IMF_CALLBACK_COMMIT and ECORE_IMF_CALLBACK_DELETE_SURROUNDING.

Parameters:
ctxEcore_IMF_Context to attach a callback to.
typeThe type of event that will trigger the callback
funcThe (callback) function to be called when the event is triggered
dataThe data pointer to be passed to func
Since:
1.2.0

Example

 static void
 _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
 {
    char *commit_str = event_info;
    // something to do
 }

 ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
EAPI void ecore_imf_context_event_callback_call ( Ecore_IMF_Context ctx,
Ecore_IMF_Callback_Type  type,
void *  event_info 
)

Call 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:
1.2.0
EAPI void * ecore_imf_context_event_callback_del ( Ecore_IMF_Context ctx,
Ecore_IMF_Callback_Type  type,
Ecore_IMF_Event_Cb  func 
)

Delete (unregister) a callback function registered to a given context event.

This function removes a function callback from the context ctx when the event of type type occurs on it. The function pointer is func.

See also:
ecore_imf_context_event_callback_add() for more details
Parameters:
ctxEcore_IMF_Context to remove a callback from.
typeThe type of event that was triggering the callback
funcThe (callback) function that was to be called when the event was triggered
Returns:
the data pointer
Since:
1.2.0
EAPI Eina_Bool ecore_imf_context_filter_event ( Ecore_IMF_Context ctx,
Ecore_IMF_Event_Type  type,
Ecore_IMF_Event *  event 
)

Allow an Ecore Input Context to internally handle an event.

If this function returns EINA_TRUE, then no further processing should be done for this event.

Input methods must be able to accept all types of events (simply returning EINA_FALSE if the event was not handled), but there is no obligation of any events to be submitted to this function.

Parameters:
ctxAn Ecore_IMF_Context.
typeThe type of event defined by Ecore_IMF_Event_Type.
eventThe event itself.
Returns:
EINA_TRUE if the event was handled; otherwise EINA_FALSE.

Example

 static void
 _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
    Evas_Event_Key_Down *ev = event_info;
    if (!ev->keyname) return;

    if (imf_context)
      {
         Ecore_IMF_Event_Key_Down ecore_ev;
         ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
         if (ecore_imf_context_filter_event(imf_context,
                                            ECORE_IMF_EVENT_KEY_DOWN,
                                            (Ecore_IMF_Event *)&ecore_ev))
           return;
      }
 }

 evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
EAPI void ecore_imf_context_focus_in ( Ecore_IMF_Context ctx)

Notify the Input Method Context that the widget to which its correspond has gained focus.

Parameters:
ctxAn Ecore_IMF_Context.

Example

 static void
 _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 {
    ecore_imf_context_reset(imf_context);
    ecore_imf_context_focus_in(imf_context);
 }

 evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, ed);
EAPI void ecore_imf_context_focus_out ( Ecore_IMF_Context ctx)

Notify the Input Method Context that the widget to which its correspond has lost focus.

Parameters:
ctxAn Ecore_IMF_Context.

Example

 static void
 _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 {
    ecore_imf_context_reset(imf_context);
    ecore_imf_context_focus_out(imf_context);
 }

 evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
EAPI void ecore_imf_context_hide ( Ecore_IMF_Context ctx)

Ask the Input Method Context to hide itself.

Parameters:
ctxAn Ecore_IMF_Context.
EAPI const Ecore_IMF_Context_Info * ecore_imf_context_info_by_id_get ( const char *  id)

Retrieve the info for the Input Method Context with id.

Parameters:
idThe Input Method Context id to query for.
Returns:
Return a Ecore_IMF_Context_Info for the Input Method Context with id; on failure it returns NULL.

Example

 const char *ctx_id;
 const Ecore_IMF_Context_Info *ctx_info;
 Ecore_IMF_Context *imf_context;
 ctx_id = ecore_imf_context_default_id_get();
 if (ctx_id)
   {
      ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
      if (!ctx_info->canvas_type ||
          strcmp(ctx_info->canvas_type, "evas") == 0)
        {
           imf_context = ecore_imf_context_add(ctx_id);
        }
      else
        {
           ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
           if (ctx_id)
             {
                imf_context = ecore_imf_context_add(ctx_id);
             }
        }
   }
EAPI const Ecore_IMF_Context_Info * ecore_imf_context_info_get ( Ecore_IMF_Context ctx)

Retrieve the info for the given Input Method Context.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
Return a Ecore_IMF_Context_Info for the given Input Method Context; on failure it returns NULL.
EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get ( Ecore_IMF_Context ctx)

Get the input mode being used by the Ecore Input Context.

See ecore_imf_context_input_mode_set for more details.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
The input mode being used by ctx.
EAPI void ecore_imf_context_input_mode_set ( Ecore_IMF_Context ctx,
Ecore_IMF_Input_Mode  input_mode 
)

Set the input mode used by the Ecore Input Context.

The input mode can be one of the input modes defined in #Ecore_IMF_Input_Mode. The default input mode is ECORE_IMF_INPUT_MODE_FULL.

Parameters:
ctxAn Ecore_IMF_Context.
input_modeThe input mode to be used by ctx.

Referenced by ecore_imf_context_add().

EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get ( Ecore_IMF_Context ctx)

Get the caps lock mode on the input panel.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
EINA_TRUE if the caps lock is turned on.
Since:
1.2.0
EAPI void ecore_imf_context_input_panel_caps_lock_mode_set ( Ecore_IMF_Context ctx,
Eina_Bool  mode 
)

Set the caps lock mode on the input panel.

Parameters:
ctxAn Ecore_IMF_Context.
modeTurn on caps lock on the input panel if EINA_TRUE
Since:
1.2.0
EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get ( Ecore_IMF_Context ctx)

Get whether the Input Method Context requests to show the input panel automatically.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
Return the attribute to show the input panel automatically
Since:
1.1.0
EAPI void ecore_imf_context_input_panel_enabled_set ( Ecore_IMF_Context ctx,
Eina_Bool  enabled 
)

Set whether the Input Method Context should request to show the input panel automatically when the widget has focus.

Parameters:
ctxAn Ecore_IMF_Context.
enabledIf true, the input panel will be shown when the widget is clicked or has focus.
Since:
1.1.0

Referenced by ecore_imf_context_add().

EAPI void ecore_imf_context_input_panel_hide ( Ecore_IMF_Context ctx)

Ask the Input Method Context to hide the input panel.

Parameters:
ctxAn Ecore_IMF_Context.
Since:
1.1.0
EAPI void ecore_imf_context_input_panel_imdata_get ( Ecore_IMF_Context ctx,
void *  data,
int *  len 
)

Get the specific data of the current active input panel.

Parameters:
ctxAn Ecore_IMF_Context.
dataThe specific data to be got from the input panel
lenThe length of data
Since:
1.2.0
EAPI void ecore_imf_context_input_panel_imdata_set ( Ecore_IMF_Context ctx,
const void *  data,
int  len 
)

Set the input panel-specific data to deliver to the input panel.

This API is used by applications to deliver specific data to the input panel. The data format MUST be negotiated by both application and the input panel. The size and format of data are defined by the input panel.

Parameters:
ctxAn Ecore_IMF_Context.
dataThe specific data to be set to the input panel.
lenthe length of data, in bytes, to send to the input panel
Since:
1.2.0
EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get ( Ecore_IMF_Context ctx)

Get the language of the input panel.

See ecore_imf_context_input_panel_language_set for more details.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
Ecore_IMF_Input_Panel_Lang
Since:
1.1.0

References ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC.

EAPI void ecore_imf_context_input_panel_language_set ( Ecore_IMF_Context ctx,
Ecore_IMF_Input_Panel_Lang  lang 
)

Set the language of the input panel.

This API can be used when you want to show the English keyboard.

Parameters:
ctxAn Ecore_IMF_Context.
langthe language to be set to the input panel.
Since:
1.1.0
EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get ( Ecore_IMF_Context ctx)

Get the layout of the current active input panel.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
layout see Ecore_IMF_Input_Panel_Layout
Since:
1.1.0

References ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID.

EAPI void ecore_imf_context_input_panel_layout_set ( Ecore_IMF_Context ctx,
Ecore_IMF_Input_Panel_Layout  layout 
)

Set the layout of the input panel.

Parameters:
ctxAn Ecore_IMF_Context.
layoutsee Ecore_IMF_Input_Panel_Layout
Since:
1.1.0

Referenced by ecore_imf_context_add().

EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get ( Ecore_IMF_Context ctx)

Get whether the return key on the input panel should be disabled or not.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
EINA_TRUE if it should be disabled
Since:
1.2.0
EAPI void ecore_imf_context_input_panel_return_key_disabled_set ( Ecore_IMF_Context ctx,
Eina_Bool  disabled 
)

Set the return key on the input panel to be disabled.

Parameters:
ctxAn Ecore_IMF_Context.
disabledThe state
Since:
1.2.0
EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get ( Ecore_IMF_Context ctx)

Get the "return" key type.

See also:
ecore_imf_context_input_panel_return_key_type_set() for more details
Parameters:
ctxAn Ecore_IMF_Context.
Returns:
The type of "return" key on the input panel
Since:
1.2.0
EAPI void ecore_imf_context_input_panel_return_key_type_set ( Ecore_IMF_Context ctx,
Ecore_IMF_Input_Panel_Return_Key_Type  return_key_type 
)

Set the "return" key type.

This type is used to set string or icon on the "return" key of the input panel.

An input panel displays the string or icon associated with this type

Parameters:
ctxAn Ecore_IMF_Context.
return_key_typeThe type of "return" key on the input panel
Since:
1.2.0
EAPI void ecore_imf_context_input_panel_show ( Ecore_IMF_Context ctx)

Ask the Input Method Context to show the input panel (virtual keyboard).

Parameters:
ctxAn Ecore_IMF_Context.
Since:
1.1.0
EAPI Ecore_IMF_Context* ecore_imf_context_new ( const Ecore_IMF_Context_Class ctxc)

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.
EAPI Eina_Bool ecore_imf_context_prediction_allow_get ( Ecore_IMF_Context ctx)

Get whether the IM context should allow to use the text prediction.

Parameters:
ctxAn Ecore_IMF_Context.
Returns:
EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE.
Since:
1.1.0
EAPI void ecore_imf_context_prediction_allow_set ( Ecore_IMF_Context ctx,
Eina_Bool  prediction 
)

Set whether the IM context should allow to use the text prediction.

If prediction is EINA_FALSE (default is EINA_TRUE), then the IM context will not display the text prediction window.

Parameters:
ctxAn Ecore_IMF_Context.
predictionWhether the IM context should allow to use the text prediction.
Since:
1.1.0

Referenced by ecore_imf_context_add().

EAPI void ecore_imf_context_preedit_changed_event_add ( Ecore_IMF_Context ctx)

Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.

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.

References ecore_event_add().

EAPI void ecore_imf_context_preedit_end_event_add ( Ecore_IMF_Context ctx)

Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.

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.

References ecore_event_add().

EAPI void ecore_imf_context_preedit_start_event_add ( Ecore_IMF_Context ctx)

Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.

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.

References ecore_event_add().

EAPI void ecore_imf_context_preedit_string_get ( Ecore_IMF_Context ctx,
char **  str,
int *  cursor_pos 
)

Retrieve the current preedit string and cursor position for the Input Method Context.

Parameters:
ctxAn Ecore_IMF_Context.
strLocation to store the retrieved string. The string retrieved must be freed with free().
cursor_posLocation to store position of cursor (in characters) within the preedit string.
EAPI void ecore_imf_context_preedit_string_with_attributes_get ( Ecore_IMF_Context ctx,
char **  str,
Eina_List **  attrs,
int *  cursor_pos 
)

Retrieve the current preedit string, attributes and cursor position for the Input Method Context.

Parameters:
ctxAn Ecore_IMF_Context.
strLocation to store the retrieved string. The string retrieved must be freed with free().
attrsan Eina_List of attributes
cursor_posLocation to store position of cursor (in characters) within the preedit string.

Example

 char *preedit_string;
 int cursor_pos;
 Eina_List *attrs = NULL, *l = NULL;
 Ecore_IMF_Preedit_Attr *attr;

 ecore_imf_context_preedit_string_with_attributes_get(imf_context,
                                                      &preedit_string,
                                                      &attrs, &cursor_pos);
 if (!preedit_string) return;

  if (strlen(preedit_string) > 0)
    {
       if (attrs)
         {
            EINA_LIST_FOREACH(attrs, l, attr)
              {
                 if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
                   {
                      // Something to do
                   }
                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
                   {
                      // Something to do
                   }
                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
                   {
                      // Something to do
                   }
              }
         }
    }
 
 // delete attribute list
 if (attrs)
   {
      EINA_LIST_FREE(attrs, attr) free(attr);
   }

 free(preedit_string);
Since:
1.1.0
EAPI void ecore_imf_context_reset ( Ecore_IMF_Context ctx)

Notify the Input Method Context that a change such as a change in cursor position has been made.

This will typically cause the Input Method Context to clear the preedit state.

Parameters:
ctxAn Ecore_IMF_Context.

Example

 static void
 _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 {
    ecore_imf_context_reset(imf_context);
    ecore_imf_context_focus_out(imf_context);
 }

 evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
EAPI void ecore_imf_context_retrieve_surrounding_callback_set ( Ecore_IMF_Context ctx,
Eina_Bool(*)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos)  func,
const void *  data 
)

Set the callback to be used on get_surrounding request.

This callback will be called when the Input Method Context module requests the surrounding context.

Parameters:
ctxAn Ecore_IMF_Context.
funcThe callback to be called.
dataThe data pointer to be passed to func
EAPI void ecore_imf_context_show ( Ecore_IMF_Context ctx)

Ask the Input Method Context to show itself.

Parameters:
ctxAn Ecore_IMF_Context.
EAPI Eina_Bool ecore_imf_context_surrounding_get ( Ecore_IMF_Context ctx,
char **  text,
int *  cursor_pos 
)

Retrieve context around insertion point.

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.
EAPI void ecore_imf_context_use_preedit_set ( Ecore_IMF_Context ctx,
Eina_Bool  use_preedit 
)

Set whether the IM context should use the preedit string to display feedback.

If use_preedit is EINA_FALSE (default is EINA_TRUE), then the IM context may use some other method to display feedback, such as displaying it in a child of the root window.

Parameters:
ctxAn Ecore_IMF_Context.
use_preeditWhether the IM context should use the preedit string.

Referenced by ecore_imf_context_add().

EAPI int ecore_imf_init ( void  )

Initialises the Ecore_IMF library.

Returns:
Number of times the library has been initialised without being shut down.

References ecore_event_type_new(), ecore_init(), and ecore_shutdown().

EAPI int ecore_imf_shutdown ( void  )

Shuts down the Ecore_IMF library.

Returns:
Number of times the library has been initialised without being shut down.

References ecore_shutdown().