1 /*
2  * e-spell-checker.h
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 2 of the GNU Lesser General Public
6  * License as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this program; if not, write to the
15  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16  * Boston, MA 02111-1307, USA.
17  */
18 
19 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
20 #error "Only <e-util/e-util.h> should be included directly."
21 #endif
22 
23 #ifndef E_SPELL_CHECKER_H
24 #define E_SPELL_CHECKER_H
25 
26 #include <glib-object.h>
27 #include <e-util/e-spell-dictionary.h>
28 
29 /* Standard GObject macros */
30 #define E_TYPE_SPELL_CHECKER \
31 	(e_spell_checker_get_type ())
32 #define E_SPELL_CHECKER(obj) \
33 	(G_TYPE_CHECK_INSTANCE_CAST \
34 	((obj), E_TYPE_SPELL_CHECKER, ESpellChecker))
35 #define E_SPELL_CHECKER_CLASS(cls) \
36 	(G_TYPE_CHECK_CLASS_CAST \
37 	((cls), E_TYPE_SPELL_CHECKER, ESpellCheckerClass))
38 #define E_IS_SPELL_CHECKER(obj) \
39 	(G_TYPE_CHECK_INSTANCE_TYPE \
40 	((obj), E_TYPE_SPELL_CHECKER))
41 #define E_IS_SPELL_CHECKER_CLASS(cls) \
42 	(G_TYPE_CHECK_CLASS_TYPE \
43 	((cls), E_TYPE_SPELL_CHECKER))
44 #define E_SPELL_CHECKER_GET_CLASS(obj) \
45 	(G_TYPE_INSTANCE_GET_CLASS \
46 	((obj), E_TYPE_SPELL_CHECKER, ESpellCheckerClass))
47 
48 G_BEGIN_DECLS
49 
50 typedef struct _ESpellChecker ESpellChecker;
51 typedef struct _ESpellCheckerPrivate ESpellCheckerPrivate;
52 typedef struct _ESpellCheckerClass ESpellCheckerClass;
53 
54 struct _ESpellChecker {
55 	GObject parent;
56 	ESpellCheckerPrivate *priv;
57 };
58 
59 struct _ESpellCheckerClass {
60 	GObjectClass parent_class;
61 };
62 
63 GType		e_spell_checker_get_type	(void) G_GNUC_CONST;
64 void		e_spell_checker_free_global_memory
65 						(void);
66 ESpellChecker *	e_spell_checker_new		(void);
67 GList *		e_spell_checker_list_available_dicts
68 						(ESpellChecker *checker);
69 guint		e_spell_checker_count_available_dicts
70 						(ESpellChecker *checker);
71 ESpellDictionary *
72 		e_spell_checker_ref_dictionary	(ESpellChecker *checker,
73 						 const gchar *language_code);
74 gpointer /* EnchantDict * */
75 		e_spell_checker_get_enchant_dict
76 						(ESpellChecker *checker,
77 						 const gchar *language_code);
78 gboolean	e_spell_checker_get_language_active
79 						(ESpellChecker *checker,
80 						 const gchar *language_code);
81 void		e_spell_checker_set_language_active
82 						(ESpellChecker *checker,
83 						 const gchar *language_code,
84 						 gboolean active);
85 void		e_spell_checker_set_active_languages
86 						(ESpellChecker *checker,
87 						 const gchar * const *languages);
88 gchar **	e_spell_checker_list_active_languages
89 						(ESpellChecker *checker,
90 						 guint *n_languages);
91 guint		e_spell_checker_count_active_languages
92 						(ESpellChecker *checker);
93 gboolean	e_spell_checker_check_word	(ESpellChecker *checker,
94 						 const gchar *word,
95 						 gsize length);
96 void		e_spell_checker_learn_word	(ESpellChecker *checker,
97 						 const gchar *word);
98 void		e_spell_checker_ignore_word	(ESpellChecker *checker,
99 						 const gchar *word);
100 gchar **	e_spell_checker_get_guesses_for_word
101 						(ESpellChecker *checker,
102 						 const gchar *word);
103 
104 G_END_DECLS
105 
106 #endif /* E_SPELL_CHECKER_H */
107