summaryrefslogtreecommitdiffstats
path: root/input-methods/sulekha/src/sulekhaspell.h~
blob: e7b1b493b17a6509c9df3e21d50c29f9b03c49da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* sulekhaspell - a spell-checking addon for GTK's TextView widget based on sulekhaspell by Evan Martin.
 */


#ifndef SULEKHASPELL_H
#define SULEKHASPELL_H

#define SULEKHASPELL_ERROR sulekhaspell_error_quark()

typedef enum {
	SULEKHASPELL_ERROR_BACKEND,
} SulekhaSpellError;

GQuark sulekhaspell_error_quark();

typedef struct _SulekhaSpell SulekhaSpell;

/* the idea is to have a SulekhaSpell object that is analagous to the
 * GtkTextBuffer-- it lives as an attribute of the GtkTextView but
 * it can be referred to directly. */

SulekhaSpell* sulekhaspell_new_attach(GtkTextView *view,
                                     const gchar *lang, GError **error);
SulekhaSpell* sulekhaspell_get_from_text_view(GtkTextView *view);
void      sulekhaspell_detach(SulekhaSpell *spell);

gboolean  sulekhaspell_set_language(SulekhaSpell *spell,
                                       const gchar *lang, GError **error);

void      sulekhaspell_recheck_all(SulekhaSpell *spell);


/*** old API-- deprecated. ***/
#ifndef SULEKHASPELL_DISABLE_DEPRECATED
#define SULEKHASPELL_ERROR_PSPELL SULEKHASPELL_ERROR_BACKEND

int sulekhaspell_init();
/* no-op. */

void sulekhaspell_attach(GtkTextView *view);
/* sulekhaspell_new_attach(view, NULL, NULL); */

#endif /* SULEKHASPELL_DISABLE_DEPRECATED */

#endif /* SULEKHASPELL_H */