/* * common/enchant.h - Enchant Library Runtime Loading * * Copyright (C) 2004-2006 Christian Hammond. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ struct EnchantDict; struct EnchantBroker; typedef void (*EnchantDictDescribeFn) (const char * const lang_tag, const char * const provider_name, const char * const provider_desc, const char * const provider_file, void * user_data); extern struct EnchantBroker * (*enchant_broker_init) (void); extern void (*enchant_broker_free) (struct EnchantBroker * broker); extern void (*enchant_broker_free_dict) (struct EnchantBroker * broker, struct EnchantDict * dict); extern void (*enchant_broker_list_dicts) (struct EnchantBroker * broker, EnchantDictDescribeFn fn, void * user_data); extern struct EnchantDict * (*enchant_broker_request_dict) (struct EnchantBroker * broker, const char *const tag); extern void (*enchant_dict_add_to_personal) (struct EnchantDict * dict, const char *const word, ssize_t len); extern void (*enchant_dict_add_to_session) (struct EnchantDict * dict, const char *const word, ssize_t len); extern int (*enchant_dict_check) (struct EnchantDict * dict, const char *const word, ssize_t len); extern void (*enchant_dict_describe) (struct EnchantDict * dict, EnchantDictDescribeFn fn, void * user_data); extern void (*enchant_dict_free_suggestions) (struct EnchantDict * dict, char **suggestions); extern void (*enchant_dict_store_replacement) (struct EnchantDict * dict, const char *const mis, ssize_t mis_len, const char *const cor, ssize_t cor_len); extern char ** (*enchant_dict_suggest) (struct EnchantDict * dict, const char *const word, ssize_t len, size_t * out_n_suggs); gboolean have_enchant (void); void initialize_enchant (void); gchar *enchant_get_lang_from_dict (struct EnchantDict *dict);