Tizen 2.1 base
[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. @since 1.7 */
45    ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,           /**< called when the language of the input panel is changed. @since 1.7 */
46    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT,         /**< called when the shift key state of the input panel is changed @since 1.7 */
47    ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT,           /**< called when the size of the input panel is changed. @since 1.7 */
48    ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT,          /**< called when the state of the candidate word panel is changed. @since 1.7 */
49    ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT        /**< called when the size of the candidate word panel is changed. @since 1.7 */
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 @since 1.7 */
55    ECORE_IMF_INPUT_PANEL_STATE_HIDE,        /**< Notification prior to the dismissal of the input panel @since 1.7 */
56    ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW    /**< Notification prior to the display of the input panel @since 1.7 */
57 } Ecore_IMF_Input_Panel_State;
58
59 typedef enum
60 {
61     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF, /**< @since 1.7 */
62     ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON   /**< @since 1.7 */
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 @since 1.7 */
68    ECORE_IMF_CANDIDATE_PANEL_HIDE         /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */
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. @since 1.2 */
114    ECORE_IMF_CALLBACK_PREEDIT_END,        /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. @since 1.2 */
115    ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. @since 1.2 */
116    ECORE_IMF_CALLBACK_COMMIT,             /**< "COMMIT" is called when a complete input sequence has been entered by the user @since 1.2 */
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 @since 1.2 */
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.7 */
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 /**
165  * @typedef Ecore_IMF_Mouse_Flags
166  * Type for Ecore_IMF mouse flags
167  */
168 typedef enum
169 {
170    ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
171    ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
172    ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
173 } Ecore_IMF_Mouse_Flags;
174
175 typedef enum
176 {
177    ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
178    ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
179    ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
180    ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
181    ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
182    ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
183    ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
184    ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
185 } Ecore_IMF_Input_Mode;
186
187 /**
188  * @typedef Ecore_IMF_Preedit_Type
189  *
190  * Ecore IMF Preedit style types
191  *
192  * @see ecore_imf_context_preedit_string_with_attributes_get()
193  */
194 typedef enum
195 {
196    ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style @since 1.1 */
197    ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 @since 1.1 */
198    ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 @since 1.1 */
199    ECORE_IMF_PREEDIT_TYPE_SUB3, /**< Substring style 3 @since 1.1 */
200    ECORE_IMF_PREEDIT_TYPE_SUB4, /**< Substring style 4 @since 1.8 */
201    ECORE_IMF_PREEDIT_TYPE_SUB5, /**< Substring style 5 @since 1.8 */
202    ECORE_IMF_PREEDIT_TYPE_SUB6, /**< Substring style 6 @since 1.8 */
203    ECORE_IMF_PREEDIT_TYPE_SUB7  /**< Substring style 7 @since 1.8 */
204 } Ecore_IMF_Preedit_Type;
205
206 /**
207  * @typedef Ecore_IMF_Autocapital_Type
208  *
209  * Autocapitalization Types.
210  *
211  * @see ecore_imf_context_autocapital_type_set()
212  */
213 typedef enum
214 {
215    ECORE_IMF_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing @since 1.1 */
216    ECORE_IMF_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed @since 1.1 */
217    ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence @since 1.1 */
218    ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters @since 1.1 */
219 } Ecore_IMF_Autocapital_Type;
220
221 /**
222  * @typedef Ecore_IMF_Input_Panel_Layout
223  *
224  * Input panel (virtual keyboard) layout types.
225  *
226  * @see ecore_imf_context_input_panel_layout_set()
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,         /**< Never use this */
239    ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,             /**< Hexadecimal layout @since 1.2 */
240    ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,        /**< Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */
241    ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD         /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
242 } Ecore_IMF_Input_Panel_Layout;
243
244 /**
245  * @typedef Ecore_IMF_Input_Panel_Lang
246  *
247  * Input panel (virtual keyboard) language modes.
248  *
249  * @see ecore_imf_context_input_panel_language_set()
250  */
251 typedef enum
252 {
253    ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic @since 1.2 */
254    ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet @since 1.2 */
255 } Ecore_IMF_Input_Panel_Lang;
256
257 /**
258  * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
259  *
260  * "Return" Key types on the input panel (virtual keyboard).
261  *
262  * @see ecore_imf_context_input_panel_return_key_type_set()
263  */
264 typedef enum
265 {
266    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
267    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done @since 1.2 */
268    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go @since 1.2 */
269    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join @since 1.2 */
270    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login @since 1.2 */
271    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next @since 1.2 */
272    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search or magnifier icon @since 1.2 */
273    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND,    /**< Send @since 1.2 */
274    ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN   /**< Sign-in @since 1.8 */
275 } Ecore_IMF_Input_Panel_Return_Key_Type;
276
277 struct _Ecore_IMF_Event_Preedit_Start
278 {
279    Ecore_IMF_Context *ctx;
280 };
281
282 struct _Ecore_IMF_Event_Preedit_End
283 {
284    Ecore_IMF_Context *ctx;
285 };
286
287 struct _Ecore_IMF_Event_Preedit_Changed
288 {
289    Ecore_IMF_Context *ctx;
290 };
291
292 struct _Ecore_IMF_Event_Commit
293 {
294    Ecore_IMF_Context *ctx;
295    char              *str;
296 };
297
298 struct _Ecore_IMF_Event_Delete_Surrounding
299 {
300    Ecore_IMF_Context *ctx;
301    int                offset;
302    int                n_chars;
303 };
304
305 struct _Ecore_IMF_Event_Mouse_Down
306 {
307    int button;                             /**< The button which has been pressed */
308    struct {
309       int x, y;
310    } output;
311    struct {
312       int x, y;
313    } canvas;
314    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
315    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
316    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
317    unsigned int                 timestamp; /**< The timestamp when the event occurred */
318 };
319
320 struct _Ecore_IMF_Event_Mouse_Up
321 {
322    int button;                             /**< The button which has been pressed */
323    struct {
324       int x, y;
325    } output;
326    struct {
327       int x, y;
328    } canvas;
329    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
330    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
331    Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
332    unsigned int                 timestamp; /**< The timestamp when the event occurred */
333 };
334
335 struct _Ecore_IMF_Event_Mouse_In
336 {
337    int buttons;
338    struct {
339       int x, y;
340    } output;
341    struct {
342       int x, y;
343    } canvas;
344    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
345    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
346    unsigned int                 timestamp; /**< The timestamp when the event occurred */
347 };
348
349 struct _Ecore_IMF_Event_Mouse_Out
350 {
351    int buttons;
352    struct {
353       int x, y;
354    } output;
355    struct {
356       int x, y;
357    } canvas;
358    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
359    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
360    unsigned int                 timestamp; /**< The timestamp when the event occurred */
361 };
362
363 struct _Ecore_IMF_Event_Mouse_Move
364 {
365    int buttons;
366    struct {
367       struct {
368          int x, y;
369       } output;
370       struct {
371          int x, y;
372       } canvas;
373    } cur, prev;
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    unsigned int                 timestamp; /**< The timestamp when the event occurred */
377 };
378
379 struct _Ecore_IMF_Event_Mouse_Wheel
380 {
381    int direction;                         /* 0 = default up/down wheel */
382    int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
383    struct {
384       int x, y;
385    } output;
386    struct {
387       int x, y;
388    } canvas;
389    Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
390    Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
391    unsigned int                 timestamp; /**< The timestamp when the event occurred */
392 };
393
394 struct _Ecore_IMF_Event_Key_Down
395 {
396    const char                   *keyname;   /**< The string name of the key pressed */
397    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
398    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
399    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
400    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
401    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 */
402    unsigned int                  timestamp; /**< The timestamp when the event occurred */
403 };
404
405 struct _Ecore_IMF_Event_Key_Up
406 {
407    const char                   *keyname;   /**< The string name of the key pressed */
408    Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
409    Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
410    const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
411    const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
412    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 */
413    unsigned int                  timestamp; /**< The timestamp when the event occurred */
414 };
415
416 union _Ecore_IMF_Event
417 {
418    Ecore_IMF_Event_Mouse_Down  mouse_down;
419    Ecore_IMF_Event_Mouse_Up    mouse_up;
420    Ecore_IMF_Event_Mouse_In    mouse_in;
421    Ecore_IMF_Event_Mouse_Out   mouse_out;
422    Ecore_IMF_Event_Mouse_Move  mouse_move;
423    Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
424    Ecore_IMF_Event_Key_Down    key_down;
425    Ecore_IMF_Event_Key_Up      key_up;
426 };
427
428 struct _Ecore_IMF_Preedit_Attr
429 {
430    Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
431    unsigned int start_index;            /**< start index of the range (in bytes) */
432    unsigned int end_index;              /**< end index of the range (in bytes) */
433 };
434
435 struct _Ecore_IMF_Context_Class
436 {
437    void (*add)                 (Ecore_IMF_Context *ctx);
438    void (*del)                 (Ecore_IMF_Context *ctx);
439    void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window);
440    void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas);
441    void (*show)                (Ecore_IMF_Context *ctx);
442    void (*hide)                (Ecore_IMF_Context *ctx);
443    void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
444    void (*focus_in)            (Ecore_IMF_Context *ctx);
445    void (*focus_out)           (Ecore_IMF_Context *ctx);
446    void (*reset)               (Ecore_IMF_Context *ctx);
447    void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos);
448    void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
449    void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
450    Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
451    void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
452    void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
453    void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
454    void (*control_panel_show)   (Ecore_IMF_Context *ctx);
455    void (*control_panel_hide)   (Ecore_IMF_Context *ctx);
456    void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
457    Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx);
458    void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
459    Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
460    void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
461    void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
462    void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
463    void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
464    void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
465    void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
466    void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
467    Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
468    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);
469    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));
470    void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
471    void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
472 };
473
474 struct _Ecore_IMF_Context_Info
475 {
476    const char *id;              /* ID */
477    const char *description;     /* Human readable description */
478    const char *default_locales; /* Languages for which this context is the default, separated by : */
479    const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
480    int         canvas_required; /* Whether the canvas usage is required for this input method */
481 };
482
483 /**
484  * @}
485  */
486
487 EAPI int                           ecore_imf_init(void);
488 EAPI int                           ecore_imf_shutdown(void);
489
490 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));
491
492 EAPI Eina_List                    *ecore_imf_context_available_ids_get(void);
493 EAPI Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
494 EAPI const char                   *ecore_imf_context_default_id_get(void);
495 EAPI const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
496 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
497
498 EAPI Ecore_IMF_Context            *ecore_imf_context_add(const char *id);
499 EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
500 EAPI void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);
501 EAPI void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
502 EAPI void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
503 EAPI void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
504 EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
505 EAPI void                          ecore_imf_context_show(Ecore_IMF_Context *ctx);
506 EAPI void                          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
507 EAPI void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
508 EAPI void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
509 EAPI void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
510 EAPI void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
511 EAPI void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);
512 EAPI void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
513 EAPI void                          ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
514 EAPI void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
515 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);
516 EAPI void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
517 EAPI Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
518 EAPI Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
519
520 /* plugin specific functions */
521 EAPI Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
522 EAPI void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
523 EAPI void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
524 EAPI Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
525 EAPI void                          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
526 EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
527 EAPI void                          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
528 EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
529 EAPI void                          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
530 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);
531 EAPI void                         *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
532 EAPI void                          ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
533 EAPI void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
534 EAPI Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
535 EAPI void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
536 EAPI Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
537
538 EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
539 EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
540
541 EAPI void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
542 EAPI void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
543 EAPI void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
544 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
545 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
546 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
547 EAPI void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
548 EAPI Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
549 EAPI void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
550 EAPI void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
551 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);
552 EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
553 EAPI void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
554 EAPI Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
555 EAPI void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
556 EAPI Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
557 EAPI void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
558 EAPI Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
559 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);
560 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));
561 EAPI void                          ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
562 EAPI void                          ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
563
564 /* The following entry points must be exported by each input method module
565  */
566
567 /*
568  * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
569  * void               imf_module_exit   (void);
570  * Ecore_IMF_Context *imf_module_create (void);
571  */
572
573 #ifdef __cplusplus
574 }
575 #endif
576
577 #endif