2f233ef708e34a6d1e1a69037c3f5fe64f1a06b8
[framework/uifw/ecore.git] / src / lib / ecore_imf / Ecore_IMF.h
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_ECORE_IMF_BUILD
12 #  ifdef DLL_EXPORT
13 #   define EAPI __declspec(dllexport)
14 #  else
15 #   define EAPI
16 #  endif /* ! DLL_EXPORT */
17 # else
18 #  define EAPI __declspec(dllimport)
19 # endif /* ! EFL_ECORE_IMF_BUILD */
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 /* ! _WIN32 */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /**
37  * @addtogroup Ecore_IMF_Context_Group
38  *
39  * @{
40  */
41 /* ecore_imf_context_input_panel_event_callback_add() flag */
42 typedef enum
43 {
44    ECORE_IMF_INPUT_PANEL_STATE_EVENT,              /**< called when the state of the input panel is changed. */
45    ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,           /**< called when the language of the input panel is changed. */
46    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT,         /**< called when the shift key state of the input panel is changed */
47    ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT,           /**< called when the size of the input panel is changed. */
48    ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT,          /**< called when the state of the candidate word panel is changed. */
49    ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT        /**< called when the size of the candidate word panel is changed. */
50 } Ecore_IMF_Input_Panel_Event;
51
52 typedef enum
53 {
54    ECORE_IMF_INPUT_PANEL_STATE_SHOW,        /**< Notification after the display of the input panel */
55    ECORE_IMF_INPUT_PANEL_STATE_HIDE,        /**< Notification prior to the dismissal of the input panel */
56    ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW    /**< Notification prior to the display of the input panel */
57 } Ecore_IMF_Input_Panel_State;
58
59 typedef enum
60 {
61     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF,
62     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON
63 } Ecore_IMF_Input_Panel_Shift_Mode;
64
65 typedef enum
66 {
67    ECORE_IMF_CANDIDATE_PANEL_SHOW,        /**< Notification after the display of the candidate word panel */
68    ECORE_IMF_CANDIDATE_PANEL_HIDE         /**< Notification prior to the dismissal of the candidate word panel */
69 } Ecore_IMF_Candidate_Panel_State;
70
71 /* Events sent by the Input Method */
72 typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
73 typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
74 typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
75 typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
76 typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
77
78 /* Events to filter */
79 typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
80 typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
81 typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
82 typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
83 typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
84 typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
85 typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
86 typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
87 typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;
88
89 typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
90 typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
91 typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */
92
93 /* Preedit attribute info */
94 typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;
95
96 EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
97 EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
98 EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
99 EAPI extern int ECORE_IMF_EVENT_COMMIT;
100 EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
101
102 typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
103
104 /**
105  * @typedef Ecore_IMF_Callback_Type
106  *
107  * Ecore IMF Event callback types.
108  *
109  * @see ecore_imf_context_event_callback_add()
110  */
111 typedef enum
112 {
113    ECORE_IMF_CALLBACK_PREEDIT_START,      /**< "PREEDIT_START" is called when a new preediting sequence starts. */
114    ECORE_IMF_CALLBACK_PREEDIT_END,        /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. */
115    ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. */
116    ECORE_IMF_CALLBACK_COMMIT,             /**< "COMMIT" is called when a complete input sequence has been entered by the user */
117    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 */
118 } Ecore_IMF_Callback_Type;
119
120 /**
121  * @typedef Ecore_IMF_Event_Type
122  *
123  * Ecore IMF event types.
124  *
125  * @see ecore_imf_context_filter_event()
126  */
127 typedef enum
128 {
129    ECORE_IMF_EVENT_MOUSE_DOWN,  /**< Mouse Down event */
130    ECORE_IMF_EVENT_MOUSE_UP,    /**< Mouse Up event */
131    ECORE_IMF_EVENT_MOUSE_IN,    /**< Mouse In event */
132    ECORE_IMF_EVENT_MOUSE_OUT,   /**< Mouse Out event */
133    ECORE_IMF_EVENT_MOUSE_MOVE,  /**< Mouse Move event */
134    ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
135    ECORE_IMF_EVENT_KEY_DOWN,    /**< Key Down event */
136    ECORE_IMF_EVENT_KEY_UP       /**< Key Up event */
137 } Ecore_IMF_Event_Type;
138 /**
139  * @typedef Ecore_IMF_Keyboard_Modifiers
140  * Type for Ecore_IMF keyboard modifiers
141  */
142 typedef enum
143 {
144    ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
145    ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
146    ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
147    ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
148    ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
149    ECORE_IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4  /**< "AltGr" is pressed @since 1.3 */
150 } Ecore_IMF_Keyboard_Modifiers;
151
152 /**
153  * @typedef Ecore_IMF_Keyboard_Locks
154  * Type for Ecore_IMF keyboard locks
155  */
156 typedef enum
157 {
158    ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
159    ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
160    ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
161    ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
162 } Ecore_IMF_Keyboard_Locks;
163 /**
164  * @typedef Ecore_IMF_Mouse_Flags
165  * Type for Ecore_IMF mouse flags
166  */
167 typedef enum
168 {
169    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
170    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
171    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
172 } Ecore_IMF_Mouse_Flags;
173
174 typedef enum
175 {
176    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
177    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
178    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
179    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
180    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
181    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
182    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
183    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
184 } Ecore_IMF_Input_Mode;
185
186 /**
187  * @typedef Ecore_IMF_Preedit_Type
188  *
189  * Ecore IMF Preedit style types
190  *
191  * @see ecore_imf_context_preedit_string_with_attributes_get()
192  */
193 typedef enum
194 {
195    ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style */
196    ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 */
197    ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 */
198    ECORE_IMF_PREEDIT_TYPE_SUB3  /**< Substring style 3 */
199 } Ecore_IMF_Preedit_Type;
200
201 /**
202  * @typedef Ecore_IMF_Autocapital_Type
203  *
204  * Autocapitalization Types.
205  *
206  * @see ecore_imf_context_autocapital_type_set()
207  */
208 typedef enum
209 {
210    ECORE_IMF_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing */
211    ECORE_IMF_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed */
212    ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence */
213    ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */
214 } Ecore_IMF_Autocapital_Type;
215
216 /**
217  * @typedef Ecore_IMF_Input_Panel_Layout
218  *
219  * Input panel (virtual keyboard) layout types.
220  *
221  * @see ecore_imf_context_input_panel_layout_set()
222  */
223 typedef enum
224 {
225    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default layout */
226    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
227    ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
228    ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
229    ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
230    ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
231    ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
232    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
233    ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID,         /**< Never use this */
234    ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,             /**< Hexadecimal layout @since 1.2 */
235    ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,        /**< Command-line terminal layout @since 1.2 */
236    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD         /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
237 } Ecore_IMF_Input_Panel_Layout;
238
239 /**
240  * @typedef Ecore_IMF_Input_Panel_Lang
241  *
242  * Input panel (virtual keyboard) language modes.
243  *
244  * @see ecore_imf_context_input_panel_language_set()
245  */
246 typedef enum
247 {
248    ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic @since 1.2 */
249    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet @since 1.2 */
250 } Ecore_IMF_Input_Panel_Lang;
251
252 /**
253  * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
254  *
255  * "Return" Key types on the input panel (virtual keyboard).
256  *
257  * @see ecore_imf_context_input_panel_return_key_type_set()
258  */
259 typedef enum
260 {
261    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
262    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done @since 1.2 */
263    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go @since 1.2 */
264    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join @since 1.2 */
265    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login @since 1.2 */
266    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next @since 1.2 */
267    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search or magnifier icon @since 1.2 */
268    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND     /**< Send @since 1.2 */
269 } Ecore_IMF_Input_Panel_Return_Key_Type;
270
271 struct _Ecore_IMF_Event_Preedit_Start
272 {
273    Ecore_IMF_Context *ctx;
274 };
275
276 struct _Ecore_IMF_Event_Preedit_End
277 {
278    Ecore_IMF_Context *ctx;
279 };
280
281 struct _Ecore_IMF_Event_Preedit_Changed
282 {
283    Ecore_IMF_Context *ctx;
284 };
285
286 struct _Ecore_IMF_Event_Commit
287 {
288    Ecore_IMF_Context *ctx;
289    char              *str;
290 };
291
292 struct _Ecore_IMF_Event_Delete_Surrounding
293 {
294    Ecore_IMF_Context *ctx;
295    int                offset;
296    int                n_chars;
297 };
298
299 struct _Ecore_IMF_Event_Mouse_Down
300 {
301    int button;                             /**< The button which has been pressed */
302    struct {
303       int x, y;
304    } output;
305    struct {
306       int x, y;
307    } canvas;
308    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
309    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
310    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
311    unsigned int                 timestamp; /**< The timestamp when the event occurred */
312 };
313
314 struct _Ecore_IMF_Event_Mouse_Up
315 {
316    int button;                             /**< The button which has been pressed */
317    struct {
318       int x, y;
319    } output;
320    struct {
321       int x, y;
322    } canvas;
323    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
324    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
325    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
326    unsigned int                 timestamp; /**< The timestamp when the event occurred */
327 };
328
329 struct _Ecore_IMF_Event_Mouse_In
330 {
331    int buttons;
332    struct {
333       int x, y;
334    } output;
335    struct {
336       int x, y;
337    } canvas;
338    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
339    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
340    unsigned int                 timestamp; /**< The timestamp when the event occurred */
341 };
342
343 struct _Ecore_IMF_Event_Mouse_Out
344 {
345    int buttons;
346    struct {
347       int x, y;
348    } output;
349    struct {
350       int x, y;
351    } canvas;
352    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
353    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
354    unsigned int                 timestamp; /**< The timestamp when the event occurred */
355 };
356
357 struct _Ecore_IMF_Event_Mouse_Move
358 {
359    int buttons;
360    struct {
361       struct {
362          int x, y;
363       } output;
364       struct {
365          int x, y;
366       } canvas;
367    } cur, prev;
368    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
369    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
370    unsigned int                 timestamp; /**< The timestamp when the event occurred */
371 };
372
373 struct _Ecore_IMF_Event_Mouse_Wheel
374 {
375    int direction;                         /* 0 = default up/down wheel */
376    int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
377    struct {
378       int x, y;
379    } output;
380    struct {
381       int x, y;
382    } canvas;
383    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
384    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
385    unsigned int                 timestamp; /**< The timestamp when the event occurred */
386 };
387
388 struct _Ecore_IMF_Event_Key_Down
389 {
390    const char                   *keyname;   /**< The string name of the key pressed */
391    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
392    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
393    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
394    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
395    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 */
396    unsigned int                  timestamp; /**< The timestamp when the event occurred */
397 };
398
399 struct _Ecore_IMF_Event_Key_Up
400 {
401    const char                   *keyname;   /**< The string name of the key pressed */
402    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
403    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
404    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
405    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
406    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 */
407    unsigned int                  timestamp; /**< The timestamp when the event occurred */
408 };
409
410 union _Ecore_IMF_Event
411 {
412    Ecore_IMF_Event_Mouse_Down  mouse_down;
413    Ecore_IMF_Event_Mouse_Up    mouse_up;
414    Ecore_IMF_Event_Mouse_In    mouse_in;
415    Ecore_IMF_Event_Mouse_Out   mouse_out;
416    Ecore_IMF_Event_Mouse_Move  mouse_move;
417    Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
418    Ecore_IMF_Event_Key_Down    key_down;
419    Ecore_IMF_Event_Key_Up      key_up;
420 };
421
422 struct _Ecore_IMF_Preedit_Attr
423 {
424    Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
425    unsigned int start_index;            /**< start index of the range (in bytes) */
426    unsigned int end_index;              /**< end index of the range (in bytes) */
427 };
428
429 struct _Ecore_IMF_Context_Class
430 {
431    void (*add)                 (Ecore_IMF_Context *ctx);
432    void (*del)                 (Ecore_IMF_Context *ctx);
433    void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window);
434    void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas);
435    void (*show)                (Ecore_IMF_Context *ctx);
436    void (*hide)                (Ecore_IMF_Context *ctx);
437    void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
438    void (*focus_in)            (Ecore_IMF_Context *ctx);
439    void (*focus_out)           (Ecore_IMF_Context *ctx);
440    void (*reset)               (Ecore_IMF_Context *ctx);
441    void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos);
442    void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
443    void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
444    Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
445    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
446    void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
447    void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
448    void (*control_panel_show)   (Ecore_IMF_Context *ctx);
449    void (*control_panel_hide)   (Ecore_IMF_Context *ctx);
450    void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
451    Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx);
452    void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
453    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
454    void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
455    void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
456    void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
457    void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
458    void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
459    void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
460    void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
461    Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
462    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);
463    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));
464    void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
465    void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
466 };
467
468 struct _Ecore_IMF_Context_Info
469 {
470    const char *id;              /* ID */
471    const char *description;     /* Human readable description */
472    const char *default_locales; /* Languages for which this context is the default, separated by : */
473    const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
474    int         canvas_required; /* Whether the canvas usage is required for this input method */
475 };
476
477 /**
478  * @}
479  */
480
481 EAPI int                           ecore_imf_init(void);
482 EAPI int                           ecore_imf_shutdown(void);
483
484 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));
485
486 EAPI Eina_List                    *ecore_imf_context_available_ids_get(void);
487 EAPI Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
488 EAPI const char                   *ecore_imf_context_default_id_get(void);
489 EAPI const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
490 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
491
492 EAPI Ecore_IMF_Context            *ecore_imf_context_add(const char *id);
493 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
494 EAPI void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);
495 EAPI void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
496 EAPI void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
497 EAPI void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
498 EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
499 EAPI void                          ecore_imf_context_show(Ecore_IMF_Context *ctx);
500 EAPI void                          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
501 EAPI void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
502 EAPI void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
503 EAPI void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
504 EAPI void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
505 EAPI void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);
506 EAPI void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
507 EAPI void                          ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
508 EAPI void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
509 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);
510 EAPI void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
511 EAPI Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
512 EAPI Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
513
514 /* plugin specific functions */
515 EAPI Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
516 EAPI void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
517 EAPI void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
518 EAPI Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
519 EAPI void                          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
520 EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
521 EAPI void                          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
522 EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
523 EAPI void                          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
524 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);
525 EAPI void                         *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
526 EAPI void                          ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
527 EAPI void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
528 EAPI Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
529 EAPI void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
530 EAPI Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
531
532 EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
533 EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
534
535 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
536 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
537 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
538 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
539 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
540 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
541 EAPI void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
542 EAPI Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
543 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
544 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
545 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);
546 EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
547 EAPI void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
548 EAPI Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
549 EAPI void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
550 EAPI Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
551 EAPI void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
552 EAPI Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
553 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);
554 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));
555 EAPI void                          ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
556 EAPI void                          ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
557
558 /* The following entry points must be exported by each input method module
559  */
560
561 /*
562  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
563  * void               imf_module_exit   (void);
564  * Ecore_IMF_Context *imf_module_create (void);
565  */
566
567 #ifdef __cplusplus
568 }
569 #endif
570
571 #endif