Tizen 2.1 base
[platform/core/uifw/anthy.git] / src-main / main.h
1 #ifndef _main_h_included_
2 #define _main_h_included_
3
4 #include <anthy/xstr.h>
5 #include <anthy/dic.h>
6 #include <anthy/splitter.h>
7 #include <anthy/segment.h>
8 #include <anthy/ordering.h>
9 #include <anthy/prediction.h>
10
11 /* 
12    Í½Â¬ÊÑ´¹¤Î¸õÊä¤Î¥­¥ã¥Ã¥·¥å
13  */
14 struct prediction_cache {
15   /* Í½Â¬¸µ¤Îʸ»úÎó */
16   xstr str;
17   /* Í½Â¬¤µ¤ì¤¿¸õÊä¤Î¿ô */
18   int nr_prediction;
19   /* Í½Â¬¤µ¤ì¤¿¸õÊä */
20   struct prediction_t* predictions;
21 };
22
23 /** Anthy¤ÎÊÑ´¹¥³¥ó¥Æ¥­¥¹¥È
24  * ÊÑ´¹Ãæ¤Îʸ»úÎó¤Ê¤É¤¬Æþ¤Ã¤Æ¤¤¤ë
25  */
26 struct anthy_context {
27   /** ¥³¥ó¥Æ¥­¥¹¥È¤Î»ý¤Äʸ»úÎó */
28   xstr str;
29   /** Ê¸Àá¤Î¥ê¥¹¥È */
30   struct segment_list seg_list;
31   /** ¼­½ñ¥»¥Ã¥·¥ç¥ó */
32   dic_session_t dic_session;
33   /** splitter¤Î¾ðÊó */
34   struct splitter_context split_info;
35   /** ¸õÊä¤ÎʤÓÂؤ¨¾ðÊó */
36   struct ordering_context_wrapper ordering_info;
37   /** Í½Â¬¸õÊä */
38   struct prediction_cache prediction;
39   /** ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° */
40   int encoding;
41   /** ºÆÊÑ´¹¤Î¥â¡¼¥É */
42   int reconversion_mode;
43 };
44
45
46 /* context.c */
47 void anthy_init_contexts(void);
48 void anthy_quit_contexts(void);
49 void anthy_init_personality(void);
50 void anthy_quit_personality(void);
51 int anthy_do_set_personality(const char *id);
52 struct anthy_context *anthy_do_create_context(int);
53 int anthy_do_context_set_str(struct anthy_context *c, xstr *x, int is_reverse);
54 void anthy_do_reset_context(struct anthy_context *c);
55 void anthy_do_release_context(struct anthy_context *c);
56
57 void anthy_do_resize_segment(struct anthy_context *c,int nth,int resize);
58
59 int anthy_do_set_prediction_str(struct anthy_context *c, xstr *x);
60 void anthy_release_segment_list(struct anthy_context *ac);
61 void anthy_save_history(const char *fn, struct anthy_context *ac);
62
63 /* for debug */
64 void anthy_do_print_context(struct anthy_context *c, int encoding);
65
66
67 #endif
68 /* ¤Ê¤ë¤Ù¤¯³¬Áؤò¥Õ¥é¥Ã¥È¤Ë¤¹¤ë¤è¤í¤· */