5e71c141e0df1032d344ed8efe78c3cc4c3ac11b
[profile/ivi/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 #include <Ecore_IMF_Input_Panel_Key.h>
6
7 #ifdef EAPI
8 # undef EAPI
9 #endif
10
11 #ifdef _WIN32
12 # ifdef EFL_ECORE_IMF_BUILD
13 #  ifdef DLL_EXPORT
14 #   define EAPI __declspec(dllexport)
15 #  else
16 #   define EAPI
17 #  endif /* ! DLL_EXPORT */
18 # else
19 #  define EAPI __declspec(dllimport)
20 # endif /* ! EFL_ECORE_IMF_BUILD */
21 #else
22 # ifdef __GNUC__
23 #  if __GNUC__ >= 4
24 #   define EAPI __attribute__ ((visibility("default")))
25 #  else
26 #   define EAPI
27 #  endif
28 # else
29 #  define EAPI
30 # endif
31 #endif /* ! _WIN32 */
32
33 /* Faked 'bool'.  */
34 #ifndef __cplusplus
35 # ifndef bool
36 #  define bool int
37 #  ifndef FALSE
38 #   define FALSE 0
39 #  endif
40 #  ifndef TRUE 
41 #   define TRUE 1
42 #  endif
43 # endif
44 #endif
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 /* ecore_imf_context_input_panel_event_callback_add() flag */
51 typedef enum
52 {
53    ECORE_IMF_INPUT_PANEL_STATE_EVENT,              /**< Input Panel STATE Event */
54    ECORE_IMF_INPUT_PANEL_MODE_EVENT,               /**< Input Panel MODE Event */
55    ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,           /**< Input Panel LANGUAGE Event */
56    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT,         /**< Input Panel SHIFT MODE */
57    ECORE_IMF_INPUT_PANEL_PREEDIT_MODE_EVENT,       /**< Input Panel PREEDIT MODE */
58    ECORE_IMF_INPUT_PANEL_COMPLETION_MODE_EVENT,    /**< Input Panel COMPLETION MODE */
59    ECORE_IMF_INPUT_PANEL_CUSTOM_INPUT_MODE_EVENT,  /**< Input Panel CUSTOM INPUT MODE */
60
61    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_01,       /**< Input Panel PRIVATE CONTEXT */
62    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_02,       /**< Input Panel PRIVATE CONTEXT */
63    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_03,       /**< Input Panel PRIVATE CONTEXT */
64    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_04,       /**< Input Panel PRIVATE CONTEXT */
65    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_05,       /**< Input Panel PRIVATE CONTEXT */
66    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_06,       /**< Input Panel PRIVATE CONTEXT */
67    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_07,       /**< Input Panel PRIVATE CONTEXT */
68    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_08,       /**< Input Panel PRIVATE CONTEXT */
69    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_09,       /**< Input Panel PRIVATE CONTEXT */
70    ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_10,       /**< Input Panel PRIVATE CONTEXT */
71    ECORE_IMF_INPUT_PANEL_EVENT_INVALID
72 } Ecore_IMF_Input_Panel_Event;
73
74 typedef enum
75 {
76    ECORE_IMF_INPUT_PANEL_STATE_SHOW,    /**< Show Input panel */
77    ECORE_IMF_INPUT_PANEL_STATE_HIDE,    /**< Hide Input panel */
78    ECORE_IMF_INPUT_PANEL_STATE_INVALID
79 } Ecore_IMF_Input_Panel_State;
80
81 typedef enum
82 {
83    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default 4x4 layout */
84    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
85    ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
86    ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
87    ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
88    ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
89    ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
90    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
91    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_1 = 100,  /* Reserved for future use */
92    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_2,
93    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_3,
94    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_4,
95    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_5,
96    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_6,
97    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_7,
98    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_8,
99    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_9,
100    ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_10,
101    ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID
102 } Ecore_IMF_Input_Panel_Layout;
103
104 typedef enum
105 {
106    ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic */
107    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet */
108 } Ecore_IMF_Input_Panel_Lang;
109
110 typedef enum
111 {
112    ECORE_IMF_KEYBOARD_LANG_NATIVE,  /**< Native */
113    ECORE_IMF_KEYBOARD_LANG_ALPHABET /**< Alphabet */
114 } Ecore_IMF_Keyboard_Lang;
115
116 typedef enum
117 {
118    ECORE_IMF_AUTOCORRECTION_DEFAULT,
119    ECORE_IMF_AUTOCORRECTION_NO,
120    ECORE_IMF_AUTOCORRECTION_YES,
121    ECORE_IMF_AUTOCORRECTION_INVALID
122 } Ecore_IMF_Autocorrection;
123
124 typedef enum
125 {
126    ECORE_IMF_INPUT_PANEL_CAPS_MODE_OFF,     /**< Off */
127    ECORE_IMF_INPUT_PANEL_CAPS_MODE_ON,      /**< On */
128    ECORE_IMF_INPUT_PANEL_CAPS_MODE_LOCK,    /**< Lock */
129 } Ecore_IMF_Input_Panel_Caps_Mode;
130
131 typedef enum
132 {
133    ECORE_IMF_INPUT_PANEL_ORIENT_NONE,
134    ECORE_IMF_INPUT_PANEL_ORIENT_90_CW, /* Clockwise */
135    ECORE_IMF_INPUT_PANEL_ORIENT_180,
136    ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW /* CounterClockwise */
137 } Ecore_IMF_Input_Panel_Orient;
138
139 typedef struct
140 {
141    int layout_idx;
142    int key_idx;
143    Eina_Bool disabled;
144 } Disable_Key_Item;
145
146 typedef struct
147 {
148    int layout_idx;
149    int key_idx;
150    int type;
151    char data[128]; // label or image path
152    int key_value;
153    char key_string[32];
154 } Private_Key_Item;
155
156 /* Events sent by the Input Method */
157 typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
158 typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
159 typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
160 typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
161 typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
162
163 /* Events to filter */
164 typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
165 typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
166 typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
167 typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
168 typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
169 typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
170 typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
171 typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
172 typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;
173
174 typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
175 typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
176 typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */
177
178 /* Preedit attribute info */
179 typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;
180
181 EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
182 EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
183 EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
184 EAPI extern int ECORE_IMF_EVENT_COMMIT;
185 EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
186
187 typedef enum
188 {
189    ECORE_IMF_EVENT_MOUSE_DOWN,
190    ECORE_IMF_EVENT_MOUSE_UP,
191    ECORE_IMF_EVENT_MOUSE_IN,
192    ECORE_IMF_EVENT_MOUSE_OUT,
193    ECORE_IMF_EVENT_MOUSE_MOVE,
194    ECORE_IMF_EVENT_MOUSE_WHEEL,
195    ECORE_IMF_EVENT_KEY_DOWN,
196    ECORE_IMF_EVENT_KEY_UP
197 } Ecore_IMF_Event_Type;
198
199 typedef enum
200 {
201    ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
202    ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
203    ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
204    ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
205    ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3  /**< "Win" (between "Ctrl" and "Alt") is pressed */
206 } Ecore_IMF_Keyboard_Modifiers;
207
208 typedef enum
209 {
210    ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
211    ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
212    ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
213    ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
214 } Ecore_IMF_Keyboard_Locks;
215
216 typedef enum
217 {
218    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
219    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
220    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
221 } Ecore_IMF_Mouse_Flags;
222
223 typedef enum
224 {
225    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
226    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
227    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
228    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
229    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
230    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
231    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
232    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
233 } Ecore_IMF_Input_Mode;
234
235 typedef enum
236 {
237    ECORE_IMF_PREEDIT_TYPE_NONE,
238    ECORE_IMF_PREEDIT_TYPE_SUB1,
239    ECORE_IMF_PREEDIT_TYPE_SUB2,
240    ECORE_IMF_PREEDIT_TYPE_SUB3
241 } Ecore_IMF_Preedit_Type;
242
243 struct _Ecore_IMF_Event_Preedit_Start
244 {
245    Ecore_IMF_Context *ctx;
246 };
247
248 struct _Ecore_IMF_Event_Preedit_End
249 {
250    Ecore_IMF_Context *ctx;
251 };
252
253 struct _Ecore_IMF_Event_Preedit_Changed
254 {
255    Ecore_IMF_Context *ctx;
256 };
257
258 struct _Ecore_IMF_Event_Commit
259 {
260    Ecore_IMF_Context *ctx;
261    char              *str;
262 };
263
264 struct _Ecore_IMF_Event_Delete_Surrounding
265 {
266    Ecore_IMF_Context *ctx;
267    int                offset;
268    int                n_chars;
269 };
270
271 struct _Ecore_IMF_Event_Mouse_Down
272 {
273    int button;                             /**< The button which has been pressed */
274    struct {
275       int x, y;
276    } output;
277    struct {
278       int x, y;
279    } canvas;
280    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
281    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
282    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
283    unsigned int                 timestamp; /**< The timestamp when the event occurred */
284 };
285
286 struct _Ecore_IMF_Event_Mouse_Up
287 {
288    int button;                             /**< The button which has been pressed */
289    struct {
290       int x, y;
291    } output;
292    struct {
293       int x, y;
294    } canvas;
295    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
296    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
297    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
298    unsigned int                 timestamp; /**< The timestamp when the event occurred */
299 };
300
301 struct _Ecore_IMF_Event_Mouse_In
302 {
303    int buttons;
304    struct {
305       int x, y;
306    } output;
307    struct {
308       int x, y;
309    } canvas;
310    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
311    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
312    unsigned int                 timestamp; /**< The timestamp when the event occurred */
313 };
314
315 struct _Ecore_IMF_Event_Mouse_Out
316 {
317    int buttons;
318    struct {
319       int x, y;
320    } output;
321    struct {
322       int x, y;
323    } canvas;
324    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
325    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
326    unsigned int                 timestamp; /**< The timestamp when the event occurred */
327 };
328
329 struct _Ecore_IMF_Event_Mouse_Move
330 {
331    int buttons;
332    struct {
333       struct {
334          int x, y;
335       } output;
336       struct {
337          int x, y;
338       } canvas;
339    } cur, prev;
340    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
341    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
342    unsigned int                 timestamp; /**< The timestamp when the event occurred */
343 };
344
345 struct _Ecore_IMF_Event_Mouse_Wheel
346 {
347    int direction;                         /* 0 = default up/down wheel */
348    int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
349    struct {
350       int x, y;
351    } output;
352    struct {
353       int x, y;
354    } canvas;
355    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
356    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
357    unsigned int                 timestamp; /**< The timestamp when the event occurred */
358 };
359
360 struct _Ecore_IMF_Event_Key_Down
361 {
362    const char                   *keyname;   /**< The string name of the key pressed */
363    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
364    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
365    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
366    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
367    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 */
368    unsigned int                  timestamp; /**< The timestamp when the event occurred */
369 };
370
371 struct _Ecore_IMF_Event_Key_Up
372 {
373    const char                   *keyname;   /**< The string name of the key pressed */
374    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
375    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
376    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
377    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
378    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 */
379    unsigned int                  timestamp; /**< The timestamp when the event occurred */
380 };
381
382 union _Ecore_IMF_Event
383 {
384    Ecore_IMF_Event_Mouse_Down  mouse_down;
385    Ecore_IMF_Event_Mouse_Up    mouse_up;
386    Ecore_IMF_Event_Mouse_In    mouse_in;
387    Ecore_IMF_Event_Mouse_Out   mouse_out;
388    Ecore_IMF_Event_Mouse_Move  mouse_move;
389    Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
390    Ecore_IMF_Event_Key_Down    key_down;
391    Ecore_IMF_Event_Key_Up      key_up;
392 };
393
394 struct _Ecore_IMF_Preedit_Attr
395 {
396    Ecore_IMF_Preedit_Type preedit_type;
397    unsigned int start_index;
398    unsigned int end_index;
399 };
400
401 struct _Ecore_IMF_Context_Class
402 {
403    void (*add)                 (Ecore_IMF_Context *ctx);
404    void (*del)                 (Ecore_IMF_Context *ctx);
405    void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window);
406    void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas);
407    void (*show)                (Ecore_IMF_Context *ctx);
408    void (*hide)                (Ecore_IMF_Context *ctx);
409    void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
410    void (*focus_in)            (Ecore_IMF_Context *ctx);
411    void (*focus_out)           (Ecore_IMF_Context *ctx);
412    void (*reset)               (Ecore_IMF_Context *ctx);
413    void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos);
414    void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
415    void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
416    Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
417
418    /* Input Panel Control APIs */
419    void (*control_panel_show)   (Ecore_IMF_Context *ctx);
420    void (*control_panel_hide)   (Ecore_IMF_Context *ctx);
421
422    void (*input_panel_layout_set)         (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
423    Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx);
424
425    void (*input_panel_language_set)       (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
426    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
427
428    void (*input_panel_imdata_set)         (Ecore_IMF_Context *ctx, const char* data, int len);
429    void (*input_panel_imdata_get)         (Ecore_IMF_Context *ctx, char* data, int *len);
430
431    void (*input_panel_use_effect_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_effect);
432    void (*input_panel_orient_set)         (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation);
433
434    void (*input_panel_move) (Ecore_IMF_Context *ctx, int x, int y);
435    void (*input_panel_geometry_get)       (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
436    void (*input_panel_private_key_set)    (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, const char* value);
437    void (*input_panel_key_disabled_set)   (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
438
439    void (*input_panel_reset)              (Ecore_IMF_Context *ctx); /* Same as reset to default property*/
440    Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
441
442    /* CallBack APIs  */
443    void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value), void *data);
444    void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallbackFunc) (void *data, Ecore_IMF_Context *ctx, int value));
445
446    /* ISF related APIs */
447    int (*ise_get_ise_language)       (Ecore_IMF_Context *ctx, const char* input_panel_name, char*** langlist);
448    int (*ise_set_isf_language)       (Ecore_IMF_Context *ctx, const char* lang);
449    int (*ise_get_active_isename)     (Ecore_IMF_Context *ctx, char* name);       /**< will be deprecated */
450    int (*ise_set_active_ise_by_name) (Ecore_IMF_Context *ctx, const char* name); /**< will be deprecated */
451    int (*ise_set_active_ise_by_uuid) (Ecore_IMF_Context *ctx, const char* uuid); /**< will be deprecated */
452    int (*ise_get_iselist)            (Ecore_IMF_Context *ctx, char*** iselist);  /**< will be deprecated */
453    void (*input_panel_caps_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode);
454
455    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
456 };
457
458 struct _Ecore_IMF_Context_Info
459 {
460    const char *id;              /* ID */
461    const char *description;     /* Human readable description */
462    const char *default_locales; /* Languages for which this context is the default, separated by : */
463    const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
464    int         canvas_required; /* Whether the canvas usage is required for this input method */
465 };
466
467 EAPI int                           ecore_imf_init(void);
468 EAPI int                           ecore_imf_shutdown(void);
469
470 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));
471
472 EAPI Eina_List                    *ecore_imf_context_available_ids_get(void);
473 EAPI Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
474 EAPI const char                   *ecore_imf_context_default_id_get(void);
475 EAPI const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
476 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
477
478 EAPI Ecore_IMF_Context            *ecore_imf_context_add(const char *id);
479 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
480 EAPI void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);
481 EAPI void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
482 EAPI void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
483 EAPI void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
484 EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
485 EAPI void                          ecore_imf_context_show(Ecore_IMF_Context *ctx);
486 EAPI void                          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
487 EAPI void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
488 EAPI void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
489 EAPI void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
490 EAPI void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
491 EAPI void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);
492 EAPI void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
493 EAPI void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
494 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);
495 EAPI void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
496 EAPI Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
497 EAPI Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
498
499 /* plugin specific functions */
500 EAPI Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
501 EAPI void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
502 EAPI void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
503 EAPI Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
504 EAPI void                          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
505 EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
506 EAPI void                          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
507 EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
508 EAPI void                          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
509
510 EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
511 EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
512
513 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
514 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
515 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
516 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
517 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
518 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
519 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const char * data, int len);
520 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, char *data, int *len);
521 EAPI void                          ecore_imf_context_input_panel_use_effect_set(Ecore_IMF_Context *ctx, Eina_Bool use_effect);
522 EAPI Eina_Bool                     ecore_imf_context_input_panel_use_effect_get(Ecore_IMF_Context *ctx);
523 EAPI void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
524 EAPI void                          ecore_imf_context_input_panel_private_key_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, int key_value, const char* key_string);
525 EAPI Eina_List                    *ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx);
526 EAPI void                          ecore_imf_context_input_panel_reset(Ecore_IMF_Context *ctx);        /* Same as reset to default property*/
527 EAPI void                          ecore_imf_context_input_panel_orient_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient  orientation);
528 EAPI Ecore_IMF_Input_Panel_Orient  ecore_imf_context_input_panel_orient_get(Ecore_IMF_Context *ctx);
529 EAPI Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
530 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);
531 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));
532 EAPI void                          ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
533 EAPI Eina_List                    *ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx);
534 EAPI void                          ecore_imf_context_input_panel_move(Ecore_IMF_Context *ctx, int x, int y);
535 EAPI void                          ecore_imf_context_input_panel_caps_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode);
536
537 EAPI void                          ecore_imf_context_keyboard_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Keyboard_Lang lang);
538 EAPI Ecore_IMF_Keyboard_Lang       ecore_imf_context_keyboard_language_get(Ecore_IMF_Context *ctx);
539
540 /* functions to control isf */
541 EAPI int                           ecore_imf_context_ise_get_ise_language(Ecore_IMF_Context *ctx, const char* ise_name, char ***langlist);
542 EAPI void                          ecore_imf_context_ise_set_isf_language(Ecore_IMF_Context *ctx, const char* lang);
543 EAPI void                          ecore_imf_context_ise_get_active_isename(Ecore_IMF_Context *ctx, char* name);
544 EAPI void                          ecore_imf_context_ise_set_active_ise_by_name(Ecore_IMF_Context *ctx, const char* name);
545 EAPI void                          ecore_imf_context_ise_set_active_ise_by_uuid(Ecore_IMF_Context *ctx, const char* uuid);
546 EAPI int                           ecore_imf_context_ise_get_iselist(Ecore_IMF_Context *ctx, char*** iselist);
547
548 /* The following entry points must be exported by each input method module
549  */
550
551 /*
552  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
553  * void               imf_module_exit   (void);
554  * Ecore_IMF_Context *imf_module_create (void);
555  */
556
557 #ifdef __cplusplus
558 }
559 #endif
560
561 #endif