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__
35 #include "claws-features.h"
43 #define GTKASPELLWORDSIZE 1024
45 typedef struct _Dictionary
{
50 typedef struct _GtkAspeller
{
51 Dictionary
*dictionary
;
52 EnchantBroker
*broker
;
56 typedef void (*ContCheckFunc
) (gpointer
*gtkaspell
);
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
);
69 typedef struct _WidgetContext WidgetContext
;
73 GtkAspeller
*gtkaspeller
;
74 GtkAspeller
*alternate_speller
;
75 gchar theword
[GTKASPELLWORDSIZE
];
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
;
92 GList
*suggestions_list
;
96 GtkAccelGroup
*accel_group
;
97 void (*dict_changed_cb
)(void *data
);
98 void (*menu_changed_cb
)(void *data
);
99 void *menu_changed_data
;
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
),
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
,
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
154 gchar
* gtkaspell_get_dictionary_menu_active_item
155 (GtkComboBox
*combo
);
156 gint gtkaspell_set_dictionary_menu_active_item
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
,
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__ */