2 Stuphead: (C) 2000,2001 Grigroy Bakunov, Sergey Pinaev
4 /* gtkpspell - 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 2 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, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * Adapted by the Sylpheed Claws Team.
27 * Adapted for pspell (c) 2001-2002 Melvin Hadasht
31 #ifndef __gtkpspell_h__
32 #define __gtkpspell_h__
36 #include <gtk/gtkoptionmenu.h>
37 #include <pspell/pspell.h>
39 #define PSPELL_FASTMODE 1
40 #define PSPELL_NORMALMODE 2
41 #define PSPELL_BADSPELLERMODE 3
43 typedef struct _GtkPspellCheckers {
45 GSList *dictionary_list;
49 typedef struct _Dictionary {
51 gchar *dictname; /* dictname points into fullname */
55 typedef struct _GtkPspeller {
56 Dictionary * dictionary;
59 PspellConfig * config;
60 PspellManager * checker;
63 typedef void (*ContCheckFunc) (gpointer *gtkpspell);
65 #define GTKPSPELLWORDSIZE 1024
66 typedef struct _GtkPspell {
67 GtkPspeller *gtkpspeller;
68 gchar theword[GTKPSPELLWORDSIZE];
74 gboolean check_while_typing;
76 ContCheckFunc continue_check;
84 GtkWidget *config_menu;
85 GtkWidget *popup_config_menu;
87 GtkWidget *replace_entry;
89 gint default_sug_mode;
91 GList *suggestions_list;
97 typedef PspellConfig GtkPspellConfig;
99 extern GtkPspellCheckers *gtkpspellcheckers;
101 GtkPspellCheckers* gtkpspell_checkers_new ();
103 GtkPspellCheckers* gtkpspell_checkers_delete ();
105 void gtkpspell_checkers_reset_error ();
107 GtkPspell* gtkpspell_new (const gchar *dictionary,
108 const gchar *encoding,
109 gint misspelled_color,
110 gboolean check_while_typing,
113 void gtkpspell_delete (GtkPspell *gtkpspell);
115 guchar* gtkpspell_get_dict (GtkPspell *gtkpspell);
117 guchar* gtkpspell_get_path (GtkPspell *gtkpspell);
119 gboolean gtkpspell_set_sug_mode (GtkPspell *gtkpspell,
122 GSList* gtkpspell_get_dictionary_list (const char *pspell_path,
125 void gtkpspell_free_dictionary_list (GSList *list);
127 void gtkpspell_check_forwards_go (GtkPspell *gtkpspell);
128 void gtkpspell_check_backwards (GtkPspell *gtkpspell);
130 void gtkpspell_check_all (GtkPspell *gtkpspell);
131 void gtkpspell_uncheck_all (GtkPspell *gtkpspell);
132 void gtkpspell_highlight_all (GtkPspell *gtkpspell);
134 void gtkpspell_populate_submenu (GtkPspell *gtkpspell,
135 GtkWidget *menuitem);
137 GtkWidget* gtkpspell_dictionary_option_menu_new
138 (const gchar *pspell_path);
139 gchar* gtkpspell_get_dictionary_menu_active_item
142 GtkWidget* gtkpspell_sugmode_option_menu_new
145 void gtkpspell_sugmode_option_menu_set
146 (GtkOptionMenu *optmenu,
149 gint gtkpspell_get_sugmode_from_option_menu
150 (GtkOptionMenu *optmenu);
152 #endif /* __gtkpspell_h__ */