2 Stuphead: (C) 2000,2001 Grigroy Bakunov, Sergey Pinaev
4 /* gtkaspell - a spell-checking addon for GtkText
5 * Copyright (c) 2001-2002 Melvin Hadasht
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 * Adapted by the Claws Mail Team.
26 * Adapted for pspell (c) 2001-2002 Melvin Hadasht
27 * Adapted for GNU/aspell (c) 2002 Melvin Hadasht
31 #ifndef __GTKENCHANT_H__
32 #define __GTKENCHANT_H__
36 #include "claws-features.h"
44 #define GTKASPELLWORDSIZE 1024
46 typedef struct _Dictionary {
51 typedef struct _GtkAspeller {
52 Dictionary *dictionary;
53 EnchantBroker *broker;
57 typedef void (*ContCheckFunc) (gpointer *gtkaspell);
61 void (*set_position)(gpointer data, gint pos);
62 void (*set_menu_pos)(GtkMenu *menu, gint *x, gint *y,
63 gboolean *push_in, gpointer user_data);
64 gboolean (*find_misspelled)(gpointer data, gboolean forward);
65 gboolean (*check_word)(gpointer data);
66 void (*replace_word)(gpointer data, const gchar *newword);
70 typedef struct _WidgetContext WidgetContext;
74 GtkAspeller *gtkaspeller;
75 GtkAspeller *alternate_speller;
76 gchar theword[GTKASPELLWORDSIZE];
82 gboolean check_while_typing;
83 gboolean recheck_when_changing_dict;
84 gboolean use_alternate;
85 gboolean use_both_dicts;
87 ContCheckFunc continue_check;
89 GtkWidget *replace_entry;
90 GtkWidget *parent_window;
93 GList *suggestions_list;
97 GtkAccelGroup *accel_group;
98 void (*dict_changed_cb)(void *data);
99 void (*menu_changed_cb)(void *data);
100 void *menu_changed_data;
105 typedef struct _GtkAspell GtkAspell;
108 void gtkaspell_checkers_init (void);
110 void gtkaspell_checkers_quit (void);
112 const char * gtkaspell_checkers_strerror (void);
114 void gtkaspell_checkers_reset_error (void);
116 GtkAspell* gtkaspell_new (const gchar *dictionary,
117 const gchar *alt_dictionary,
118 const gchar *encoding,
119 gint misspelled_color,
120 gboolean check_while_typing,
121 gboolean recheck_when_changing_dict,
122 gboolean use_alternate,
123 gboolean use_both_dicts,
124 GtkTextView *gtktext,
125 GtkWindow *parent_win,
126 void (*dict_changed_cd)(void *data),
127 void (*spell_menu_cb)(void *data),
130 void gtkaspell_delete (GtkAspell *gtkaspell);
133 gboolean gtkaspell_change_dict (GtkAspell *gtkaspell,
134 const gchar* dictionary,
135 gboolean always_set_alt_dict);
137 gboolean gtkaspell_change_alt_dict (GtkAspell *gtkaspell,
138 const gchar* alt_dictionary);
139 void gtkaspell_use_alternate_dict (GtkAspell *gtkaspell);
141 gboolean gtkaspell_check_next_prev (GtkAspell *gtkaspell,
143 void gtkaspell_check_forwards_go (GtkAspell *gtkaspell);
144 void gtkaspell_check_backwards (GtkAspell *gtkaspell);
146 void gtkaspell_check_all (GtkAspell *gtkaspell);
147 void gtkaspell_highlight_all (GtkAspell *gtkaspell);
149 GtkWidget* gtkaspell_dictionary_combo_new (const gboolean refresh);
151 GtkTreeModel* gtkaspell_dictionary_store_new (void);
152 GtkTreeModel* gtkaspell_dictionary_store_new_with_refresh
155 gchar* gtkaspell_get_dictionary_menu_active_item
156 (GtkComboBox *combo);
157 gint gtkaspell_set_dictionary_menu_active_item
159 const gchar *dictionary);
161 GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
163 gchar* gtkaspell_get_default_dictionary (GtkAspell *gtkaspell);
165 void gtkaspell_make_context_menu (GtkMenu *menu,
166 GtkAspell *gtkaspell);
168 int gtkaspell_misspelled_test (GtkAspell *gtkaspell,
170 void gtkaspell_dict_changed (GtkAspell *gtkaspell);
171 void gtkaspell_context_set (GtkAspell *gtkaspell);
172 void gtkaspell_free_suggestions_list (GtkAspell *gtkaspell);
173 void gtkaspell_block_check (GtkAspell *gtkaspell);
174 void gtkaspell_unblock_check (GtkAspell *gtkaspell);
177 #endif /* USE_ENCHANT */
178 #endif /* __GTKENCHANT_H__ */