summaryrefslogtreecommitdiffstats
path: root/input-methods/sulekha/src/sulekhaspell.h
blob: 791e18fec7d6beacd5ac077ddf4e258cfa474d3c (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* sulekhaspell - a spell-checking addon for GTK's TextView widget based on sulekhaspell by Evan Martin.
 *
 * Copyright (C) 2007-2008
 *  Santhosh Thottingal<santhosh00@gmail.com>,
 *  Praveen Arimprathodiyil <pravi.a@gmail.com>
 *  Swathanthra Malayalam Computing.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
  * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/


#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 */