Git init
[platform/core/uifw/e17.git] / src / modules / illume-keyboard / e_kbd_dict.h
1 #ifndef E_KBD_DICT_H
2 #define E_KBD_DICT_H
3
4 typedef struct _E_Kbd_Dict E_Kbd_Dict;
5 typedef struct _E_Kbd_Dict_Word E_Kbd_Dict_Word;
6 typedef struct _E_Kbd_Dict_Letter E_Kbd_Dict_Letter;
7
8 struct _E_Kbd_Dict_Word
9 {
10    const char *word;
11    int usage;
12 };
13
14 struct _E_Kbd_Dict_Letter
15 {
16    const char *letter;
17    int         dist;
18 };
19
20 struct _E_Kbd_Dict
21 {
22    struct {
23       const char *file;
24       int         fd;
25       const char *dict;
26       int         size;
27    } file;
28    struct {
29       const char *tuples[128][128];
30    } lookup;
31    struct {
32       Ecore_Timer *flush_timer;
33       Eina_List *writes;
34    } changed;
35    struct {
36       Eina_List *letters;
37    } word;
38    struct {
39       Eina_Hash *deadends;
40       Eina_Hash *leads;
41       Eina_List *list;
42       Eina_List *list_ptr;
43    } matches;
44 };
45
46
47 EAPI E_Kbd_Dict *e_kbd_dict_new(const char *file);
48 EAPI void e_kbd_dict_free(E_Kbd_Dict *kd);
49 EAPI void e_kbd_dict_save(E_Kbd_Dict *kd);
50 EAPI void e_kbd_dict_word_usage_adjust(E_Kbd_Dict *kd, const char *word, int adjust);
51 EAPI void e_kbd_dict_word_delete(E_Kbd_Dict *kd, const char *word);
52 EAPI void e_kbd_dict_word_letter_clear(E_Kbd_Dict *kd);
53 EAPI void e_kbd_dict_word_letter_add(E_Kbd_Dict *kd, const char *letter, int dist);
54 EAPI void e_kbd_dict_word_letter_advance(E_Kbd_Dict *kd);
55 EAPI void e_kbd_dict_word_letter_delete(E_Kbd_Dict *kd);
56 EAPI void e_kbd_dict_matches_lookup(E_Kbd_Dict *kd);
57 EAPI void e_kbd_dict_matches_first(E_Kbd_Dict *kd);
58 EAPI void e_kbd_dict_matches_next(E_Kbd_Dict *kd);
59 EAPI const char *e_kbd_dict_matches_match_get(E_Kbd_Dict *kd, int *pri_ret);
60
61 #endif