1 /* 2 * e-spell-dictionary.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_DICTIONARY_H 24 #define E_SPELL_DICTIONARY_H 25 26 #include <glib-object.h> 27 28 /* Standard GObject macros */ 29 #define E_TYPE_SPELL_DICTIONARY \ 30 (e_spell_dictionary_get_type ()) 31 #define E_SPELL_DICTIONARY(obj) \ 32 (G_TYPE_CHECK_INSTANCE_CAST \ 33 ((obj), E_TYPE_SPELL_DICTIONARY, ESpellDictionary)) 34 #define E_SPELL_DICTIONARY_CLASS(cls) \ 35 (G_TYPE_CHECK_CLASS_CAST \ 36 ((cls), E_TYPE_SPELL_DICTIONARY, ESpellDictionaryClass)) 37 #define E_IS_SPELL_DICTIONARY(obj) \ 38 (G_TYPE_CHECK_INSTANCE_TYPE \ 39 ((obj), E_TYPE_SPELL_DICTIONARY)) 40 #define E_IS_SPELL_DICTIONARY_CLASS(cls) \ 41 (G_TYPE_CHECK_CLASS_TYPE \ 42 ((cls), E_TYPE_SPELL_DICTIONARY)) 43 #define E_SPELL_DICTIONARY_GET_CLASS(obj) \ 44 (G_TYPE_INSTANCE_GET_CLASS \ 45 ((obj), E_TYPE_SPELL_DICTIONARY, ESpellDictionaryClass)) 46 47 G_BEGIN_DECLS 48 49 typedef struct _ESpellDictionary ESpellDictionary; 50 typedef struct _ESpellDictionaryPrivate ESpellDictionaryPrivate; 51 typedef struct _ESpellDictionaryClass ESpellDictionaryClass; 52 53 /* Forward declaration */ 54 struct _ESpellChecker; 55 56 struct _ESpellDictionary { 57 GObject parent; 58 ESpellDictionaryPrivate *priv; 59 }; 60 61 struct _ESpellDictionaryClass { 62 GObjectClass parent_class; 63 }; 64 65 GType e_spell_dictionary_get_type (void) G_GNUC_CONST; 66 ESpellDictionary * 67 e_spell_dictionary_new (struct _ESpellChecker *spell_checker, 68 gpointer enchant_dict); /* EnchantDict * */ 69 ESpellDictionary * 70 e_spell_dictionary_new_bare (struct _ESpellChecker *spell_checker, 71 const gchar *language_tag); 72 guint e_spell_dictionary_hash (ESpellDictionary *dictionary); 73 gboolean e_spell_dictionary_equal (ESpellDictionary *dictionary1, 74 ESpellDictionary *dictionary2); 75 gint e_spell_dictionary_compare (ESpellDictionary *dictionary1, 76 ESpellDictionary *dictionary2); 77 const gchar * e_spell_dictionary_get_name (ESpellDictionary *dictionary); 78 const gchar * e_spell_dictionary_get_code (ESpellDictionary *dictionary); 79 struct _ESpellChecker * 80 e_spell_dictionary_ref_spell_checker 81 (ESpellDictionary *dictionary); 82 gboolean e_spell_dictionary_check_word (ESpellDictionary *dictionary, 83 const gchar *word, 84 gsize length); 85 void e_spell_dictionary_learn_word (ESpellDictionary *dictionary, 86 const gchar *word, 87 gsize length); 88 void e_spell_dictionary_ignore_word (ESpellDictionary *dictionary, 89 const gchar *word, 90 gsize length); 91 GList * e_spell_dictionary_get_suggestions 92 (ESpellDictionary *dictionary, 93 const gchar *word, 94 gsize length); 95 void e_spell_dictionary_store_correction 96 (ESpellDictionary *dictionary, 97 const gchar *misspelled, 98 gsize misspelled_length, 99 const gchar *correction, 100 gsize correction_length); 101 102 G_END_DECLS 103 104 #endif /* E_SPELL_DICTIONARY_H */ 105