Improve some sieve-related translations
[claws.git] / src / gtk / gtkaspell.h
blobfef5d4f5a57929157ccc17ba1411e3d7b960b83c
1 /*
2 Stuphead: (C) 2000,2001 Grigroy Bakunov, Sergey Pinaev
3 */
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__
34 #ifdef HAVE_CONFIG_H
35 #include "claws-features.h"
36 #endif
38 #ifdef USE_ENCHANT
40 #include <gtk/gtk.h>
41 #include <enchant.h>
43 #define GTKASPELLWORDSIZE 1024
45 typedef struct _Dictionary {
46 gchar *fullname;
47 gchar *dictname;
48 } Dictionary;
50 typedef struct _GtkAspeller {
51 Dictionary *dictionary;
52 EnchantBroker *broker;
53 EnchantDict *speller;
54 } GtkAspeller;
56 typedef void (*ContCheckFunc) (gpointer *gtkaspell);
58 struct _WidgetContext
60 void (*set_position)(gpointer data, gint pos);
61 void (*set_menu_pos)(GtkMenu *menu, gint *x, gint *y,
62 gboolean *push_in, gpointer user_data);
63 gboolean (*find_misspelled)(gpointer data, gboolean forward);
64 gboolean (*check_word)(gpointer data);
65 void (*replace_word)(gpointer data, const gchar *newword);
66 gpointer *data;
69 typedef struct _WidgetContext WidgetContext;
71 struct _GtkAspell
73 GtkAspeller *gtkaspeller;
74 GtkAspeller *alternate_speller;
75 gchar theword[GTKASPELLWORDSIZE];
76 gint start_pos;
77 gint end_pos;
78 gint orig_pos;
79 gint end_check_pos;
80 gboolean misspelled;
81 gboolean check_while_typing;
82 gboolean recheck_when_changing_dict;
83 gboolean use_alternate;
84 gboolean use_both_dicts;
86 ContCheckFunc continue_check;
88 GtkWidget *replace_entry;
89 GtkWidget *parent_window;
91 gint max_sug;
92 GList *suggestions_list;
94 GtkTextView *gtktext;
95 GdkRGBA highlight;
96 GtkAccelGroup *accel_group;
97 void (*dict_changed_cb)(void *data);
98 void (*menu_changed_cb)(void *data);
99 void *menu_changed_data;
101 WidgetContext ctx;
104 typedef struct _GtkAspell GtkAspell;
107 void gtkaspell_checkers_init (void);
109 void gtkaspell_checkers_quit (void);
111 const char * gtkaspell_checkers_strerror (void);
113 void gtkaspell_checkers_reset_error (void);
115 GtkAspell* gtkaspell_new (const gchar *dictionary,
116 const gchar *alt_dictionary,
117 const gchar *encoding,
118 GdkRGBA misspelled_color,
119 gboolean check_while_typing,
120 gboolean recheck_when_changing_dict,
121 gboolean use_alternate,
122 gboolean use_both_dicts,
123 GtkTextView *gtktext,
124 GtkWindow *parent_win,
125 void (*dict_changed_cd)(void *data),
126 void (*spell_menu_cb)(void *data),
127 void *data);
129 void gtkaspell_delete (GtkAspell *gtkaspell);
132 gboolean gtkaspell_change_dict (GtkAspell *gtkaspell,
133 const gchar* dictionary,
134 gboolean always_set_alt_dict);
136 gboolean gtkaspell_change_alt_dict (GtkAspell *gtkaspell,
137 const gchar* alt_dictionary);
138 void gtkaspell_use_alternate_dict (GtkAspell *gtkaspell);
140 gboolean gtkaspell_check_next_prev (GtkAspell *gtkaspell,
141 gboolean forward);
142 void gtkaspell_check_forwards_go (GtkAspell *gtkaspell);
143 void gtkaspell_check_backwards (GtkAspell *gtkaspell);
145 void gtkaspell_check_all (GtkAspell *gtkaspell);
146 void gtkaspell_highlight_all (GtkAspell *gtkaspell);
148 GtkWidget* gtkaspell_dictionary_combo_new (const gboolean refresh);
150 GtkTreeModel* gtkaspell_dictionary_store_new (void);
151 GtkTreeModel* gtkaspell_dictionary_store_new_with_refresh
152 (gboolean refresh);
154 gchar* gtkaspell_get_dictionary_menu_active_item
155 (GtkComboBox *combo);
156 gint gtkaspell_set_dictionary_menu_active_item
157 (GtkComboBox *combo,
158 const gchar *dictionary);
160 GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
162 gchar* gtkaspell_get_default_dictionary (GtkAspell *gtkaspell);
164 void gtkaspell_make_context_menu (GtkMenu *menu,
165 GtkAspell *gtkaspell);
167 int gtkaspell_misspelled_test (GtkAspell *gtkaspell,
168 char *word);
169 void gtkaspell_dict_changed (GtkAspell *gtkaspell);
170 void gtkaspell_context_set (GtkAspell *gtkaspell);
171 void gtkaspell_free_suggestions_list (GtkAspell *gtkaspell);
172 void gtkaspell_block_check (GtkAspell *gtkaspell);
173 void gtkaspell_unblock_check (GtkAspell *gtkaspell);
176 #endif /* USE_ENCHANT */
177 #endif /* __GTKENCHANT_H__ */