2 * Some comments are written in Japanese.
4 * Funded by IPA̤Ƨ¥½¥Õ¥È¥¦¥§¥¢ÁϤ»ö¶È 2001
6 * Comments are in Japanese(EUC-JP)
10 #ifndef INPUT_H_INCLUDE
11 #define INPUT_H_INCLUDE
17 struct anthy_input_context;
19 extern int anthy_input_errno;
24 #define ANTHY_INPUT_ST_OFF 0 /* ̵¸ú¾õÂÖ */ /* anthy agent does not use this state */
25 #define ANTHY_INPUT_ST_NONE 1 /* ÂÔµ¡¾õÂÖ */
26 #define ANTHY_INPUT_ST_EDIT 2 /* ÊÔ½¸¾õÂÖ */
27 #define ANTHY_INPUT_ST_CONV 3 /* ÊÑ´¹¾õÂÖ */
28 #define ANTHY_INPUT_ST_CSEG 4 /* ʸÀ´̾õÂÖ */
30 #define ANTHY_INPUT_MAP_ALPHABET 0
31 #define ANTHY_INPUT_MAP_WALPHABET 1
32 #define ANTHY_INPUT_MAP_HIRAGANA 2
33 #define ANTHY_INPUT_MAP_KATAKANA 3
34 #define ANTHY_INPUT_MAP_HANKAKU_KANA 4
36 #define ANTHY_INPUT_SF_NONE 0x00000000
37 #define ANTHY_INPUT_SF_CURSOR 0x00000001
38 #define ANTHY_INPUT_SF_ENUM 0x00000002
39 #define ANTHY_INPUT_SF_ENUM_REVERSE 0x00000004
40 #define ANTHY_INPUT_SF_EDITING 0x00000008
41 #define ANTHY_INPUT_SF_PENDING 0x00000010
42 #define ANTHY_INPUT_SF_FOLLOWING 0x00000020
43 /* This have been in public API!*/
44 #define ANTHY_INPUT_SF_EDITTING 0x00000008
46 struct anthy_input_config;
47 struct anthy_input_context;
50 * anthy_input_get_preedit();
51 * anthy_input_free_preedit();
53 struct anthy_input_preedit {
59 struct anthy_input_segment* segment;
60 struct anthy_input_segment* cur_segment;
64 * anthy_input_get_candidate();
65 * anthy_input_free_segment();
67 struct anthy_input_segment {
74 struct anthy_input_segment* next;
78 int anthy_input_init(void);
80 /* context management*/
81 void anthy_input_set_personality(const char *);
82 struct anthy_input_context*
83 anthy_input_create_context(struct anthy_input_config* cfg);
84 void anthy_input_free_context(struct anthy_input_context* ictx);
86 /* pure function command */
87 void anthy_input_str(struct anthy_input_context* ictx, const char* str);
88 void anthy_input_next_candidate(struct anthy_input_context* ictx);
89 void anthy_input_prev_candidate(struct anthy_input_context* ictx);
90 void anthy_input_quit(struct anthy_input_context* ictx);
91 void anthy_input_erase_prev(struct anthy_input_context* ictx);
92 void anthy_input_erase_next(struct anthy_input_context* ictx);
93 void anthy_input_commit(struct anthy_input_context* ictx);
94 void anthy_input_move(struct anthy_input_context* ictx, int lr);
95 void anthy_input_resize(struct anthy_input_context* ictx, int lr);
96 void anthy_input_beginning_of_line(struct anthy_input_context* ictx);
97 void anthy_input_end_of_line(struct anthy_input_context* ictx);
98 void anthy_input_cut(struct anthy_input_context* ictx);
100 /* key oriented command */
101 void anthy_input_key(struct anthy_input_context* ictx, int c);
102 void anthy_input_space(struct anthy_input_context* ictx);
105 int anthy_input_get_state(struct anthy_input_context* ictx);
106 struct anthy_input_preedit*
107 anthy_input_get_preedit(struct anthy_input_context* ictx);
108 void anthy_input_free_preedit(struct anthy_input_preedit* pedit);
109 int anthy_input_map_select(struct anthy_input_context* ictx, int map);
110 int anthy_input_get_selected_map(struct anthy_input_context* ictx);
111 struct anthy_input_segment*
112 anthy_input_get_candidate(struct anthy_input_context* ictx, int cand_no);
113 void anthy_input_free_segment(struct anthy_input_segment* cand);
114 int anthy_input_select_candidate(struct anthy_input_context* ictx, int cand);
117 struct anthy_input_config* anthy_input_create_config(void);
118 void anthy_input_free_config(struct anthy_input_config* cfg);
119 int anthy_input_edit_toggle_config(struct anthy_input_config *cfg, char tg);
120 int anthy_input_edit_rk_config(struct anthy_input_config *cfg, int map,
121 const char *from, const char *to, const char *follow);
122 int anthy_input_clear_rk_config(struct anthy_input_config *cfg,
124 int anthy_input_break_into_roman_config(struct anthy_input_config* cfg, int f);
125 int anthy_input_preedit_mode_config(struct anthy_input_config* cfg, int f);
126 void anthy_input_change_config(struct anthy_input_config* cfg);
130 anthy_input_get_anthy_context(struct anthy_input_context *ictx);
136 #endif /* INPUT_H_INCLUDE */