source: trunk/third/gok/gok/gok-word-complete.h @ 21432

Revision 21432, 4.9 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21431, which included commits to RCS files with non-trunk default branches.
Line 
1/* gok-word-complete.h
2*
3* Copyright 2001,2002 Sun Microsystems, Inc.,
4* Copyright 2001,2002 University Of Toronto
5*
6* This library is free software; you can redistribute it and/or
7* modify it under the terms of the GNU Library General Public
8* License as published by the Free Software Foundation; either
9* version 2 of the License, or (at your option) any later version.
10*
11* This library is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14* Library General Public License for more details.
15*
16* You should have received a copy of the GNU Library General Public
17* License along with this library; if not, write to the
18* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19* Boston, MA 02111-1307, USA.
20*/
21
22#ifndef __GOKWORDCOMPLETE_H__
23#define __GOKWORDCOMPLETE_H__
24
25#include <glib-object.h>
26#include "gok-output.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif /* __cplusplus */
31
32typedef enum {
33        GOK_WORDCOMPLETE_CHAR_TYPE_NORMAL,
34        GOK_WORDCOMPLETE_CHAR_TYPE_BACKSPACE,
35        GOK_WORDCOMPLETE_CHAR_TYPE_COMPOSE, /* prefix composition */
36        GOK_WORDCOMPLETE_CHAR_TYPE_COMBINE, /* postfix composition */
37        GOK_WORDCOMPLETE_CHAR_TYPE_DELIMITER
38} GokWordCompletionCharacterCategory;
39
40#define GOK_TYPE_WORDCOMPLETE           (gok_wordcomplete_get_type ())
41#define GOK_WORDCOMPLETE(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOK_TYPE_WORDCOMPLETE, GokWordComplete))
42#define GOK_WORDCOMPLETE_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, GOK_TYPE_WORDCOMPLETE, GokWordCompleteClass)
43#define GOK_IS_WORDCOMPLETE(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, GOK_TYPE_WORDCOMPLETE)
44#define GOK_IS_WORDCOMPLETE_CLASS(klass)       G_TYPE_CHECK_CLASS_TYPE (klass, GOK_TYPE_WORDCOMPLETE)
45#define GOK_WORDCOMPLETE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GOK_TYPE_WORDCOMPLETE, GokWordCompleteClass))
46
47typedef struct _GokWordComplete       GokWordComplete;
48typedef struct _GokWordCompleteClass  GokWordCompleteClass;
49typedef struct _GokWordCompletePrivate GokWordCompletePrivate;
50
51struct _GokWordComplete
52{
53        GObject parent;
54        GokWordCompletePrivate *priv;
55};
56
57struct _GokWordCompleteClass
58{
59        GObjectClass parent_class;
60
61        /* public */
62        gboolean  (* open)         (GokWordComplete *complete,
63                                    const gchar *directory);
64        void      (* close)        (GokWordComplete *complete);
65        gchar*    (* process_unichar) (GokWordComplete *complete, gunichar letter);
66        void      (* reset)        (GokWordComplete *complete);
67        gchar**   (* predict)      (GokWordComplete *complete, gint num_predictions);
68        gchar**   (* predict_string) (GokWordComplete *complete, const gchar *utf8_string,
69                                      gint num_predictions);
70        gboolean  (* add_new_word) (GokWordComplete *complete,
71                                    const gchar *utf8_word);
72        gboolean  (* increment_word_frequency) (GokWordComplete *complete,
73                                                const gchar *word);
74        gboolean  (* validate_word) (GokWordComplete *complete,
75                                     const gchar *utf8_word);
76
77        /* private use */
78        gchar*    (* unichar_pop) (GokWordComplete *complete);
79        gchar*    (* unichar_push) (GokWordComplete *complete, gunichar letter);
80        GokWordCompletionCharacterCategory (* unichar_get_category) (GokWordComplete *complete, gunichar letter);
81        gchar*    (* get_word_part) (GokWordComplete *complete);
82        const gchar*    (* get_aux_dictionary) (GokWordComplete *complete);
83        gboolean  (* set_aux_dictionary) (GokWordComplete *complete, gchar *dict_path);
84        const gchar*    (* get_delimiter) (GokWordComplete *complete);
85};
86
87GType    gok_wordcomplete_get_type       (void);
88gboolean gok_wordcomplete_open           (GokWordComplete *complete, gchar *directory);
89void     gok_wordcomplete_close          (GokWordComplete *complete);
90void     gok_wordcomplete_reset          (GokWordComplete *complete);
91gchar**  gok_wordcomplete_predict        (GokWordComplete *complete, gint num_predictions);
92gchar*   gok_wordcomplete_process_unichar(GokWordComplete *complete, const gunichar letter);
93gchar**  gok_wordcomplete_predict_string (GokWordComplete *complete, const gchar *string,
94                                          gint num_predictions);
95
96gboolean gok_wordcomplete_add_new_word   (GokWordComplete *complete, const char* word);
97gboolean gok_wordcomplete_validate_word  (GokWordComplete *complete, const char* word);
98
99GokWordComplete *gok_wordcomplete_get_default (void);
100gchar**  gok_wordcomplete_process_and_predict (GokWordComplete *complete, const gunichar letter,
101                                               gint num_predictions);
102
103gchar*   gok_wordcomplete_get_word_part (GokWordComplete *complete);
104const gchar*   gok_wordcomplete_get_aux_dictionaries (GokWordComplete *complete);
105const gchar*   gok_wordcomplete_get_delimiter  (GokWordComplete *complete);
106gboolean gok_wordcomplete_set_aux_dictionaries (GokWordComplete *complete, gchar *dictionary_path);
107gboolean gok_wordcomplete_increment_word_frequency (GokWordComplete *complete, const gchar* pWord);
108
109#ifdef __cplusplus
110}
111#endif /* __cplusplus */
112
113#endif /* #ifndef __GOKWORDCOMPLETE_H__ */
Note: See TracBrowser for help on using the repository browser.