00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef LIBANTHY_H
00022 #define LIBANTHY_H
00023
00024
00025 #define NTH_UNCONVERTED_CANDIDATE -1
00026 #define NTH_KATAKANA_CANDIDATE -2
00027 #define NTH_HIRAGANA_CANDIDATE -3
00028 #define NTH_HALFKANA_CANDIDATE -4
00029
00030 #define ANTHY_COMPILED_ENCODING 0
00031 #define ANTHY_EUC_JP_ENCODING 1
00032 #define ANTHY_UTF8_ENCODING 2
00033
00034 #define ANTHY_RECONVERT_AUTO 0
00035 #define ANTHY_RECONVERT_DISABLE 1
00036 #define ANTHY_RECONVERT_ALWAYS 2
00037
00038 class LibAnthy
00039 {
00040 public:
00041 LibAnthy();
00042 ~LibAnthy();
00043
00044 bool isAvailable() const;
00045
00046
00047 struct anthy_conv_stat {
00048 int nr_segment;
00049 };
00050
00051 struct anthy_segment_stat {
00052 int nr_candidate;
00053 int seg_len;
00054 };
00055
00056 struct anthy_prediction_stat {
00057 int nr_prediction;
00058 };
00059
00060 typedef struct anthy_context *anthy_context_t;
00061
00062
00063 int (*anthy_init)(void);
00064 void (*anthy_quit)(void);
00065
00066
00067
00068
00069 anthy_context_t (*anthy_create_context)(void);
00070 void (*anthy_reset_context)(anthy_context_t);
00071 void (*anthy_release_context)(anthy_context_t);
00072
00073
00074 int (*anthy_set_string)(anthy_context_t, const char*);
00075
00076 void (*anthy_resize_segment)(anthy_context_t, int, int);
00077 int (*anthy_get_stat)(anthy_context_t, struct anthy_conv_stat*);
00078 int (*anthy_get_segment_stat)(anthy_context_t, int, struct anthy_segment_stat*);
00079
00080 int (*anthy_get_segment)(anthy_context_t, int, int, char*, int);
00081
00082 int (*anthy_commit_segment)(anthy_context_t, int, int);
00083
00084
00085 int (*anthy_set_prediction_string)(anthy_context_t, const char*);
00086 int (*anthy_get_prediction_stat)(anthy_context_t, struct anthy_prediction_stat*);
00087
00088 int (*anthy_get_prediction)(anthy_context_t, int, char*, int);
00089 int (*anthy_commit_prediction)(anthy_context_t, int);
00090
00091 #if 0
00092
00093 void anthy_print_context(anthy_context_t);
00094
00095 const char *anthy_get_version_string(void);
00096 typedef void (*anthy_logger)(int level, const char *);
00097 void anthy_set_logger(anthy_logger , int level);
00098
00099
00100 int anthy_context_set_encoding(anthy_context_t ac, int encoding);
00101 int anthy_set_reconversion_mode(anthy_context_t ac, int mode);
00102 #endif
00103
00104 private:
00105 class Private;
00106 Private *d;
00107 };
00108
00109 #endif//LIBANTHY_H