allow gpgme in non-standard locations
[claws.git] / src / gtkspell.h
blob502a3bcf9a7a27a21bf0a4acf741bc4d35cbdbca
1 /*
2 Stuphead: (C) 2000,2001 Grigroy Bakunov, Sergey Pinaev
3 */
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__
34 #include "gtkstext.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 {
44 GSList * checkers;
45 GSList * dictionary_list;
46 gchar * error_message;
47 } GtkPspellCheckers;
49 typedef struct _Dictionary {
50 gchar * fullname;
51 gchar * dictname; /* dictname points into fullname */
52 gchar * encoding;
53 } Dictionary;
55 typedef struct _GtkPspeller {
56 Dictionary * dictionary;
57 gint sug_mode;
58 gint ispell;
59 PspellConfig * config;
60 PspellManager * checker;
61 } GtkPspeller;
63 #define GTKPSPELLWORDSIZE 1024
64 typedef struct _GtkPspell {
65 GtkPspeller * gtkpspeller;
66 gchar theword[GTKPSPELLWORDSIZE];
67 gchar newword[GTKPSPELLWORDSIZE];
68 gint start_pos;
69 gint end_pos;
70 guint orig_pos;
72 Dictionary * dict1;
73 Dictionary * dict2;
75 GtkWidget * gui;
76 gpointer * compose;
78 gint default_sug_mode;
79 gint max_sug;
80 GList * suggestions_list;
82 GtkSText * gtktext;
83 GdkColor highlight;
84 } GtkPspell;
86 typedef PspellConfig GtkPspellConfig;
88 extern GtkPspellCheckers *gtkpspellcheckers;
90 GtkPspellCheckers* gtkpspell_checkers_new ();
92 GtkPspellCheckers* gtkpspell_checkers_delete ();
94 void gtkpspell_checkers_reset ();
96 GtkPspell* gtkpspell_new (const gchar *dictionary,
97 const gchar *encoding,
98 GtkSText *gtktext);
100 void gtkpspell_delete (GtkPspell *gtkpspell);
102 guchar* gtkpspell_get_dict (GtkPspell *gtkpspell);
104 guchar* gtkpspell_get_path (GtkPspell *gtkpspell);
106 gboolean gtkpspell_set_sug_mode (GtkPspell *gtkpspell,
107 gint themode);
109 GSList* gtkpspell_get_dictionary_list (const char *pspell_path,
110 gint refresh);
112 void gtkpspell_free_dictionary_list (GSList *list);
114 void gtkpspell_check_forwards_go (GtkPspell *gtkpspell);
115 void gtkpspell_check_backwards (GtkPspell *gtkpspell);
117 void gtkpspell_check_all (GtkPspell *gtkpspell);
118 void gtkpspell_uncheck_all (GtkPspell *gtkpspell);
120 GtkWidget* gtkpspell_dictionary_option_menu_new
121 (const gchar *pspell_path);
122 gchar* gtkpspell_get_dictionary_menu_active_item
123 (GtkWidget *menu);
125 GtkWidget* gtkpspell_sugmode_option_menu_new
126 (gint sugmode);
128 void gtkpspell_sugmode_option_menu_set
129 (GtkOptionMenu *optmenu,
130 gint sugmode);
132 gint gtkpspell_get_sugmode_from_option_menu
133 (GtkOptionMenu *optmenu);
135 #endif /* __gtkpspell_h__ */