1 #ifndef _ECORE_IMF_H
2 #define _ECORE_IMF_H
3 
4 #include <Eina.h>
5 
6 #ifdef EAPI
7 # undef EAPI
8 #endif
9 
10 #ifdef _WIN32
11 # ifdef EFL_BUILD
12 #  ifdef DLL_EXPORT
13 #   define EAPI __declspec(dllexport)
14 #  else
15 #   define EAPI
16 #  endif
17 # else
18 #  define EAPI __declspec(dllimport)
19 # endif
20 #else
21 # ifdef __GNUC__
22 #  if __GNUC__ >= 4
23 #   define EAPI __attribute__ ((visibility("default")))
24 #  else
25 #   define EAPI
26 #  endif
27 # else
28 #  define EAPI
29 # endif
30 #endif
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #define ECORE_IMF_INPUT_HINT_AUTOFILL_MASK 0xff00 /* @deprecated since 1.24 */
37 
38 /**
39  * @defgroup Ecore_IMF_Lib_Group Ecore_IMF - Ecore Input Method Library Functions
40  * @ingroup Ecore
41  *
42  * Utility functions that set up and shut down the Ecore Input Method
43  * library.
44  */
45 
46 /**
47  * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
48  * @ingroup Ecore_IMF_Lib_Group
49  *
50  * @section ecore_imf_intro Introduction
51  *
52  * Functions that operate on Ecore Input Method Context objects.
53 
54  * Ecore Input Method Context Function defines the interface for EFL input methods.
55  * An input method is used by EFL text input widgets like elm_entry
56  * (based on edje_entry) to map from key events to Unicode character strings.
57  *
58  * The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
59  * eg) export ECORE_IMF_MODULE=xim (or scim or ibus)
60  *
61  * An input method may consume multiple key events in sequence and finally output the composed result.
62  * This is called preediting, and an input method may provide feedback about
63  * this process by displaying the intermediate composition states as preedit text.
64  *
65  * Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
66  * ecore_imf_init() should be called to initialize and load immodule.@n
67  * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
68  *
69  * @section how-to-compose How to process key event for composition or prediction
70  *
71  * To input Chinese, Japanese, Korean and other complex languages, the editor widget (as known as entry) should be connected with input method framework.@n
72  * Each editor widget should have each input context to connect with input service framework.@n
73  * Key event is processed by input method engine. The result is notified to application through ECORE_IMF_CALLBACK_PREEDIT_CHANGED and ECORE_IMF_CALLBACK_COMMIT event.@n
74  * @n
75  * The following example demonstrates how to connect input method framework and handle preedit and commit string from input method framework.
76  * @li @ref ecore_imf_example_c
77  *
78  * @section media-content How to receive media contents from input method editor
79  *
80  * Users sometimes wants to send images and other rich content with their input method editor (as known as virtual keyboard or soft keyboard).@n
81  * According to this requirement, the way to receive the media content URI such as images and other rich content as well as text have been provided since 1.20.@n
82  * @n
83  * The following code shows how to receive the media content URI.
84  *
85  * @code
86  * #include <glib.h>
87  *
88  * static void
89  * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
90  * {
91  *    Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event_info;
92  *    if (!commit_content) return;
93  *
94  *    // convert URI to filename
95  *    gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
96  *    printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
97  *
98  *    // do something to use filepath
99  *
100  *    if (filepath)
101  *       g_free(filepath);
102  * }
103  *
104  * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
105  * @endcode
106  *
107  */
108 
109 /**
110  * @addtogroup Ecore_IMF_Context_Group
111  *
112  * @{
113  */
114 
115 /**
116  * @example ecore_imf_example.c
117  * Shows how to write simple editor using the Ecore_IMF library.
118  */
119 
120 /* ecore_imf_context_input_panel_event_callback_add() flag */
121 
122 /**
123  * @typedef Ecore_IMF_Input_Panel_Event
124  * Enum containing input panel events.
125  */
126 typedef enum
127 {
128    ECORE_IMF_INPUT_PANEL_STATE_EVENT,              /**< called when the state of the input panel is changed. @since 1.7 */
129    ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,           /**< called when the language of the input panel is changed. @since 1.7 */
130    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT,         /**< called when the shift key state of the input panel is changed @since 1.7 */
131    ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT,           /**< called when the size of the input panel is changed. @since 1.7 */
132    ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT,          /**< called when the state of the candidate word panel is changed. @since 1.7 */
133    ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT,       /**< called when the size of the candidate word panel is changed. @since 1.7 */
134    ECORE_IMF_INPUT_PANEL_KEYBOARD_MODE_EVENT       /**< called when the keyboard mode state of the input panel is changed @since 1.20 */
135 } Ecore_IMF_Input_Panel_Event;
136 
137 /**
138  * @typedef Ecore_IMF_Input_Panel_State
139  * Enum containing input panel state notifications.
140  */
141 typedef enum
142 {
143    ECORE_IMF_INPUT_PANEL_STATE_SHOW,        /**< Notification after the display of the input panel @since 1.7 */
144    ECORE_IMF_INPUT_PANEL_STATE_HIDE,        /**< Notification prior to the dismissal of the input panel @since 1.7 */
145    ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW    /**< Notification prior to the display of the input panel @since 1.7 */
146 } Ecore_IMF_Input_Panel_State;
147 
148 /**
149  * @typedef Ecore_IMF_Input_Panel_Shift_Mode
150  * Enum containing input shift mode states.
151  */
152 typedef enum
153 {
154     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF, /**< @since 1.7 */
155     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON   /**< @since 1.7 */
156 } Ecore_IMF_Input_Panel_Shift_Mode;
157 
158 /**
159  * @typedef Ecore_IMF_Candidate_Panel_State
160  * Enum containing candidate word panel state notifications.
161  */
162 typedef enum
163 {
164    ECORE_IMF_CANDIDATE_PANEL_SHOW,        /**< Notification after the display of the candidate word panel @since 1.7 */
165    ECORE_IMF_CANDIDATE_PANEL_HIDE         /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */
166 } Ecore_IMF_Candidate_Panel_State;
167 
168 /**
169  * @typedef Ecore_IMF_Input_Panel_Keyboard_Mode
170  * Enum containing keyboard mode states.
171  */
172 typedef enum
173 {
174    ECORE_IMF_INPUT_PANEL_HW_KEYBOARD_MODE, /**< @since 1.20 */
175    ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE  /**< @since 1.20 */
176 } Ecore_IMF_Input_Panel_Keyboard_Mode;
177 
178 /* Events sent by the Input Method */
179 typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
180 typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
181 typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
182 typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
183 typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
184 typedef struct _Ecore_IMF_Event_Selection          Ecore_IMF_Event_Selection;
185 typedef struct _Ecore_IMF_Event_Commit_Content     Ecore_IMF_Event_Commit_Content;
186 
187 /* Events to filter */
188 typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
189 typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
190 typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
191 typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
192 typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
193 typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
194 typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
195 typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
196 typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;
197 
198 typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
199 typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
200 typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */
201 
202 /* Preedit attribute info */
203 typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;
204 
205 EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
206 EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
207 EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
208 EAPI extern int ECORE_IMF_EVENT_COMMIT;
209 EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
210 
211 /**
212  * @typedef Ecore_IMF_Event_Cb
213  *
214  * @brief Called when a Ecore_IMF event happens.
215  *
216  * @see  ecore_imf_context_event_callback_add()
217  */
218 typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
219 
220 /**
221  * @typedef Ecore_IMF_Callback_Type
222  *
223  * Ecore IMF Event callback types.
224  *
225  * @see ecore_imf_context_event_callback_add()
226  */
227 typedef enum
228 {
229    ECORE_IMF_CALLBACK_PREEDIT_START,      /**< "PREEDIT_START" is called when a new preediting sequence starts. @since 1.2 */
230    ECORE_IMF_CALLBACK_PREEDIT_END,        /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. @since 1.2 */
231    ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. @since 1.2 */
232    ECORE_IMF_CALLBACK_COMMIT,             /**< "COMMIT" is called when a complete input sequence has been entered by the user @since 1.2 */
233    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 @since 1.2 */
234    ECORE_IMF_CALLBACK_SELECTION_SET,      /**< "SELECTION_SET" is called when the input method needs to set the selection @since 1.9 */
235    ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, /**< "PRIVATE_COMMAND_SEND" is called when the input method sends a private command @since 1.12 */
236    ECORE_IMF_CALLBACK_COMMIT_CONTENT,     /**< "COMMIT_CONTENT" is called when the input method commits content such as an image @since 1.20 */
237    ECORE_IMF_CALLBACK_TRANSACTION_START,  /**< "TRANSACTION_START" is called when a new transaction sequence starts. @since 1.21 */
238    ECORE_IMF_CALLBACK_TRANSACTION_END     /**< "TRANSACTION_END" is called when a new transaction sequence starts. @since 1.21 */
239 } Ecore_IMF_Callback_Type;
240 
241 /**
242  * @typedef Ecore_IMF_Event_Type
243  *
244  * Ecore IMF event types.
245  *
246  * @see ecore_imf_context_filter_event()
247  */
248 typedef enum
249 {
250    ECORE_IMF_EVENT_MOUSE_DOWN,  /**< Mouse Down event */
251    ECORE_IMF_EVENT_MOUSE_UP,    /**< Mouse Up event */
252    ECORE_IMF_EVENT_MOUSE_IN,    /**< Mouse In event */
253    ECORE_IMF_EVENT_MOUSE_OUT,   /**< Mouse Out event */
254    ECORE_IMF_EVENT_MOUSE_MOVE,  /**< Mouse Move event */
255    ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
256    ECORE_IMF_EVENT_KEY_DOWN,    /**< Key Down event */
257    ECORE_IMF_EVENT_KEY_UP       /**< Key Up event */
258 } Ecore_IMF_Event_Type;
259 /**
260  * @typedef Ecore_IMF_Keyboard_Modifiers
261  * Types for Ecore_IMF keyboard modifiers
262  */
263 typedef enum
264 {
265    ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
266    ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
267    ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
268    ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
269    ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
270    ECORE_IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4  /**< "AltGr" is pressed @since 1.7 */
271 } Ecore_IMF_Keyboard_Modifiers;
272 
273 /**
274  * @typedef Ecore_IMF_Keyboard_Locks
275  * Types for Ecore_IMF keyboard locks
276  */
277 typedef enum
278 {
279    ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
280    ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
281    ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
282    ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
283 } Ecore_IMF_Keyboard_Locks;
284 
285 /**
286  * @typedef Ecore_IMF_Mouse_Flags
287  * Types for Ecore_IMF mouse flags
288  */
289 typedef enum
290 {
291    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
292    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
293    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
294 } Ecore_IMF_Mouse_Flags;
295 
296 /**
297  * @typedef Ecore_IMF_Input_Mode
298  * Types for Ecore_IMF input mode
299  */
300 typedef enum
301 {
302    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
303    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
304    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
305    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
306    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
307    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
308    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
309    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
310 } Ecore_IMF_Input_Mode;
311 
312 /**
313  * @typedef Ecore_IMF_Preedit_Type
314  *
315  * Ecore IMF Preedit style types
316  *
317  * @see ecore_imf_context_preedit_string_with_attributes_get()
318  */
319 typedef enum
320 {
321    ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style @since 1.1 */
322    ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 @since 1.1 */
323    ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 @since 1.1 */
324    ECORE_IMF_PREEDIT_TYPE_SUB3, /**< Substring style 3 @since 1.1 */
325    ECORE_IMF_PREEDIT_TYPE_SUB4, /**< Substring style 4 @since 1.8 */
326    ECORE_IMF_PREEDIT_TYPE_SUB5, /**< Substring style 5 @since 1.8 */
327    ECORE_IMF_PREEDIT_TYPE_SUB6, /**< Substring style 6 @since 1.8 */
328    ECORE_IMF_PREEDIT_TYPE_SUB7  /**< Substring style 7 @since 1.8 */
329 } Ecore_IMF_Preedit_Type;
330 
331 /**
332  * @typedef Ecore_IMF_Autocapital_Type
333  *
334  * Autocapitalization Types.
335  *
336  * @see ecore_imf_context_autocapital_type_set()
337  */
338 typedef enum
339 {
340    ECORE_IMF_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing @since 1.1 */
341    ECORE_IMF_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed @since 1.1 */
342    ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence @since 1.1 */
343    ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters @since 1.1 */
344 } Ecore_IMF_Autocapital_Type;
345 
346 /**
347  * @typedef Ecore_IMF_Input_Panel_Layout
348  *
349  * Input panel (virtual keyboard) layout types.
350  *
351  * @see ecore_imf_context_input_panel_layout_set()
352  */
353 typedef enum
354 {
355    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default layout */
356    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
357    ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
358    ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
359    ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
360    ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
361    ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
362    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
363    ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID,         /**< Never use this */
364    ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,             /**< Hexadecimal layout @since 1.2 */
365    ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,        /**< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */
366    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD,        /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
367    ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME,        /**< Date and time layout @since 1.8 */
368    ECORE_IMF_INPUT_PANEL_LAYOUT_EMOTICON,        /**< Emoticon layout @since 1.10 */
369    ECORE_IMF_INPUT_PANEL_LAYOUT_VOICE            /**< Voice layout, but if the IME does not support voice layout, then normal layout will be shown @since 1.19 */
370 } Ecore_IMF_Input_Panel_Layout;
371 
372 /**
373  * @typedef Ecore_IMF_Input_Panel_Lang
374  *
375  * Input panel (virtual keyboard) language modes.
376  *
377  * @see ecore_imf_context_input_panel_language_set()
378  */
379 typedef enum
380 {
381    ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic @since 1.2 */
382    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet @since 1.2 */
383 } Ecore_IMF_Input_Panel_Lang;
384 
385 /**
386  * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
387  *
388  * "Return" Key types on the input panel (virtual keyboard).
389  *
390  * @see ecore_imf_context_input_panel_return_key_type_set()
391  */
392 typedef enum
393 {
394    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
395    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done @since 1.2 */
396    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go @since 1.2 */
397    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join @since 1.2 */
398    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login @since 1.2 */
399    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next @since 1.2 */
400    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search or magnifier icon @since 1.2 */
401    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND,    /**< Send @since 1.2 */
402    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN   /**< Sign-in @since 1.8 */
403 } Ecore_IMF_Input_Panel_Return_Key_Type;
404 
405 /**
406  * @typedef Ecore_IMF_Input_Hints
407  * @brief Enumeration for defining the types of Ecore_IMF Input Hints.
408  * @since 1.12
409  */
410 typedef enum
411 {
412    ECORE_IMF_INPUT_HINT_NONE                = 0,        /**< No active hints @since 1.12 */
413    ECORE_IMF_INPUT_HINT_AUTO_COMPLETE       = 1 << 0,   /**< Suggest word auto completion @since 1.12 */
414    ECORE_IMF_INPUT_HINT_SENSITIVE_DATA      = 1 << 1,   /**< Typed text should not be stored. @since 1.12 */
415    ECORE_IMF_INPUT_HINT_MULTILINE           = 1 << 2,   /**< Multiline text @since 1.18 */
416    ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE   = 0x100, /**< Autofill hint for a credit card expiration date @deprecated since 1.24 */
417    ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DAY    = 0x200, /**< Autofill hint for a credit card expiration day @deprecated since 1.24 */
418    ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_MONTH  = 0x300, /**< Autofill hint for a credit card expiration month @deprecated since 1.24 */
419    ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_YEAR   = 0x400, /**< Autofill hint for a credit card expiration year @deprecated since 1.24 */
420    ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_NUMBER            = 0x500, /**< Autofill hint for a credit card number @deprecated since 1.24 */
421    ECORE_IMF_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS                 = 0x600, /**< Autofill hint for an email address @deprecated since 1.24 */
422    ECORE_IMF_INPUT_HINT_AUTOFILL_NAME                          = 0x700, /**< Autofill hint for a user's real name @deprecated since 1.24 */
423    ECORE_IMF_INPUT_HINT_AUTOFILL_PHONE                         = 0x800, /**< Autofill hint for a phone number @deprecated since 1.24 */
424    ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS                = 0x900, /**< Autofill hint for a postal address @deprecated since 1.24 */
425    ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_CODE                   = 0xA00, /**< Autofill hint for a postal code @deprecated since 1.24 */
426    ECORE_IMF_INPUT_HINT_AUTOFILL_ID                            = 0xB00  /**< Autofill hint for a user's ID @deprecated since 1.24 */
427 } Ecore_IMF_Input_Hints;
428 
429 /**
430  * @typedef Ecore_IMF_Input_Panel_Layout_Normal_Variation
431  * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for normal variation.
432  * @since 1.12
433  */
434 typedef enum
435 {
436    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL,            /**< The plain normal layout @since 1.12 */
437    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME,          /**< Filename layout. Symbols such as '/' should be disabled. @since 1.12 */
438    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME        /**< The name of a person. @since 1.12 */
439 } Ecore_IMF_Input_Panel_Layout_Normal_Variation;
440 
441 /**
442  * @typedef Ecore_IMF_Input_Panel_Layout_Numberonly_Variation
443  * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for numberonly variation
444  * @since 1.8
445  */
446 typedef enum
447 {
448    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL,            /**< The plain normal number layout @since 1.8 */
449    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED,            /**< The number layout to allow a positive or negative sign at the start @since 1.8 */
450    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL,           /**< The number layout to allow decimal point to provide fractional value @since 1.8 */
451    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL /**< The number layout to allow decimal point and negative sign @since 1.8 */
452 } Ecore_IMF_Input_Panel_Layout_Numberonly_Variation;
453 
454 /**
455  * @typedef Ecore_IMF_Input_Panel_Layout_Password_Variation
456  * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for password variation
457  * @since 1.12
458  */
459 typedef enum
460 {
461    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL,          /**< The normal password layout @since 1.12 */
462    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY       /**< The password layout to allow only number @since 1.12 */
463 } Ecore_IMF_Input_Panel_Layout_Password_Variation;
464 
465 /**
466  * @typedef Ecore_IMF_BiDi_Direction
467  * @brief Enumeration for defining the types of Ecore_IMF bidirectionality.
468  * @since 1.12
469  */
470 typedef enum
471 {
472    ECORE_IMF_BIDI_DIRECTION_NEUTRAL,    /**< The Neutral mode @since 1.12 */
473    ECORE_IMF_BIDI_DIRECTION_LTR,        /**< The Left to Right mode @since 1.12 */
474    ECORE_IMF_BIDI_DIRECTION_RTL         /**< The Right to Left mode @since 1.12 */
475 } Ecore_IMF_BiDi_Direction;
476 
477 /**
478  * @enum _Ecore_IMF_Device_Class
479  * @brief Enumeration for defining the types of Ecore_IMF_Device_Class
480  * @since 1.14
481  */
482 typedef enum _Ecore_IMF_Device_Class
483 {
484    ECORE_IMF_DEVICE_CLASS_NONE, /**< Not a device @since 1.14 */
485    ECORE_IMF_DEVICE_CLASS_SEAT, /**< The user/seat (the user themselves) @since 1.14 */
486    ECORE_IMF_DEVICE_CLASS_KEYBOARD, /**< A regular keyboard, numberpad or attached buttons @since 1.14 */
487    ECORE_IMF_DEVICE_CLASS_MOUSE, /**< A mouse, trackball or touchpad relative motion device @since 1.14 */
488    ECORE_IMF_DEVICE_CLASS_TOUCH, /**< A touchscreen with fingers or stylus @since 1.14 */
489    ECORE_IMF_DEVICE_CLASS_PEN, /**< A special pen device @since 1.14 */
490    ECORE_IMF_DEVICE_CLASS_POINTER, /**< A laser pointer, wii-style or "minority report" pointing device @since 1.14 */
491    ECORE_IMF_DEVICE_CLASS_GAMEPAD /**<  A gamepad controller or joystick @since 1.14 */
492 } Ecore_IMF_Device_Class; /**< A general class of device @since 1.14 */
493 
494 /**
495  * @enum _Ecore_IMF_Device_Subclass
496  * @brief Enumeration for defining the types of Ecore_IMF_Device_Subclass
497  * @since 1.14
498  */
499 typedef enum _Ecore_IMF_Device_Subclass
500 {
501    ECORE_IMF_DEVICE_SUBCLASS_NONE, /**< Not a device @since 1.14 */
502    ECORE_IMF_DEVICE_SUBCLASS_FINGER, /**< The normal flat of your finger @since 1.14 */
503    ECORE_IMF_DEVICE_SUBCLASS_FINGERNAIL, /**< A fingernail @since 1.14 */
504    ECORE_IMF_DEVICE_SUBCLASS_KNUCKLE, /**< A Knuckle @since 1.14 */
505    ECORE_IMF_DEVICE_SUBCLASS_PALM, /**< The palm of a users hand @since 1.14 */
506    ECORE_IMF_DEVICE_SUBCLASS_HAND_SIZE, /**< The side of your hand @since 1.14 */
507    ECORE_IMF_DEVICE_SUBCLASS_HAND_FLAT, /**< The flat of your hand @since 1.14 */
508    ECORE_IMF_DEVICE_SUBCLASS_PEN_TIP, /**< The tip of a pen @since 1.14 */
509    ECORE_IMF_DEVICE_SUBCLASS_TRACKPAD, /**< A trackpad style mouse @since 1.14 */
510    ECORE_IMF_DEVICE_SUBCLASS_TRACKPOINT, /**< A trackpoint style mouse @since 1.14 */
511    ECORE_IMF_DEVICE_SUBCLASS_TRACKBALL, /**< A trackball style mouse @since 1.14 */
512 } Ecore_IMF_Device_Subclass; /**< A general subclass of device @since 1.14 */
513 
514 /**
515  * @struct _Ecore_IMF_Event_Preedit_Start
516  * @brief The structure type used with the Preedit_Start Input Method event
517  */
518 struct _Ecore_IMF_Event_Preedit_Start
519 {
520    Ecore_IMF_Context *ctx;
521 };
522 
523 /**
524  * @struct _Ecore_IMF_Event_Preedit_End
525  * @brief The structure type used with the Preedit_End Input Method event
526  */
527 struct _Ecore_IMF_Event_Preedit_End
528 {
529    Ecore_IMF_Context *ctx;
530 };
531 
532 /**
533  * @struct _Ecore_IMF_Event_Preedit_Changed
534  * @brief The structure type used with the Preedit_Changed Input Method event
535  */
536 struct _Ecore_IMF_Event_Preedit_Changed
537 {
538    Ecore_IMF_Context *ctx;
539 };
540 
541 /**
542  * @struct _Ecore_IMF_Event_Commit
543  * @brief The structure type used with the Commit Input Method event
544  */
545 struct _Ecore_IMF_Event_Commit
546 {
547    Ecore_IMF_Context *ctx;
548    char              *str;
549 };
550 
551 /**
552  * @struct _Ecore_IMF_Event_Delete_Surrounding
553  * @brief The structure type used with the Delete_Surrounding Input Method event
554  */
555 struct _Ecore_IMF_Event_Delete_Surrounding
556 {
557    Ecore_IMF_Context *ctx;
558    int                offset;
559    int                n_chars;
560 };
561 
562 /**
563  * @struct _Ecore_IMF_Event_Selection
564  * @brief The structure type used with the Selection Input Method event
565  */
566 struct _Ecore_IMF_Event_Selection
567 {
568    Ecore_IMF_Context *ctx;
569    int                start;
570    int                end;
571 };
572 
573 /**
574  * @struct _Ecore_IMF_Event_Commit_Content
575  * @brief The structure type used with the Commit_Content Input Method event
576  * @since 1.20
577  */
578 struct _Ecore_IMF_Event_Commit_Content
579 {
580    Ecore_IMF_Context *ctx;                  /**< The associated Ecore IMF Context */
581    const char        *content_uri;          /**< The content URI */
582    const char        *description;          /**< The content description */
583    const char        *mime_types;           /**< The content MIME types */
584 };
585 
586 /**
587  * @struct _Ecore_IMF_Event_Mouse_Down
588  * @brief The structure type used with the Mouse_Down event
589  */
590 struct _Ecore_IMF_Event_Mouse_Down
591 {
592    int button;                             /**< The button which has been pressed */
593    struct {
594       int x, y;
595    } output;
596    struct {
597       int x, y;
598    } canvas;
599    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
600    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
601    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
602    unsigned int                 timestamp; /**< The timestamp when the event occurred */
603 };
604 
605 /**
606  * @struct _Ecore_IMF_Event_Mouse_Up
607  * @brief The structure type used with the Mouse_Up event
608  */
609 struct _Ecore_IMF_Event_Mouse_Up
610 {
611    int button;                             /**< The button which has been released */
612    struct {
613       int x, y;
614    } output;
615    struct {
616       int x, y;
617    } canvas;
618    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
619    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
620    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
621    unsigned int                 timestamp; /**< The timestamp when the event occurred */
622 };
623 
624 /**
625  * @struct _Ecore_IMF_Event_Mouse_In
626  * @brief The structure type used with the Mouse_In event
627  */
628 struct _Ecore_IMF_Event_Mouse_In
629 {
630    int buttons;
631    struct {
632       int x, y;
633    } output;
634    struct {
635       int x, y;
636    } canvas;
637    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
638    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
639    unsigned int                 timestamp; /**< The timestamp when the event occurred */
640 };
641 
642 /**
643  * @struct _Ecore_IMF_Event_Mouse_Out
644  * @brief The structure type used with the Mouse_Out event
645  */
646 struct _Ecore_IMF_Event_Mouse_Out
647 {
648    int buttons;
649    struct {
650       int x, y;
651    } output;
652    struct {
653       int x, y;
654    } canvas;
655    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
656    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
657    unsigned int                 timestamp; /**< The timestamp when the event occurred */
658 };
659 
660 /**
661  * @struct _Ecore_IMF_Event_Mouse_Move
662  * @brief The structure type used with the Mouse_Move event
663  */
664 struct _Ecore_IMF_Event_Mouse_Move
665 {
666    int buttons;
667    struct {
668       struct {
669          int x, y;
670       } output;
671       struct {
672          int x, y;
673       } canvas;
674    } cur, prev;
675    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
676    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
677    unsigned int                 timestamp; /**< The timestamp when the event occurred */
678 };
679 
680 /**
681  * @struct _Ecore_IMF_Event_Mouse_Wheel
682  * @brief The structure type used with the Mouse_Wheel event
683  */
684 struct _Ecore_IMF_Event_Mouse_Wheel
685 {
686    int direction;                         /* 0 = default up/down wheel */
687    int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
688    struct {
689       int x, y;
690    } output;
691    struct {
692       int x, y;
693    } canvas;
694    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
695    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
696    unsigned int                 timestamp; /**< The timestamp when the event occurred */
697 };
698 
699 /**
700  * @struct _Ecore_IMF_Event_Key_Down
701  * @brief The structure type used with the Key_Down event
702  */
703 struct _Ecore_IMF_Event_Key_Down
704 {
705    const char                   *keyname;   /**< The string name of the key pressed */
706    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
707    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
708    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
709    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
710    const char                   *compose;   /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
711    unsigned int                  timestamp; /**< The timestamp when the event occurred */
712    const char                   *dev_name;  /**< The device name of the key pressed @since 1.14 */
713    Ecore_IMF_Device_Class        dev_class; /**< The device class of the key pressed @since 1.14 */
714    Ecore_IMF_Device_Subclass     dev_subclass; /**< The device subclass of the key pressed @since 1.14 */
715    unsigned int                  keycode;   /**< Key scan code numeric value @since 1.22 */
716 };
717 
718 /**
719  * @struct _Ecore_IMF_Event_Key_Up
720  * @brief The structure type used with the Key_Up event
721  */
722 struct _Ecore_IMF_Event_Key_Up
723 {
724    const char                   *keyname;   /**< The string name of the key released */
725    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
726    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
727    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
728    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
729    const char                   *compose;   /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
730    unsigned int                  timestamp; /**< The timestamp when the event occurred */
731    const char                   *dev_name;  /**< The device name of the key released @since 1.14 */
732    Ecore_IMF_Device_Class        dev_class; /**< The device class of the key released @since 1.14 */
733    Ecore_IMF_Device_Subclass     dev_subclass; /**< The device subclass of the key released @since 1.14 */
734    unsigned int                  keycode;   /**< Key scan code numeric value @since 1.22 */
735 };
736 
737 /**
738  * @brief A union of IMF events.
739  */
740 union _Ecore_IMF_Event
741 {
742    Ecore_IMF_Event_Mouse_Down  mouse_down;
743    Ecore_IMF_Event_Mouse_Up    mouse_up;
744    Ecore_IMF_Event_Mouse_In    mouse_in;
745    Ecore_IMF_Event_Mouse_Out   mouse_out;
746    Ecore_IMF_Event_Mouse_Move  mouse_move;
747    Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
748    Ecore_IMF_Event_Key_Down    key_down;
749    Ecore_IMF_Event_Key_Up      key_up;
750 };
751 
752 /**
753  * @struct _Ecore_IMF_Preedit_Attr
754  * @brief Structure that contains preedit attribute information.
755  */
756 struct _Ecore_IMF_Preedit_Attr
757 {
758    Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
759    unsigned int start_index;            /**< start index of the range (in bytes) */
760    unsigned int end_index;              /**< end index of the range (in bytes) */
761 };
762 
763 /**
764  * @struct _Ecore_IMF_Context_Class
765  * @brief Structure used when creating a new Input Method Context. This
766  * structure is mainly used by modules implementing the Input Method Context
767  * interface.
768  *
769  */
770 struct _Ecore_IMF_Context_Class
771 {
772    void (*add)                 (Ecore_IMF_Context *ctx); /**< Create the Input Method Context */
773    void (*del)                 (Ecore_IMF_Context *ctx); /**< Delete the Input Method Context */
774    void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window); /**< Set the client window for the Input Method Context */
775    void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas); /**< Set the client canvas for the Input Method Context */
776    void (*show)                (Ecore_IMF_Context *ctx); /**< Show the Input Method Context */
777    void (*hide)                (Ecore_IMF_Context *ctx); /**< Hide the Input Method Context */
778    void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos); /**< Return current preedit string and cursor position */
779    void (*focus_in)            (Ecore_IMF_Context *ctx); /**< Input Method context widget has gained focus */
780    void (*focus_out)           (Ecore_IMF_Context *ctx); /**< Input Method context widget has lost focus */
781    void (*reset)               (Ecore_IMF_Context *ctx); /**< A change has been made */
782    void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos); /**< Cursor position changed */
783    void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit); /**< Use preedit string to display feedback */
784    void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); /**< Set the input mode */
785    Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); /**< Internally handle an event */
786    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); /**<  return current preedit string, attributes, and cursor position */
787    void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction); /**< Allow text prediction */
788    void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); /**< Set auto-capitalization type */
789    void (*control_panel_show)   (Ecore_IMF_Context *ctx); /**< Show the control panel */
790    void (*control_panel_hide)   (Ecore_IMF_Context *ctx); /**< Hide the control panel */
791    void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); /**< Set the layout of the input panel */
792    Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx); /**< Return the current layout of the input panel */
793    void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); /**< Set the language of the input panel */
794    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); /**< Get the current language of the input panel */
795    void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h); /**< Set the cursor location */
796    void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len); /**< Set panel-specific data to the input panel */
797    void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len); /**< Get current panel-specific data from the input panel */
798    void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type); /**< Set the return key theme of the input panel based on return key type provided */
799    void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled); /**< Disable return key of the input panel */
800    void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode); /**< Set input panel caps lock mode */
801    void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return input panel geometry */
802    Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx); /**< Return input panel state */
803    void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), void *data); /**< Add a callback on input panel state,language,mode change */
804    void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value)); /**< Delete the input panel event callback */
805    void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang); /**< Return the current language locale */
806    void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return the candidate panel geometry */
807    void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints); /**< Sets input hint to fine-tune input methods behavior */
808    void (*bidi_direction_set) (Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction); /**< Set bidirectionality at the cursor position */
809    Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */
810    void (*prediction_hint_set) (Ecore_IMF_Context *ctx, const char *prediction_hint); /**< Set the prediction hint to the input panel */
811    void (*mime_type_accept_set) (Ecore_IMF_Context *ctx, const char *mime_type); /**< Set the MIME type to the input panel */
812    void (*input_panel_position_set) (Ecore_IMF_Context *ctx, int x, int y); /**< Set the position of the input panel */
813 };
814 
815 /**
816  * @struct _Ecore_IMF_Context_Info
817  * @brief A IMF structure containing context information.
818  */
819 struct _Ecore_IMF_Context_Info
820 {
821    const char *id;              /* ID */
822    const char *description;     /* Human readable description */
823    const char *default_locales; /* Languages for which this context is the default, separated by : */
824    const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
825    int         canvas_required; /* Whether the canvas usage is required for this input method */
826 };
827 
828 /**
829  * @}
830  */
831 
832 /**
833  * @ingroup Ecore_IMF_Lib_Group
834  * @brief Initialises the Ecore_IMF library.
835  * @return  Number of times the library has been initialised without being
836  *          shut down.
837  */
838 EAPI int                           ecore_imf_init(void);
839 
840 /**
841  * @ingroup Ecore_IMF_Lib_Group
842  * @brief Shuts down the Ecore_IMF library.
843  * @return  Number of times the library has been initialised without being
844  *          shut down.
845  */
846 EAPI int                           ecore_imf_shutdown(void);
847 
848 /**
849  * @ingroup Ecore_IMF_Lib_Group
850  * @brief Registers an Ecore_IMF module.
851  *
852  * @param info              An Ecore_IMF_Context_Info structure
853  * @param imf_module_create A function to call at the creation
854  * @param imf_module_exit   A function to call when exiting
855  *
856  */
857 EAPI void                          ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void));
858 
859 /**
860  * @ingroup Ecore_IMF_Lib_Group
861  * @brief Hides the input panel.
862  * @return  EINA_TRUE if the input panel will be hidden
863             EINA_FALSE if the input panel is already in hidden state
864  * @since 1.8.0
865  */
866 EAPI Eina_Bool                     ecore_imf_input_panel_hide(void);
867 
868 /**
869  * @ingroup Ecore_IMF_Context_Group
870  * @brief Gets the list of the available Input Method Context ids.
871  *
872  * Note that the caller is responsible for freeing the Eina_List
873  * when finished with it. There is no need to finish the list strings.
874  *
875  * @return Return an Eina_List of strings;
876  *         on failure it returns NULL.
877  */
878 EAPI Eina_List                    *ecore_imf_context_available_ids_get(void);
879 
880 /**
881  * @ingroup Ecore_IMF_Context_Group
882  * @brief Gets the list of the available Input Method Context ids by canvas type.
883  *
884  * Note that the caller is responsible for freeing the Eina_List
885  * when finished with it. There is no need to finish the list strings.
886  *
887  * @param  canvas_type A string containing the canvas type.
888  * @return Return an Eina_List of strings;
889  *         on failure it returns NULL.
890  */
891 EAPI Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
892 
893 /**
894  * @ingroup Ecore_IMF_Context_Group
895  * @brief Gets the id of the default Input Method Context.
896  * The id may to used to create a new instance of an Input Method
897  * Context object.
898  *
899  * @return Return a string containing the id of the default Input
900  *         Method Context; on failure it returns NULL.
901  */
902 EAPI const char                   *ecore_imf_context_default_id_get(void);
903 
904 /**
905  * @ingroup Ecore_IMF_Context_Group
906  * @brief Gets the id of the default Input Method Context corresponding to a canvas
907  * type.
908  * The id may be used to create a new instance of an Input Method
909  * Context object.
910  *
911  * @param  canvas_type A string containing the canvas type.
912  * @return Return a string containing the id of the default Input
913  *         Method Context; on failure it returns NULL.
914  */
915 EAPI const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
916 
917 /**
918  * @ingroup Ecore_IMF_Context_Group
919  * @brief Retrieves the info for the Input Method Context with @p id.
920  *
921  * @param id The Input Method Context id to query for.
922  * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
923  *         on failure it returns NULL.
924  *
925  * Example
926  * @code
927  *
928  * const char *ctx_id;
929  * const Ecore_IMF_Context_Info *ctx_info;
930  * Ecore_IMF_Context *imf_context;
931  * ctx_id = ecore_imf_context_default_id_get();
932  * if (ctx_id)
933  *   {
934  *      ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
935  *      if (!ctx_info->canvas_type ||
936  *          strcmp(ctx_info->canvas_type, "evas") == 0)
937  *        {
938  *           imf_context = ecore_imf_context_add(ctx_id);
939  *        }
940  *      else
941  *        {
942  *           ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
943  *           if (ctx_id)
944  *             {
945  *                imf_context = ecore_imf_context_add(ctx_id);
946  *             }
947  *        }
948  *   }
949  * @endcode
950  */
951 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
952 
953 /**
954  * @ingroup Ecore_IMF_Context_Group
955  * @brief Creates a new Input Method Context defined by the given id.
956  *
957  * @param id The Input Method Context id.
958  * @return A newly allocated Input Method Context;
959  *         on failure it returns NULL.
960  */
961 EAPI Ecore_IMF_Context            *ecore_imf_context_add(const char *id);
962 
963 /**
964  * @ingroup Ecore_IMF_Context_Group
965  * @brief Retrieves the info for the given Input Method Context.
966  *
967  * @param ctx An #Ecore_IMF_Context.
968  * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
969  *         on failure it returns NULL.
970  */
971 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
972 
973 /**
974  * @ingroup Ecore_IMF_Context_Group
975  * @brief Deletes the given Input Method Context and free its memory.
976  *
977  * @param ctx An #Ecore_IMF_Context.
978  */
979 EAPI void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);
980 
981 /**
982  * @ingroup Ecore_IMF_Context_Group
983  * @brief Sets the client window for the Input Method Context; this is the
984  * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
985  * This window is used in order to correctly position status windows, and may
986  * also be used for purposes internal to the Input Method Context.
987  *
988  * @param ctx An #Ecore_IMF_Context.
989  * @param window The client window. This may be @c NULL to indicate
990  *               that the previous client window no longer exists.
991  */
992 EAPI void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
993 
994 /**
995  * @ingroup Ecore_IMF_Context_Group
996  * @brief Gets the client window of the Input Method Context.
997  *
998  * See @ref ecore_imf_context_client_window_set for more details.
999  *
1000  * @param ctx An #Ecore_IMF_Context.
1001  * @return Return the client window.
1002  * @since 1.1.0
1003  */
1004 EAPI void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
1005 
1006 /**
1007  * @ingroup Ecore_IMF_Context_Group
1008  * @brief Sets the client canvas for the Input Method Context; this is the
1009  * canvas in which the input appears.
1010  * The canvas type can be determined by using the context canvas type.
1011  * Actually only canvas with type "evas" (Evas *) is supported.
1012  * This canvas may be used in order to correctly position status windows, and may
1013  * also be used for purposes internal to the Input Method Context.
1014  *
1015  * @param ctx An #Ecore_IMF_Context.
1016  * @param canvas The client canvas. This may be @c NULL to indicate
1017  *               that the previous client canvas no longer exists.
1018  */
1019 EAPI void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
1020 
1021 /**
1022  * @ingroup Ecore_IMF_Context_Group
1023  * @brief Gets the client canvas of the Input Method Context.
1024  *
1025  * See @ref ecore_imf_context_client_canvas_set for more details.
1026  *
1027  * @param ctx An #Ecore_IMF_Context.
1028  * @return Return the client canvas.
1029  * @since 1.1.0
1030  */
1031 EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
1032 
1033 /**
1034  * @ingroup Ecore_IMF_Context_Group
1035  * @brief Asks the Input Method Context to show itself.
1036  *
1037  * @param ctx An #Ecore_IMF_Context.
1038  *
1039  * @deprecated use ecore_imf_context_input_panel_show() instead.
1040  */
1041 EINA_DEPRECATED EAPI void          ecore_imf_context_show(Ecore_IMF_Context *ctx);
1042 
1043 /**
1044  * @ingroup Ecore_IMF_Context_Group
1045  * @brief Asks the Input Method Context to hide itself.
1046  *
1047  * @param ctx An #Ecore_IMF_Context.
1048  *
1049  * @deprecated use ecore_imf_context_input_panel_hide() instead.
1050  */
1051 EINA_DEPRECATED EAPI void          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
1052 
1053 /**
1054  * @ingroup Ecore_IMF_Context_Group
1055  * @brief Retrieves the current preedit string and cursor position
1056  * for the Input Method Context.
1057  *
1058  * @param ctx An #Ecore_IMF_Context.
1059  * @param str Location to store the retrieved string. The
1060  *            string retrieved must be freed with free().
1061  * @param cursor_pos Location to store position of cursor (in characters)
1062  *                   within the preedit string.
1063  */
1064 EAPI void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
1065 
1066 /**
1067  * @ingroup Ecore_IMF_Context_Group
1068  * @brief Retrieves the current preedit string, attributes and
1069  * cursor position for the Input Method Context.
1070  *
1071  * @param ctx An #Ecore_IMF_Context.
1072  * @param str Location to store the retrieved string. The
1073  *            string retrieved must be freed with free().
1074  * @param attrs An Eina_List of attributes
1075  * @param cursor_pos Location to store position of cursor (in characters)
1076  *                   within the preedit string.
1077  *
1078  * Example
1079  * @code
1080  * char *preedit_string;
1081  * int cursor_pos;
1082  * Eina_List *attrs = NULL, *l = NULL;
1083  * Ecore_IMF_Preedit_Attr *attr;
1084  *
1085  * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
1086  *                                                      &preedit_string,
1087  *                                                      &attrs, &cursor_pos);
1088  * if (!preedit_string) return;
1089  *
1090  *  if (strlen(preedit_string) > 0)
1091  *    {
1092  *       if (attrs)
1093  *         {
1094  *            EINA_LIST_FOREACH(attrs, l, attr)
1095  *              {
1096  *                 if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
1097  *                   {
1098  *                      // Something to do
1099  *                   }
1100  *                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
1101  *                   {
1102  *                      // Something to do
1103  *                   }
1104  *                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
1105  *                   {
1106  *                      // Something to do
1107  *                   }
1108  *              }
1109  *         }
1110  *    }
1111  *
1112  * // delete attribute list
1113  * EINA_LIST_FREE(attrs, attr) free(attr);
1114  *
1115  * free(preedit_string);
1116  * @endcode
1117  * @since 1.1.0
1118  */
1119 EAPI void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
1120 
1121 /**
1122  * @ingroup Ecore_IMF_Context_Group
1123  * @brief Notifies the Input Method Context that the widget to which its
1124  * correspond has gained focus.
1125  *
1126  * @param ctx An #Ecore_IMF_Context.
1127  *
1128  * Example
1129  * @code
1130  * static void
1131  * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
1132  * {
1133  *    Ecore_IMF_Context *imf_context = data;
1134  *    ecore_imf_context_focus_in(imf_context);
1135  * }
1136  *
1137  * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, imf_context);
1138  * @endcode
1139  */
1140 EAPI void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
1141 
1142 /**
1143  * @ingroup Ecore_IMF_Context_Group
1144  * @brief Notifies the Input Method Context that the widget to which its
1145  * correspond has lost focus.
1146  *
1147  * @param ctx An #Ecore_IMF_Context.
1148  *
1149  * Example
1150  * @code
1151  * static void
1152  * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
1153  * {
1154  *    Ecore_IMF_Context *imf_context = data;
1155  *    ecore_imf_context_reset(imf_context);
1156  *    ecore_imf_context_focus_out(imf_context);
1157  * }
1158  *
1159  * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
1160  * @endcode
1161  */
1162 EAPI void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
1163 
1164 /**
1165  * @ingroup Ecore_IMF_Context_Group
1166  * @brief Notifies the Input Method Context that a change such as a
1167  * change in cursor position has been made. This will typically
1168  * cause the Input Method Context to clear the preedit state or commit the preedit string.
1169  *
1170  * The operation of ecore_imf_context_reset() depends on the specific characteristics of
1171  * each language. For example, the preedit string is cleared in the Chinese and Japanese Input Method Engine.
1172  * However, The preedit string is committed and then cleared in the Korean Input Method Engine.
1173  *
1174  * This function should be called in case of the focus-out and mouse down event callback function.
1175  * In addition, it should be called before inserting some text.
1176  *
1177  * @param ctx An #Ecore_IMF_Context.
1178  *
1179  * Example
1180  * @code
1181  * static void
1182  * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
1183  * {
1184  *    Ecore_IMF_Context *imf_context = data;
1185  *    ecore_imf_context_reset(imf_context);
1186  *    ecore_imf_context_focus_out(imf_context);
1187  * }
1188  *
1189  * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, imf_context);
1190  * @endcode
1191  */
1192 EAPI void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);
1193 
1194 /**
1195  * @ingroup Ecore_IMF_Context_Group
1196  * @brief Notifies the Input Method Context that a change in the cursor
1197  * position has been made.
1198  *
1199  * This function should be called when cursor position is changed or mouse up event is generated.
1200  * Some input methods that do a heavy job using this event can give a critical performance latency problem.
1201  * For better typing performance, we suggest that the cursor position change events need to be occurred
1202  * only if the cursor position is on a confirmed status not on moving status.
1203  *
1204  * @param ctx An #Ecore_IMF_Context.
1205  * @param cursor_pos New cursor position in characters.
1206  */
1207 EAPI void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
1208 
1209 /**
1210  * @ingroup Ecore_IMF_Context_Group
1211  * @brief Notifies the Input Method Context that a change in the cursor
1212  * location has been made. The location is relative to the canvas.
1213  * The cursor location can be used to determine the position of
1214  * candidate word window in the immodule.
1215  *
1216  * @param ctx An #Ecore_IMF_Context.
1217  * @param x cursor x position.
1218  * @param y cursor y position.
1219  * @param w cursor width.
1220  * @param h cursor height.
1221  * @since 1.1.0
1222  */
1223 EAPI void                          ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
1224 
1225 /**
1226  * @ingroup Ecore_IMF_Context_Group
1227  * @brief Sets whether the IM context should use the preedit string
1228  * to display feedback. If @c use_preedit is @c EINA_FALSE (default
1229  * is @c EINA_TRUE), then the IM context may use some other method to display
1230  * feedback, such as displaying it in a child of the root window.
1231  *
1232  * @param ctx An #Ecore_IMF_Context.
1233  * @param use_preedit Whether the IM context should use the preedit string.
1234  */
1235 EAPI void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
1236 
1237 /**
1238  * @ingroup Ecore_IMF_Context_Group
1239  * @brief Sets the callback to be used on surrounding_get request.
1240  *
1241  * This callback will be called when the Input Method Context
1242  * module requests the surrounding context.
1243  * Input methods typically want context in order to constrain input text based on existing text;
1244  * this is important for languages such as Thai where only some sequences of characters are allowed.
1245  *
1246  * @param ctx An #Ecore_IMF_Context.
1247  * @param func The callback to be called.
1248  * @param data The data pointer to be passed to @p func
1249  */
1250 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);
1251 
1252 /**
1253  * @ingroup Ecore_IMF_Context_Group
1254  * @brief Sets the callback to be used on selection_get request.
1255  *
1256  * This callback will be called when the Input Method Context
1257  * module requests the selection context.
1258  *
1259  * @param ctx An #Ecore_IMF_Context.
1260  * @param func The callback to be called.
1261  * @param data The data pointer to be passed to @p func
1262  * @since 1.9.0
1263  */
1264 EAPI void                          ecore_imf_context_retrieve_selection_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text), const void *data);
1265 
1266 /**
1267  * @ingroup Ecore_IMF_Context_Group
1268  * @brief Sets the input mode used by the Ecore Input Context.
1269  *
1270  * The input mode can be one of the input modes defined in
1271  * Ecore_IMF_Input_Mode. The default input mode is
1272  * ECORE_IMF_INPUT_MODE_FULL.
1273  *
1274  * @param ctx An #Ecore_IMF_Context.
1275  * @param input_mode The input mode to be used by @p ctx.
1276  */
1277 EAPI void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
1278 
1279 /**
1280  * @ingroup Ecore_IMF_Context_Group
1281  * @brief Gets the input mode being used by the Ecore Input Context.
1282  *
1283  * See @ref ecore_imf_context_input_mode_set for more details.
1284  *
1285  * @param ctx An #Ecore_IMF_Context.
1286  * @return The input mode being used by @p ctx.
1287  */
1288 EAPI Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
1289 
1290 /**
1291  * @ingroup Ecore_IMF_Context_Group
1292  * @brief Allows an Ecore Input Context to internally handle an event.
1293  * If this function returns @c EINA_TRUE, then no further processing
1294  * should be done for this event.
1295  *
1296  * Input methods must be able to accept all types of events (simply
1297  * returning @c EINA_FALSE if the event was not handled), but there is no
1298  * obligation of any events to be submitted to this function.
1299  *
1300  * @param ctx An #Ecore_IMF_Context.
1301  * @param type The type of event defined by #Ecore_IMF_Event_Type.
1302  * @param event The event itself.
1303  * @return @c EINA_TRUE if the event was handled; otherwise @c EINA_FALSE.
1304  *
1305  * Example
1306  * @code
1307  * static void
1308  * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
1309  * {
1310  *    Evas_Event_Key_Down *ev = event_info;
1311  *    if (!ev->key) return;
1312  *
1313  *    if (imf_context)
1314  *      {
1315  *         Ecore_IMF_Event_Key_Down ecore_ev;
1316  *         ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
1317  *         if (ecore_imf_context_filter_event(imf_context,
1318  *                                            ECORE_IMF_EVENT_KEY_DOWN,
1319  *                                            (Ecore_IMF_Event *)&ecore_ev))
1320  *           return;
1321  *      }
1322  * }
1323  *
1324  * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
1325  * @endcode
1326  */
1327 EAPI Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
1328 
1329 /* plugin specific functions */
1330 
1331 /**
1332  * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
1333  * @ingroup Ecore_IMF_Lib_Group
1334  *
1335  * Functions that should be used by Ecore Input Method Context modules.
1336  */
1337 
1338 /**
1339  * @ingroup Ecore_IMF_Context_Module_Group
1340  * @brief Creates a new Input Method Context with klass specified by @p ctxc.
1341  *
1342  * This method should be used by modules implementing the Input
1343  * Method Context interface.
1344  *
1345  * @param ctxc An #Ecore_IMF_Context_Class.
1346  * @return A new #Ecore_IMF_Context; on failure it returns NULL.
1347  */
1348 EAPI Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
1349 
1350 /**
1351  * @ingroup Ecore_IMF_Context_Module_Group
1352  * Sets the Input Method Context specific data.
1353  *
1354  * Note that this method should be used by modules to set
1355  * the Input Method Context specific data and it's not meant to
1356  * be used by applications to store application specific data.
1357  *
1358  * @param ctx An #Ecore_IMF_Context.
1359  * @param data The Input Method Context specific data.
1360  * @return A new #Ecore_IMF_Context; on failure it returns NULL.
1361  */
1362 EAPI void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
1363 
1364 /**
1365  * @ingroup Ecore_IMF_Context_Module_Group
1366  * @brief Gets the Input Method Context specific data.
1367  *
1368  * See @ref ecore_imf_context_data_set for more details.
1369  *
1370  * @param ctx An #Ecore_IMF_Context.
1371  * @return The Input Method Context specific data.
1372  */
1373 EAPI void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
1374 
1375 /**
1376  * @ingroup Ecore_IMF_Context_Module_Group
1377  * @brief Retrieves context around insertion point.
1378  * Input methods typically want context in order to constrain input text based on existing text;
1379  * this is important for languages such as Thai where only some sequences of characters are allowed.
1380  * In addition, the text around the insertion point can be used for supporting autocapital feature.
1381  *
1382  * This function is implemented by calling the
1383  * Ecore_IMF_Context::retrieve_surrounding_func (
1384  * set using #ecore_imf_context_retrieve_surrounding_callback_set).
1385  *
1386  * There is no obligation for a widget to respond to the
1387  * retrieve_surrounding_func, so input methods must be prepared
1388  * to function without context.
1389  *
1390  * @param ctx An #Ecore_IMF_Context.
1391  * @param text Location to store a UTF-8 encoded string of text
1392  *             holding context around the insertion point.
1393  *             If the function returns @c EINA_TRUE, then you must free
1394  *             the result stored in this location with free().
1395  * @param cursor_pos Location to store the position in characters of
1396  *                   the insertion cursor within @p text.
1397  * @return @c EINA_TRUE if surrounding text was provided; otherwise
1398  * @c EINA_FALSE.
1399  */
1400 EAPI Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
1401 
1402 /**
1403  * @ingroup Ecore_IMF_Context_Module_Group
1404  * @brief Retrieves the selected text.
1405  *
1406  * This function is implemented by calling the
1407  * Ecore_IMF_Context::retrieve_selection_func (
1408  * set using #ecore_imf_context_retrieve_selection_callback_set).
1409  *
1410  * There is no obligation for a widget to respond to the
1411  * retrieve_surrounding_func, so input methods must be prepared
1412  * to function without context.
1413  *
1414  * @param ctx An #Ecore_IMF_Context.
1415  * @param text Location to store a UTF-8 encoded string of the selected text.
1416  *             If the function returns @c EINA_TRUE, then you must free
1417  *             the result stored in this location with free().
1418  * @return @c EINA_TRUE if selected text was provided; otherwise
1419  * @c EINA_FALSE.
1420  * @since 1.9.0
1421  */
1422 EAPI Eina_Bool                     ecore_imf_context_selection_get(Ecore_IMF_Context *ctx, char **text);
1423 
1424 /**
1425  * @ingroup Ecore_IMF_Context_Module_Group
1426  * @brief Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
1427  *
1428  * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
1429  * It's asynchronous method to put event to the event queue.
1430  * ecore_imf_context_event_callback_call() can be used as synchronous method.
1431  *
1432  * @param ctx An #Ecore_IMF_Context.
1433  *
1434  * @deprecated use ecore_imf_context_event_callback_call() instead.
1435  */
1436 EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
1437 
1438 /**
1439  * @ingroup Ecore_IMF_Context_Module_Group
1440  * @brief Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
1441  *
1442  * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
1443  * It's asynchronous method to put event to the event queue.
1444  * ecore_imf_context_event_callback_call() can be used as synchronous method.
1445  *
1446  * @param ctx An #Ecore_IMF_Context.
1447  *
1448  * @deprecated use ecore_imf_context_event_callback_call() instead.
1449  */
1450 EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
1451 
1452 /**
1453  * @ingroup Ecore_IMF_Context_Module_Group
1454  * @brief Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
1455  *
1456  * It's asynchronous method to put event to the event queue.
1457  * ecore_imf_context_event_callback_call() can be used as synchronous method.
1458  *
1459  * @param ctx An #Ecore_IMF_Context.
1460  *
1461  * @deprecated use ecore_imf_context_event_callback_call() instead.
1462  */
1463 EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
1464 
1465 /**
1466  * @ingroup Ecore_IMF_Context_Module_Group
1467  * @brief Adds ECORE_IMF_EVENT_COMMIT to the event queue.
1468  *
1469  * It's asynchronous method to put event to the event queue.
1470  * ecore_imf_context_event_callback_call() can be used as synchronous method.
1471  *
1472  * @param ctx An #Ecore_IMF_Context.
1473  * @param str The committed string.
1474  *
1475  * @deprecated use ecore_imf_context_event_callback_call() instead.
1476  */
1477 EINA_DEPRECATED EAPI void          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
1478 
1479 /**
1480  * @ingroup Ecore_IMF_Context_Module_Group
1481  * @brief Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1482  *
1483  * Asks the widget that the input context is attached to to delete characters around the cursor position
1484  * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1485  * Note that offset and n_chars are in characters not in bytes.
1486  *
1487  * It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue.
1488  * ecore_imf_context_event_callback_call() can be used as synchronous method.
1489  *
1490  * @param ctx An #Ecore_IMF_Context.
1491  * @param offset The start offset of surrounding to be deleted.
1492  * @param n_chars The number of characters to be deleted.
1493  *
1494  * @deprecated use ecore_imf_context_event_callback_call() instead.
1495  */
1496 EINA_DEPRECATED EAPI void          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
1497 
1498 /**
1499  * @ingroup Ecore_IMF_Context_Group
1500  * @brief Adds (registers) a callback function to a given context event.
1501  *
1502  * This function adds a function callback to the context @p ctx when the
1503  * event of type @p type occurs on it. The function pointer is @p
1504  * func.
1505  *
1506  * The event type @p type to trigger the function may be one of
1507  * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1508  * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT,
1509  * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING, #ECORE_IMF_CALLBACK_SELECTION_SET,
1510  * #ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, #ECORE_IMF_CALLBACK_COMMIT_CONTENT,
1511  * #ECORE_IMF_CALLBACK_TRANSACTION_START, and #ECORE_IMF_CALLBACK_TRANSACTION_END.
1512  *
1513  * @param ctx Ecore_IMF_Context to attach a callback to.
1514  * @param type The type of event that will trigger the callback
1515  * @param func The (callback) function to be called when the event is
1516  *        triggered
1517  * @param data The data pointer to be passed to @p func
1518  * @since 1.2.0
1519  *
1520  * Example
1521  * @code
1522  * #include <glib.h>
1523  *
1524  * // example for handling commit event from input framework
1525  * static void
1526  * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1527  * {
1528  *    char *commit_str = event_info;
1529  *    // something to do
1530  * }
1531  *
1532  * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
1533  *
1534  * // example for receiving media content URI from input framework
1535  * @code
1536  * #include <glib.h>
1537  *
1538  * static void
1539  * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1540  * {
1541  *    Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event;
1542  *    if (!commit_content) return;
1543  *
1544  *    // convert URI to filename
1545  *    gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
1546  *    printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
1547  *
1548  *    // do something to use filepath
1549  *
1550  *    if (filepath)
1551  *       g_free(filepath);
1552  * }
1553  *
1554  * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
1555  * @endcode
1556  */
1557 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);
1558 
1559 /**
1560  * @ingroup Ecore_IMF_Context_Group
1561  * @brief Deletes (unregisters) a callback function registered to a given
1562  * context event.
1563  *
1564  * This function removes a function callback from the context @p ctx when the
1565  * event of type @p type occurs on it. The function pointer is @p
1566  * func.
1567  *
1568  * @see ecore_imf_context_event_callback_add() for more details
1569  *
1570  * @param ctx Ecore_IMF_Context to remove a callback from.
1571  * @param type The type of event that was triggering the callback
1572  * @param func The (callback) function that was to be called when the event was triggered
1573  * @return the data pointer
1574  * @since 1.2.0
1575  */
1576 EAPI void                         *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
1577 
1578 /**
1579  * @ingroup Ecore_IMF_Context_Module_Group
1580  * @brief Calls a given callback on the context @p ctx.
1581  *
1582  * ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(),
1583  * ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and
1584  * ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous
1585  * because those API adds each event to the event queue.
1586  *
1587  * This API provides the way to call each callback function immediately.
1588  *
1589  * @param ctx Ecore_IMF_Context.
1590  * @param type The type of event that will trigger the callback
1591  * @param event_info The pointer to event specific struct or information to
1592  *        pass to the callback functions registered on this event
1593  * @since 1.2.0
1594  */
1595 EAPI void                          ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
1596 
1597 /**
1598  * @ingroup Ecore_IMF_Context_Group
1599  * @brief Sets whether the IM context should allow to use the text prediction.
1600  * If @p prediction is @c EINA_FALSE (default is @c EINA_TRUE), then the IM
1601  * context will not display the text prediction window.
1602  *
1603  * @param ctx An #Ecore_IMF_Context.
1604  * @param prediction Whether the IM context should allow to use the text prediction.
1605  * @note Default value is EINA_TRUE.
1606  * @since 1.1.0
1607  */
1608 EAPI void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
1609 
1610 /**
1611  * @ingroup Ecore_IMF_Context_Group
1612  * @brief Gets whether the IM context should allow to use the text prediction.
1613  *
1614  * @param ctx An #Ecore_IMF_Context.
1615  * @return @c EINA_TRUE if it allows to use the text prediction, otherwise
1616  * @c EINA_FALSE.
1617  * @since 1.1.0
1618  */
1619 EAPI Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
1620 
1621 /**
1622  * @ingroup Ecore_IMF_Context_Group
1623  * @brief Sets the autocapitalization type on the immodule.
1624  *
1625  * @param ctx An #Ecore_IMF_Context.
1626  * @param autocapital_type the autocapitalization type.
1627  * @note Default type is ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE.
1628  * @since 1.1.0
1629  */
1630 EAPI void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
1631 
1632 /**
1633  * @ingroup Ecore_IMF_Context_Group
1634  * @brief Gets the autocapitalization type.
1635  *
1636  * @param ctx An #Ecore_IMF_Context.
1637  * @return The autocapital type being used by @p ctx.
1638  * @since 1.1.0
1639  */
1640 EAPI Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
1641 
1642 /**
1643  * @ingroup Ecore_IMF_Context_Group
1644  * @brief Sets the input hint which allows input methods to fine-tune their behavior.
1645  *
1646  * @param ctx An #Ecore_IMF_Context
1647  * @param hints Input hint
1648  * @note The default input hint is @c ECORE_IMF_INPUT_HINT_AUTO_COMPLETE.
1649  * @since 1.12
1650  */
1651 EAPI void                          ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints hints);
1652 
1653 /**
1654  * @ingroup Ecore_IMF_Context_Group
1655  * @brief Gets the value of input hint.
1656  *
1657  * @param ctx An #Ecore_IMF_Context
1658  * @return The value of input hint
1659  * @since 1.12
1660  */
1661 EAPI Ecore_IMF_Input_Hints         ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx);
1662 
1663 /**
1664  * @ingroup Ecore_IMF_Context_Group
1665  * @brief Asks the Input Method Context to show the control panel of using Input Method.
1666  *
1667  * @param ctx An #Ecore_IMF_Context.
1668  * @since 1.1.0
1669  */
1670 EINA_DEPRECATED EAPI void          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
1671 
1672 /**
1673  * @ingroup Ecore_IMF_Context_Group
1674  * @brief Asks the Input Method Context to hide the control panel of using Input Method.
1675  *
1676  * @param ctx An #Ecore_IMF_Context.
1677  * @since 1.1.0
1678  */
1679 EINA_DEPRECATED EAPI void          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
1680 
1681 /**
1682  * @ingroup Ecore_IMF_Context_Group
1683  * @brief Asks the Input Method Context to show the input panel (virtual keyboard).
1684  *
1685  * @param ctx An #Ecore_IMF_Context.
1686  * @since 1.1.0
1687  */
1688 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
1689 
1690 /**
1691  * @ingroup Ecore_IMF_Context_Group
1692  * @brief Asks the Input Method Context to hide the input panel.
1693  *
1694  * @param ctx An #Ecore_IMF_Context.
1695  * @since 1.1.0
1696  */
1697 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
1698 
1699 /**
1700  * @ingroup Ecore_IMF_Context_Group
1701  * @brief Sets the layout of the input panel.
1702  *
1703  * @param ctx An #Ecore_IMF_Context.
1704  * @param layout see #Ecore_IMF_Input_Panel_Layout
1705  * @note Default layout type is ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL.
1706  * @since 1.1.0
1707  */
1708 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
1709 
1710 /**
1711  * @ingroup Ecore_IMF_Context_Group
1712  * @brief Gets the layout of the current active input panel.
1713  *
1714  * @param ctx An #Ecore_IMF_Context.
1715  * @return layout see #Ecore_IMF_Input_Panel_Layout
1716  * @since 1.1.0
1717  */
1718 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
1719 
1720 /**
1721  * @ingroup Ecore_IMF_Context_Group
1722  * @brief Sets the layout variation of the current active input panel.
1723  *
1724  * @param ctx An #Ecore_IMF_Context.
1725  * @param variation the layout variation
1726  * @note Default layout variation type is NORMAL.
1727  * @since 1.8.0
1728  */
1729 EAPI void                          ecore_imf_context_input_panel_layout_variation_set(Ecore_IMF_Context *ctx, int variation);
1730 
1731 /**
1732  * @ingroup Ecore_IMF_Context_Group
1733  * @brief Gets the layout variation of the current active input panel.
1734  *
1735  * @param ctx An #Ecore_IMF_Context.
1736  * @return the layout variation
1737  * @since 1.8.0
1738  */
1739 EAPI int                           ecore_imf_context_input_panel_layout_variation_get(Ecore_IMF_Context *ctx);
1740 
1741 /**
1742  * @ingroup Ecore_IMF_Context_Group
1743  * @brief Sets the language of the input panel.
1744  * This API can be used when you want to show the English keyboard.
1745  *
1746  * @param ctx An #Ecore_IMF_Context.
1747  * @param lang the language to be set to the input panel.
1748  * @since 1.1.0
1749  */
1750 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
1751 
1752 /**
1753  * @ingroup Ecore_IMF_Context_Group
1754  * @brief Gets the language of the input panel.
1755  *
1756  * See @ref ecore_imf_context_input_panel_language_set for more details.
1757  *
1758  * @param ctx An #Ecore_IMF_Context.
1759  * @return Ecore_IMF_Input_Panel_Lang
1760  * @since 1.1.0
1761  */
1762 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
1763 
1764 /**
1765  * @ingroup Ecore_IMF_Context_Group
1766  * @brief Sets whether the Input Method Context should request to show the input panel automatically
1767  * when the widget has focus.
1768  *
1769  * @param ctx An #Ecore_IMF_Context.
1770  * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
1771  * @since 1.1.0
1772  */
1773 EAPI void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enabled);
1774 
1775 /**
1776  * @ingroup Ecore_IMF_Context_Group
1777  * @brief Gets whether the Input Method Context requests to show the input panel automatically.
1778  *
1779  * @param ctx An #Ecore_IMF_Context.
1780  * @return Return the attribute to show the input panel automatically
1781  * @since 1.1.0
1782  */
1783 EAPI Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
1784 
1785 /**
1786  * @ingroup Ecore_IMF_Context_Group
1787  * @brief Sets the input panel-specific data to deliver to the input panel.
1788  * This API is used by applications to deliver specific data to the input panel.
1789  * The data format MUST be negotiated by both application and the input panel.
1790  * The size and format of data are defined by the input panel.
1791  *
1792  * @param ctx An #Ecore_IMF_Context.
1793  * @param data The specific data to be set to the input panel.
1794  * @param len the length of data, in bytes, to send to the input panel
1795  * @since 1.2.0
1796  */
1797 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
1798 
1799 /**
1800  * @ingroup Ecore_IMF_Context_Group
1801  * @brief Gets the specific data of the current active input panel.
1802  *
1803  * @param ctx An #Ecore_IMF_Context.
1804  * @param data The specific data to be got from the input panel
1805  * @param len The length of data
1806  * @since 1.2.0
1807  */
1808 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
1809 
1810 /**
1811  * @ingroup Ecore_IMF_Context_Group
1812  * @brief Sets the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
1813  *
1814  * An input panel displays the string or icon associated with this type.@n
1815  * Regardless of return key type, return key event will be generated when pressing return key.
1816  *
1817  * @param ctx An #Ecore_IMF_Context.
1818  * @param return_key_type The type of "return" key on the input panel
1819  * @note Default type is ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT.
1820  * @since 1.2.0
1821  */
1822 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);
1823 
1824 /**
1825  * @ingroup Ecore_IMF_Context_Group
1826  * @brief Gets the "return" key type.
1827  *
1828  * @see ecore_imf_context_input_panel_return_key_type_set() for more details
1829  *
1830  * @param ctx An #Ecore_IMF_Context.
1831  * @return The type of "return" key on the input panel
1832  * @since 1.2.0
1833  */
1834 EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
1835 
1836 /**
1837  * @ingroup Ecore_IMF_Context_Group
1838  * @brief Sets the return key on the input panel to be disabled.
1839  *
1840  * @param ctx An #Ecore_IMF_Context.
1841  * @param disabled The state
1842  * @since 1.2.0
1843  */
1844 EAPI void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
1845 
1846 /**
1847  * @ingroup Ecore_IMF_Context_Group
1848  * @brief Gets whether the return key on the input panel should be disabled or not.
1849  *
1850  * @param ctx An #Ecore_IMF_Context.
1851  * @return @c EINA_TRUE if it should be disabled.
1852  * @since 1.2.0
1853  */
1854 EAPI Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
1855 
1856 /**
1857  * @ingroup Ecore_IMF_Context_Group
1858  * @brief Sets the caps lock mode on the input panel.
1859  *
1860  * @param ctx An #Ecore_IMF_Context.
1861  * @param mode Turn on caps lock on the input panel if @c EINA_TRUE.
1862  * @since 1.2.0
1863  */
1864 EAPI void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
1865 
1866 /**
1867  * @ingroup Ecore_IMF_Context_Group
1868  * @brief Gets the caps lock mode on the input panel.
1869  *
1870  * @param ctx An #Ecore_IMF_Context.
1871  * @return @c EINA_TRUE if the caps lock is turned on.
1872  * @since 1.2.0
1873  */
1874 EAPI Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
1875 
1876 /**
1877  * @ingroup Ecore_IMF_Context_Group
1878  * @brief Gets the position of the current active input panel.
1879  *
1880  * @param ctx An #Ecore_IMF_Context.
1881  * @param x top-left x co-ordinate of the input panel
1882  * @param y top-left y co-ordinate of the input panel
1883  * @param w width of the input panel
1884  * @param h height of the input panel
1885  * @since 1.3
1886  */
1887 EAPI void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
1888 
1889 /**
1890  * @ingroup Ecore_IMF_Context_Group
1891  * @brief Gets state of current active input panel.
1892  *
1893  * @param ctx An #Ecore_IMF_Context.
1894  * @return The state of input panel.
1895  * @since 1.3
1896  */
1897 EAPI Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
1898 
1899 /**
1900  * @ingroup Ecore_IMF_Context_Group
1901  * @brief Registers a callback function which will be called if there is change in input panel state,language,mode etc.
1902  * In order to deregister the callback function
1903  * Use @ref ecore_imf_context_input_panel_event_callback_del.
1904  *
1905  * @param ctx An #Ecore_IMF_Context
1906  * @param type event type
1907  * @param func the callback function
1908  * @param data application-input panel specific data.
1909  * @since 1.3
1910  */
1911 EAPI void                          ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data);
1912 
1913 /**
1914  * @ingroup Ecore_IMF_Context_Group
1915  * @brief Unregisters a callback function which will be called if there is change in input panel state, language, mode etc.
1916  *
1917  * @param ctx An #Ecore_IMF_Context.
1918  * @param type An #Ecore_IMF_Input_Panel_Event.
1919  * @param func the callback function
1920  * @since 1.3
1921  */
1922 EAPI void                          ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
1923 
1924 /**
1925  * @ingroup Ecore_IMF_Context_Group
1926  * @brief Calls a given input panel callback on the context @p ctx.
1927  *
1928  * @param ctx Ecore_IMF_Context.
1929  * @param type The type of event that will trigger the callback
1930  * @param value the event value
1931  * @since 1.8.0
1932  */
1933 EAPI void                          ecore_imf_context_input_panel_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, int value);
1934 
1935 /**
1936  * @ingroup Ecore_IMF_Context_Group
1937  * @brief Deletes all input panel callback on the context @p ctx.
1938  *
1939  * Deletes all input panel callback to be registered by ecore_imf_context_input_panel_event_callback_add()
1940  *
1941  * @param ctx Ecore_IMF_Context.
1942  * @since 1.8.0
1943  */
1944 EAPI void                          ecore_imf_context_input_panel_event_callback_clear(Ecore_IMF_Context *ctx);
1945 
1946 /**
1947  * @ingroup Ecore_IMF_Context_Group
1948  * @brief Gets the current language locale of the input panel.
1949  *
1950  * ex) fr_FR
1951  *
1952  * @param ctx An #Ecore_IMF_Context.
1953  * @param lang Location to store the retrieved language string. The
1954  *             string retrieved must be freed with free().
1955  * @since 1.3
1956  */
1957 EAPI void                          ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
1958 
1959 /**
1960  * @ingroup Ecore_IMF_Context_Group
1961  * @brief Gets the geometry information of the candidate panel.
1962  *
1963  * @param ctx An #Ecore_IMF_Context.
1964  * @param x top-left x co-ordinate of the candidate panel
1965  * @param y top-left y co-ordinate of the candidate panel
1966  * @param w width of the candidate panel
1967  * @param h height of the candidate panel
1968  * @since 1.3
1969  */
1970 EAPI void                          ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
1971 
1972 /**
1973  * @ingroup Ecore_IMF_Context_Group
1974  * @brief Sets whether the Input Method Context should request to show the input panel in case of only a user's explicit Mouse Up event.
1975  * It doesn't request to show the input panel even though the Input Method Context has focus.
1976  *
1977  * @param ctx An #Ecore_IMF_Context.
1978  * @param ondemand If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)
1979  * @since 1.8.0
1980  */
1981 EAPI void                          ecore_imf_context_input_panel_show_on_demand_set(Ecore_IMF_Context *ctx, Eina_Bool ondemand);
1982 
1983 /**
1984  * @ingroup Ecore_IMF_Context_Group
1985  * @brief Gets whether the Input Method Context should request to show the input panel in case of only a user's explicit Mouse Up event.
1986  *
1987  * @param ctx An #Ecore_IMF_Context.
1988  * @return @c EINA_TRUE if the input panel will be shown in case of only Mouse up event.
1989  * @since 1.8.0
1990  */
1991 EAPI Eina_Bool                     ecore_imf_context_input_panel_show_on_demand_get(Ecore_IMF_Context *ctx);
1992 
1993 /**
1994  * @ingroup Ecore_IMF_Context_Group
1995  * @brief Sets the bidirectionality at the current cursor position.
1996  *
1997  * @since 1.12.0
1998  *
1999  * @param[in] ctx An #Ecore_IMF_Context
2000  * @param[in] direction The direction mode
2001  */
2002 EAPI void                          ecore_imf_context_bidi_direction_set(Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction);
2003 
2004 /**
2005  * @ingroup Ecore_IMF_Context_Group
2006  * @brief Gets the bidirectionality at the current cursor position.
2007  *
2008  * @since 1.12.0
2009  *
2010  * @param[in] ctx An #Ecore_IMF_Context
2011  * @return The direction mode
2012  */
2013 EAPI Ecore_IMF_BiDi_Direction      ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx);
2014 
2015 /**
2016  * @ingroup Ecore_IMF_Context_Group
2017  * @brief Get the keyboard mode on the input panel.
2018  *
2019  * @since 1.20.0
2020  *
2021  * @param[in] ctx An #Ecore_IMF_Context
2022  * @return the keyboard mode
2023  */
2024 EAPI Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx);
2025 
2026 /**
2027  * @ingroup Ecore_IMF_Context_Group
2028  * @brief Set the prediction hint string to deliver to the input panel.
2029  *
2030  * This API can be used when you want to set prediction hint to use intelligent reply suggestion service.
2031  * The intelligent reply suggestion service generates reply candidates for given prediction hint.
2032  * Example
2033  * prediction hint: How are you? -> result: I'm fine, Not bad, I'm all right.
2034  *
2035  * @since 1.20.0
2036  *
2037  * @param[in] ctx An #Ecore_IMF_Context
2038  * @param[in] prediction_hint The prediction hint string.
2039  */
2040 EAPI void                          ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *prediction_hint);
2041 
2042 /**
2043  * @ingroup Ecore_IMF_Context_Group
2044  * @brief Sets the allowed MIME type to deliver to the input panel.
2045  *
2046  * @since 1.20.0
2047  *
2048  * @param[in] ctx An #Ecore_IMF_Context
2049  * @param[in] mime_type The allowed MIME type in entry
2050  *
2051  * Example
2052  * @code
2053  * const char *mime_type = "text/plain,image/png,application/pdf";
2054  * ecore_imf_context_mime_type_accept_set(imf_context, mime_type);
2055  * @endcode
2056  */
2057 EAPI void                         ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_type);
2058 
2059 /**
2060  * @ingroup Ecore_IMF_Context_Group
2061  * @brief Sets the x,y coordinates of the input panel.
2062  * @remarks This API can be used in floating mode.
2063  *
2064  * @since 1.21.0
2065  *
2066  * @param[in] ctx An #Ecore_IMF_Context
2067  * @param x top-left x coordinate of the input panel
2068  * @param y top-left y coordinate of the input panel
2069  */
2070 EAPI void                         ecore_imf_context_input_panel_position_set(Ecore_IMF_Context *ctx, int x, int y);
2071 
2072 /**
2073  * @ingroup Ecore_IMF_Context_Group
2074  * @brief Sets the prediction hint data at the specified key
2075  *
2076  * @since 1.21.0
2077  *
2078  * @param[in] ctx An #Ecore_IMF_Context
2079  * @param key The key of the prediction hint
2080  * @param value The data to replace
2081  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
2082  *
2083  * This function modifies the data of @p key with @p data in the hash associated @p
2084  * ctx. If no entry is found, @p data is added to the hash associated @p ctx with the
2085  * key @p key. On success this function returns EINA_TRUE,
2086  * otherwise it returns @c EINA_FALSE.
2087  */
2088 EAPI Eina_Bool                    ecore_imf_context_prediction_hint_hash_set(Ecore_IMF_Context *ctx, const char *key, const char *value);
2089 
2090 /**
2091  * @ingroup Ecore_IMF_Context_Group
2092  * @brief Removes the prediction hint data identified by a key
2093  *
2094  * @since 1.21.0
2095  *
2096  * @param[in] ctx An #Ecore_IMF_Context
2097  * @param key The key of the prediction hint
2098  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
2099  *
2100  * This function removes the entry identified by @p key from the hash associated @p ctx.
2101  */
2102 EAPI Eina_Bool                    ecore_imf_context_prediction_hint_hash_del(Ecore_IMF_Context *ctx, const char *key);
2103 
2104 /**
2105  * @ingroup Ecore_IMF_Context_Group
2106  * @brief Gets the hash table of prediction hint data
2107  *
2108  * @since 1.21.0
2109  *
2110  * @param[in] ctx An #Ecore_IMF_Context
2111  * @return The prediction hint hash table
2112  */
2113 EAPI const Eina_Hash             *ecore_imf_context_prediction_hint_hash_get(Ecore_IMF_Context *ctx);
2114 
2115 /* The following entry points must be exported by each input method module
2116  */
2117 
2118 /*
2119  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
2120  * void               imf_module_exit   (void);
2121  * Ecore_IMF_Context *imf_module_create (void);
2122  */
2123 
2124 #ifdef __cplusplus
2125 }
2126 #endif
2127 
2128 #undef EAPI
2129 #define EAPI
2130 
2131 #endif
2132