1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2003 Dom Lachowicz
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02110-1301, USA.
20 * In addition, as a special exception, Dom Lachowicz
21 * gives permission to link the code of this program with
22 * non-LGPL Spelling Provider libraries (eg: a MSFT Office
23 * spell checker backend) and distribute linked combinations including
24 * the two. You must obey the GNU Lesser General Public License in all
25 * respects for all of the code used other than said providers. If you modify
26 * this file, you may extend this exception to your version of the
27 * file, but you are not obligated to do so. If you do not wish to
28 * do so, delete this exception statement from your version.
34 /* for size_t, ssize_t */
35 #include <sys/types.h>
43 #define ENCHANT_MODULE_EXPORT(x) __declspec(dllexport) x
45 #define ENCHANT_MODULE_EXPORT(x) __declspec(dllimport) x
48 #define ENCHANT_MODULE_EXPORT(x) x
51 typedef struct str_enchant_broker EnchantBroker;
52 typedef struct str_enchant_dict EnchantDict;
55 ENCHANT_MODULE_EXPORT (char *)
56 enchant_get_version (void);
58 ENCHANT_MODULE_EXPORT (EnchantBroker *)
59 enchant_broker_init (void);
60 ENCHANT_MODULE_EXPORT (void)
61 enchant_broker_free (EnchantBroker * broker);
63 ENCHANT_MODULE_EXPORT (EnchantDict *)
64 enchant_broker_request_dict (EnchantBroker * broker, const char *const tag);
65 ENCHANT_MODULE_EXPORT (EnchantDict *)
66 enchant_broker_request_pwl_dict (EnchantBroker * broker, const char *const pwl);
67 ENCHANT_MODULE_EXPORT (void)
68 enchant_broker_free_dict (EnchantBroker * broker, EnchantDict * dict);
69 ENCHANT_MODULE_EXPORT (int)
70 enchant_broker_dict_exists (EnchantBroker * broker,
71 const char * const tag);
72 ENCHANT_MODULE_EXPORT (void)
73 enchant_broker_set_ordering (EnchantBroker * broker,
74 const char * const tag,
75 const char * const ordering);
77 ENCHANT_MODULE_EXPORT(char *)
78 enchant_broker_get_error (EnchantBroker * broker);
81 ENCHANT_MODULE_EXPORT(char *)
82 enchant_broker_get_param (EnchantBroker * broker, const char * const param_name);
83 ENCHANT_MODULE_EXPORT(void)
84 enchant_broker_set_param (EnchantBroker * broker, const char * const param_name, const char * const param_value);
87 * EnchantBrokerDescribeFn
88 * @provider_name: The provider's identifier, such as "ispell" or "aspell" in UTF8 encoding
89 * @provider_desc: A description of the provider, such as "Aspell 0.53" in UTF8 encoding
90 * @provider_dll_file: The provider's DLL filename in Glib file encoding (UTF8 on Windows)
91 * @user_data: Supplied user data, or %null if you don't care
93 * Callback used to enumerate and describe Enchant's various providers
95 typedef void (*EnchantBrokerDescribeFn) (const char * const provider_name,
96 const char * const provider_desc,
97 const char * const provider_dll_file,
100 ENCHANT_MODULE_EXPORT (void)
101 enchant_broker_describe (EnchantBroker * broker,
102 EnchantBrokerDescribeFn fn,
105 ENCHANT_MODULE_EXPORT (int)
106 enchant_dict_check (EnchantDict * dict, const char *const word, ssize_t len);
107 ENCHANT_MODULE_EXPORT (char **)
108 enchant_dict_suggest (EnchantDict * dict, const char *const word,
109 ssize_t len, size_t * out_n_suggs);
110 ENCHANT_MODULE_EXPORT (void)
111 enchant_dict_add (EnchantDict * dict, const char *const word,
113 ENCHANT_MODULE_EXPORT (void)
114 enchant_dict_add_to_session (EnchantDict * dict, const char *const word,
116 ENCHANT_MODULE_EXPORT (void)
117 enchant_dict_remove (EnchantDict * dict, const char *const word,
119 ENCHANT_MODULE_EXPORT (void)
120 enchant_dict_remove_from_session (EnchantDict * dict, const char *const word,
122 ENCHANT_MODULE_EXPORT (int)
123 enchant_dict_is_added (EnchantDict * dict, const char *const word,
125 ENCHANT_MODULE_EXPORT (int)
126 enchant_dict_is_removed (EnchantDict * dict, const char *const word,
128 ENCHANT_MODULE_EXPORT (void)
129 enchant_dict_store_replacement (EnchantDict * dict,
130 const char *const mis, ssize_t mis_len,
131 const char *const cor, ssize_t cor_len);
132 ENCHANT_MODULE_EXPORT (void)
133 enchant_dict_free_string_list (EnchantDict * dict, char **string_list);
135 #ifndef ENCHANT_DISABLE_DEPRECATED
136 ENCHANT_MODULE_EXPORT (void)
137 enchant_dict_free_suggestions (EnchantDict * dict, char **suggestions);
138 ENCHANT_MODULE_EXPORT (void)
139 enchant_dict_add_to_personal (EnchantDict * dict, const char *const word,
141 ENCHANT_MODULE_EXPORT (void)
142 enchant_dict_add_to_pwl (EnchantDict * dict, const char *const word,
144 ENCHANT_MODULE_EXPORT (int)
145 enchant_dict_is_in_session (EnchantDict * dict, const char *const word,
147 #endif /* ENCHANT_DISABLE_DEPRECATED */
150 ENCHANT_MODULE_EXPORT(char *)
151 enchant_dict_get_error (EnchantDict * dict);
154 * EnchantDictDescribeFn
155 * @lang_tag: The dictionary's language tag (eg: en_US, de_AT, ...)
156 * @provider_name: The provider's name (eg: Aspell) in UTF8 encoding
157 * @provider_desc: The provider's description (eg: Aspell 0.50.3) in UTF8 encoding
158 * @provider_file: The DLL/SO where this dict's provider was loaded from in Glib file encoding (UTF8 on Windows)
159 * @user_data: Supplied user data, or %null if you don't care
161 * Callback used to describe an individual dictionary
163 typedef void (*EnchantDictDescribeFn) (const char * const lang_tag,
164 const char * const provider_name,
165 const char * const provider_desc,
166 const char * const provider_file,
169 ENCHANT_MODULE_EXPORT (void)
170 enchant_dict_describe (EnchantDict * dict,
171 EnchantDictDescribeFn fn,
174 ENCHANT_MODULE_EXPORT (void)
175 enchant_broker_list_dicts (EnchantBroker * broker,
176 EnchantDictDescribeFn fn,
183 #endif /* ENCHANT_H */