4e723cd3d34b3e12daed6d18363c5437d3c4c905
[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
42 /* Events sent by the Input Method */
43 typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
44 typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
45 typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
46 typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
47 typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
48
49 /* Events to filter */
50 typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
51 typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
52 typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
53 typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
54 typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
55 typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
56 typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
57 typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
58 typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;
59
60 typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
61 typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
62 typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */
63
64 /* Preedit attribute info */
65 typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;
66
67 EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
68 EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
69 EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
70 EAPI extern int ECORE_IMF_EVENT_COMMIT;
71 EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
72
73 typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
74
75 /**
76  * @typedef Ecore_IMF_Callback_Type
77  *
78  * Ecore IMF Event callback types.
79  *
80  * @see ecore_imf_context_event_callback_add()
81  */
82 typedef enum
83 {
84    ECORE_IMF_CALLBACK_PREEDIT_START,      /**< "PREEDIT_START" is called when a new preediting sequence starts. */
85    ECORE_IMF_CALLBACK_PREEDIT_END,        /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. */
86    ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. */
87    ECORE_IMF_CALLBACK_COMMIT,             /**< "COMMIT" is called when a complete input sequence has been entered by the user */
88    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 */
89 } Ecore_IMF_Callback_Type;
90
91 /**
92  * @typedef Ecore_IMF_Event_Type
93  *
94  * Ecore IMF event types.
95  *
96  * @see ecore_imf_context_filter_event()
97  */
98 typedef enum
99 {
100    ECORE_IMF_EVENT_MOUSE_DOWN,  /**< Mouse Down event */
101    ECORE_IMF_EVENT_MOUSE_UP,    /**< Mouse Up event */
102    ECORE_IMF_EVENT_MOUSE_IN,    /**< Mouse In event */
103    ECORE_IMF_EVENT_MOUSE_OUT,   /**< Mouse Out event */
104    ECORE_IMF_EVENT_MOUSE_MOVE,  /**< Mouse Move event */
105    ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
106    ECORE_IMF_EVENT_KEY_DOWN,    /**< Key Down event */
107    ECORE_IMF_EVENT_KEY_UP       /**< Key Up event */
108 } Ecore_IMF_Event_Type;
109 /**
110  * @typedef Ecore_IMF_Keyboard_Modifiers
111  * Type for Ecore_IMF keyboard modifiers
112  */
113 typedef enum
114 {
115    ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
116    ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
117    ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
118    ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
119    ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3  /**< "Win" (between "Ctrl" and "Alt") is pressed */
120 } Ecore_IMF_Keyboard_Modifiers;
121
122 /**
123  * @typedef Ecore_IMF_Keyboard_Locks
124  * Type for Ecore_IMF keyboard locks
125  */
126 typedef enum
127 {
128    ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
129    ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
130    ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
131    ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
132 } Ecore_IMF_Keyboard_Locks;
133 /**
134  * @typedef Ecore_IMF_Mouse_Flags
135  * Type for Ecore_IMF mouse flags
136  */
137 typedef enum
138 {
139    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
140    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
141    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
142 } Ecore_IMF_Mouse_Flags;
143
144 typedef enum
145 {
146    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
147    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
148    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
149    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
150    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
151    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
152    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
153    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
154 } Ecore_IMF_Input_Mode;
155
156 /**
157  * @typedef Ecore_IMF_Preedit_Type
158  *
159  * Ecore IMF Preedit style types
160  *
161  * @see ecore_imf_context_preedit_string_with_attributes_get()
162  */
163 typedef enum
164 {
165    ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style */
166    ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 */
167    ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 */
168    ECORE_IMF_PREEDIT_TYPE_SUB3  /**< Substring style 3 */
169 } Ecore_IMF_Preedit_Type;
170
171 /**
172  * @typedef Ecore_IMF_Autocapital_Type
173  *
174  * Autocapitalization Types.
175  *
176  * @see ecore_imf_context_autocapital_type_set()
177  */
178 typedef enum
179 {
180    ECORE_IMF_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing */
181    ECORE_IMF_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed */
182    ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence */
183    ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */
184 } Ecore_IMF_Autocapital_Type;
185
186 /**
187  * @typedef Ecore_IMF_Input_Panel_Layout
188  *
189  * Input panel (virtual keyboard) layout types.
190  *
191  * @see ecore_imf_context_input_panel_layout_set()
192  */
193 typedef enum
194 {
195    ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default layout */
196    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
197    ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
198    ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
199    ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
200    ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
201    ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
202    ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
203    ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID,         /**< Never use this */
204    ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,             /**< Hexadecimal layout @since 1.2 */
205    ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,        /**< Command-line terminal layout @since 1.2 */
206    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD         /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
207 } Ecore_IMF_Input_Panel_Layout;
208
209 /**
210  * @typedef Ecore_IMF_Input_Panel_Lang
211  *
212  * Input panel (virtual keyboard) language modes.
213  *
214  * @see ecore_imf_context_input_panel_language_set()
215  */
216 typedef enum
217 {
218    ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic @since 1.2 */
219    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet @since 1.2 */
220 } Ecore_IMF_Input_Panel_Lang;
221
222 /**
223  * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
224  *
225  * "Return" Key types on the input panel (virtual keyboard).
226  *
227  * @see ecore_imf_context_input_panel_return_key_type_set()
228  */
229 typedef enum
230 {
231    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
232    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done @since 1.2 */
233    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go @since 1.2 */
234    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join @since 1.2 */
235    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login @since 1.2 */
236    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next @since 1.2 */
237    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search or magnifier icon @since 1.2 */
238    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND     /**< Send @since 1.2 */
239 } Ecore_IMF_Input_Panel_Return_Key_Type;
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; /**< preedit style type */
395    unsigned int start_index;            /**< start index of the range (in bytes) */
396    unsigned int end_index;              /**< end index of the range (in bytes) */
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    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
416    void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
417    void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
418    void (*control_panel_show)   (Ecore_IMF_Context *ctx);
419    void (*control_panel_hide)   (Ecore_IMF_Context *ctx);
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    void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
423    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
424    void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
425    void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
426    void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
427    void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
428    void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
429    void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
430 };
431
432 struct _Ecore_IMF_Context_Info
433 {
434    const char *id;              /* ID */
435    const char *description;     /* Human readable description */
436    const char *default_locales; /* Languages for which this context is the default, separated by : */
437    const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
438    int         canvas_required; /* Whether the canvas usage is required for this input method */
439 };
440
441 /**
442  * @}
443  */
444
445 EAPI int                           ecore_imf_init(void);
446 EAPI int                           ecore_imf_shutdown(void);
447
448 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));
449
450 EAPI Eina_List                    *ecore_imf_context_available_ids_get(void);
451 EAPI Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
452 EAPI const char                   *ecore_imf_context_default_id_get(void);
453 EAPI const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
454 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
455
456 EAPI Ecore_IMF_Context            *ecore_imf_context_add(const char *id);
457 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
458 EAPI void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);
459 EAPI void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
460 EAPI void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
461 EAPI void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
462 EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
463 EAPI void                          ecore_imf_context_show(Ecore_IMF_Context *ctx);
464 EAPI void                          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
465 EAPI void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
466 EAPI void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
467 EAPI void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
468 EAPI void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
469 EAPI void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);
470 EAPI void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
471 EAPI void                          ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
472 EAPI void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
473 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);
474 EAPI void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
475 EAPI Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
476 EAPI Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
477
478 /* plugin specific functions */
479 EAPI Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
480 EAPI void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
481 EAPI void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
482 EAPI Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
483 EAPI void                          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
484 EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
485 EAPI void                          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
486 EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
487 EAPI void                          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
488 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);
489 EAPI void                         *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
490 EAPI void                          ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
491 EAPI void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
492 EAPI Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
493 EAPI void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
494 EAPI Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
495
496 EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
497 EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
498
499 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
500 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
501 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
502 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
503 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
504 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
505 EAPI void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
506 EAPI Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
507 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
508 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
509 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);
510 EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
511 EAPI void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
512 EAPI Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
513 EAPI void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
514 EAPI Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
515
516 /* The following entry points must be exported by each input method module
517  */
518
519 /*
520  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
521  * void               imf_module_exit   (void);
522  * Ecore_IMF_Context *imf_module_create (void);
523  */
524
525 #ifdef __cplusplus
526 }
527 #endif
528
529 #endif