svn update: 60286 (latest:60286)
[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_LANG_AUTOMATIC,    /**< Automatic */
84    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet */
85 } Ecore_IMF_Input_Panel_Lang;
86
87 typedef enum
88 {
89    ECORE_IMF_KEYBOARD_LANG_NATIVE,  /**< Native */
90    ECORE_IMF_KEYBOARD_LANG_ALPHABET /**< Alphabet */
91 } Ecore_IMF_Keyboard_Lang;
92
93 typedef enum
94 {
95    ECORE_IMF_AUTOCORRECTION_DEFAULT,
96    ECORE_IMF_AUTOCORRECTION_NO,
97    ECORE_IMF_AUTOCORRECTION_YES,
98    ECORE_IMF_AUTOCORRECTION_INVALID
99 } Ecore_IMF_Autocorrection;
100
101 typedef enum
102 {
103    ECORE_IMF_INPUT_PANEL_CAPS_MODE_OFF,     /**< Off */
104    ECORE_IMF_INPUT_PANEL_CAPS_MODE_ON,      /**< On */
105    ECORE_IMF_INPUT_PANEL_CAPS_MODE_LOCK,    /**< Lock */
106 } Ecore_IMF_Input_Panel_Caps_Mode;
107
108 typedef enum
109 {
110    ECORE_IMF_INPUT_PANEL_ORIENT_NONE,
111    ECORE_IMF_INPUT_PANEL_ORIENT_90_CW, /* Clockwise */
112    ECORE_IMF_INPUT_PANEL_ORIENT_180,
113    ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW /* CounterClockwise */
114 } Ecore_IMF_Input_Panel_Orient;
115
116 typedef struct
117 {
118    int layout_idx;
119    int key_idx;
120    Eina_Bool disabled;
121 } Disable_Key_Item;
122
123 typedef struct
124 {
125    int layout_idx;
126    int key_idx;
127    int type;
128    char data[128]; // label or image path
129    int key_value;
130    char key_string[32];
131 } Private_Key_Item;
132
133 /* Events sent by the Input Method */
134 typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
135 typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
136 typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
137 typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
138 typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
139
140 /* Events to filter */
141 typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
142 typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
143 typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
144 typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
145 typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
146 typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
147 typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
148 typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
149 typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;
150
151 typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
152 typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
153 typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */
154
155 /* Preedit attribute info */
156 typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;
157
158 EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
159 EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
160 EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
161 EAPI extern int ECORE_IMF_EVENT_COMMIT;
162 EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
163
164 typedef enum
165 {
166    ECORE_IMF_EVENT_MOUSE_DOWN,
167    ECORE_IMF_EVENT_MOUSE_UP,
168    ECORE_IMF_EVENT_MOUSE_IN,
169    ECORE_IMF_EVENT_MOUSE_OUT,
170    ECORE_IMF_EVENT_MOUSE_MOVE,
171    ECORE_IMF_EVENT_MOUSE_WHEEL,
172    ECORE_IMF_EVENT_KEY_DOWN,
173    ECORE_IMF_EVENT_KEY_UP
174 } Ecore_IMF_Event_Type;
175
176 typedef enum
177 {
178    ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
179    ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
180    ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
181    ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
182    ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3  /**< "Win" (between "Ctrl" and "Alt") is pressed */
183 } Ecore_IMF_Keyboard_Modifiers;
184
185 typedef enum
186 {
187    ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
188    ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
189    ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
190    ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
191 } Ecore_IMF_Keyboard_Locks;
192
193 typedef enum
194 {
195    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
196    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
197    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
198 } Ecore_IMF_Mouse_Flags;
199
200 typedef enum
201 {
202    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
203    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
204    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
205    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
206    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
207    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
208    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
209    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
210 } Ecore_IMF_Input_Mode;
211
212 typedef enum
213 {
214    ECORE_IMF_PREEDIT_TYPE_NONE,
215    ECORE_IMF_PREEDIT_TYPE_SUB1,
216    ECORE_IMF_PREEDIT_TYPE_SUB2,
217    ECORE_IMF_PREEDIT_TYPE_SUB3
218 } Ecore_IMF_Preedit_Type;
219
220 typedef enum
221 {
222    ECORE_IMF_AUTOCAPITAL_TYPE_NONE,
223    ECORE_IMF_AUTOCAPITAL_TYPE_WORD,
224    ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,
225    ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER
226 } Ecore_IMF_Autocapital_Type;
227
228 typedef enum
229 {
230    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default layout */
231    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
232    ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
233    ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
234    ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
235    ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
236    ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
237    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
238    ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID
239 } Ecore_IMF_Input_Panel_Layout;
240
241 struct _Ecore_IMF_Event_Preedit_Start
242 {
243    Ecore_IMF_Context *ctx;
244 };
245
246 struct _Ecore_IMF_Event_Preedit_End
247 {
248    Ecore_IMF_Context *ctx;
249 };
250
251 struct _Ecore_IMF_Event_Preedit_Changed
252 {
253    Ecore_IMF_Context *ctx;
254 };
255
256 struct _Ecore_IMF_Event_Commit
257 {
258    Ecore_IMF_Context *ctx;
259    char              *str;
260 };
261
262 struct _Ecore_IMF_Event_Delete_Surrounding
263 {
264    Ecore_IMF_Context *ctx;
265    int                offset;
266    int                n_chars;
267 };
268
269 struct _Ecore_IMF_Event_Mouse_Down
270 {
271    int button;                             /**< The button which has been pressed */
272    struct {
273       int x, y;
274    } output;
275    struct {
276       int x, y;
277    } canvas;
278    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
279    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
280    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
281    unsigned int                 timestamp; /**< The timestamp when the event occurred */
282 };
283
284 struct _Ecore_IMF_Event_Mouse_Up
285 {
286    int button;                             /**< The button which has been pressed */
287    struct {
288       int x, y;
289    } output;
290    struct {
291       int x, y;
292    } canvas;
293    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
294    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
295    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
296    unsigned int                 timestamp; /**< The timestamp when the event occurred */
297 };
298
299 struct _Ecore_IMF_Event_Mouse_In
300 {
301    int buttons;
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    unsigned int                 timestamp; /**< The timestamp when the event occurred */
311 };
312
313 struct _Ecore_IMF_Event_Mouse_Out
314 {
315    int buttons;
316    struct {
317       int x, y;
318    } output;
319    struct {
320       int x, y;
321    } canvas;
322    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
323    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
324    unsigned int                 timestamp; /**< The timestamp when the event occurred */
325 };
326
327 struct _Ecore_IMF_Event_Mouse_Move
328 {
329    int buttons;
330    struct {
331       struct {
332          int x, y;
333       } output;
334       struct {
335          int x, y;
336       } canvas;
337    } cur, prev;
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_Wheel
344 {
345    int direction;                         /* 0 = default up/down wheel */
346    int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
347    struct {
348       int x, y;
349    } output;
350    struct {
351       int x, y;
352    } canvas;
353    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
354    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
355    unsigned int                 timestamp; /**< The timestamp when the event occurred */
356 };
357
358 struct _Ecore_IMF_Event_Key_Down
359 {
360    const char                   *keyname;   /**< The string name of the key pressed */
361    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
362    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
363    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
364    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
365    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 */
366    unsigned int                  timestamp; /**< The timestamp when the event occurred */
367 };
368
369 struct _Ecore_IMF_Event_Key_Up
370 {
371    const char                   *keyname;   /**< The string name of the key pressed */
372    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
373    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
374    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
375    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
376    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 */
377    unsigned int                  timestamp; /**< The timestamp when the event occurred */
378 };
379
380 union _Ecore_IMF_Event
381 {
382    Ecore_IMF_Event_Mouse_Down  mouse_down;
383    Ecore_IMF_Event_Mouse_Up    mouse_up;
384    Ecore_IMF_Event_Mouse_In    mouse_in;
385    Ecore_IMF_Event_Mouse_Out   mouse_out;
386    Ecore_IMF_Event_Mouse_Move  mouse_move;
387    Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
388    Ecore_IMF_Event_Key_Down    key_down;
389    Ecore_IMF_Event_Key_Up      key_up;
390 };
391
392 struct _Ecore_IMF_Preedit_Attr
393 {
394    Ecore_IMF_Preedit_Type preedit_type;
395    unsigned int start_index;
396    unsigned int end_index;
397 };
398
399 struct _Ecore_IMF_Context_Class
400 {
401    void (*add)                 (Ecore_IMF_Context *ctx);
402    void (*del)                 (Ecore_IMF_Context *ctx);
403    void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window);
404    void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas);
405    void (*show)                (Ecore_IMF_Context *ctx);
406    void (*hide)                (Ecore_IMF_Context *ctx);
407    void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
408    void (*focus_in)            (Ecore_IMF_Context *ctx);
409    void (*focus_out)           (Ecore_IMF_Context *ctx);
410    void (*reset)               (Ecore_IMF_Context *ctx);
411    void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos);
412    void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
413    void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
414    Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
415
416    /* Input Panel Control APIs */
417    void (*control_panel_show)   (Ecore_IMF_Context *ctx);
418    void (*control_panel_hide)   (Ecore_IMF_Context *ctx);
419
420    void (*input_panel_layout_set)         (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
421    Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx);
422
423    void (*input_panel_language_set)       (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
424    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
425
426    void (*input_panel_imdata_set)         (Ecore_IMF_Context *ctx, const char* data, int len);
427    void (*input_panel_imdata_get)         (Ecore_IMF_Context *ctx, char* data, int *len);
428
429    void (*input_panel_use_effect_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_effect);
430    void (*input_panel_orient_set)         (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation);
431
432    void (*input_panel_move) (Ecore_IMF_Context *ctx, int x, int y);
433    void (*input_panel_geometry_get)       (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
434    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);
435    void (*input_panel_key_disabled_set)   (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
436
437    void (*input_panel_reset)              (Ecore_IMF_Context *ctx); /* Same as reset to default property*/
438    Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
439
440    /* CallBack APIs  */
441    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);
442    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));
443
444    /* ISF related APIs */
445    int (*ise_get_ise_language)       (Ecore_IMF_Context *ctx, const char* input_panel_name, char*** langlist);
446    int (*ise_set_isf_language)       (Ecore_IMF_Context *ctx, const char* lang);
447    int (*ise_get_active_isename)     (Ecore_IMF_Context *ctx, char* name);       /**< will be deprecated */
448    int (*ise_set_active_ise_by_name) (Ecore_IMF_Context *ctx, const char* name); /**< will be deprecated */
449    int (*ise_set_active_ise_by_uuid) (Ecore_IMF_Context *ctx, const char* uuid); /**< will be deprecated */
450    int (*ise_get_iselist)            (Ecore_IMF_Context *ctx, char*** iselist);  /**< will be deprecated */
451    void (*input_panel_caps_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode);
452
453    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
454    void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
455    void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
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 EAPI void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
510 EAPI Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
511 EAPI void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
512 EAPI Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
513
514 EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
515 EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
516
517 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
518 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
519 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
520 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
521 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
522 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
523 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const char *data, int len);
524 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, char *data, int *len);
525 EAPI void                          ecore_imf_context_input_panel_use_effect_set(Ecore_IMF_Context *ctx, Eina_Bool use_effect);
526 EAPI Eina_Bool                     ecore_imf_context_input_panel_use_effect_get(Ecore_IMF_Context *ctx);
527 EAPI void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
528 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);
529 EAPI Eina_List                    *ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx);
530 EAPI void                          ecore_imf_context_input_panel_reset(Ecore_IMF_Context *ctx);        /* Same as reset to default property*/
531 EAPI void                          ecore_imf_context_input_panel_orient_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient  orientation);
532 EAPI Ecore_IMF_Input_Panel_Orient  ecore_imf_context_input_panel_orient_get(Ecore_IMF_Context *ctx);
533 EAPI Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
534 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);
535 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));
536 EAPI void                          ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
537 EAPI Eina_List                    *ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx);
538 EAPI void                          ecore_imf_context_input_panel_move(Ecore_IMF_Context *ctx, int x, int y);
539 EAPI void                          ecore_imf_context_input_panel_caps_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode);
540
541 EAPI void                          ecore_imf_context_keyboard_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Keyboard_Lang lang);
542 EAPI Ecore_IMF_Keyboard_Lang       ecore_imf_context_keyboard_language_get(Ecore_IMF_Context *ctx);
543
544 /* functions to control isf */
545 EAPI int                           ecore_imf_context_ise_get_ise_language(Ecore_IMF_Context *ctx, const char* ise_name, char ***langlist);
546 EAPI void                          ecore_imf_context_ise_set_isf_language(Ecore_IMF_Context *ctx, const char* lang);
547 EAPI void                          ecore_imf_context_ise_get_active_isename(Ecore_IMF_Context *ctx, char* name);
548 EAPI void                          ecore_imf_context_ise_set_active_ise_by_name(Ecore_IMF_Context *ctx, const char* name);
549 EAPI void                          ecore_imf_context_ise_set_active_ise_by_uuid(Ecore_IMF_Context *ctx, const char* uuid);
550 EAPI int                           ecore_imf_context_ise_get_iselist(Ecore_IMF_Context *ctx, char*** iselist);
551
552 /* The following entry points must be exported by each input method module
553  */
554
555 /*
556  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
557  * void               imf_module_exit   (void);
558  * Ecore_IMF_Context *imf_module_create (void);
559  */
560
561 #ifdef __cplusplus
562 }
563 #endif
564
565 #endif