1 /* gdict-speller.h - display widget for dictionary matches
2  *
3  * Copyright (C) 2006  Emmanuele Bassi <ebassi@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __GDICT_SPELLER_H__
20 #define __GDICT_SPELLER_H__
21 
22 #include <gtk/gtk.h>
23 #include "gdict-context.h"
24 
25 G_BEGIN_DECLS
26 
27 #define GDICT_TYPE_SPELLER 		(gdict_speller_get_type ())
28 #define GDICT_SPELLER(obj) 		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SPELLER, GdictSpeller))
29 #define GDICT_SPELLER_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SPELLER, GdictSpellerClass))
30 #define GDICT_IS_SPELLER(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SPELLER))
31 #define GDICT_IS_SPELLER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SPELLER))
32 #define GDICT_SPELLER_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SPELLER, GdictSpellerClass))
33 
34 typedef struct _GdictSpeller		GdictSpeller;
35 typedef struct _GdictSpellerPrivate	GdictSpellerPrivate;
36 typedef struct _GdictSpellerClass	GdictSpellerClass;
37 
38 struct _GdictSpeller
39 {
40   GtkBox parent_instance;
41 
42   /*< private >*/
43   GdictSpellerPrivate *priv;
44 };
45 
46 struct _GdictSpellerClass
47 {
48   GtkBoxClass parent_class;
49 
50   void (*word_activated) (GdictSpeller *speller,
51 		          const gchar  *word,
52 			  const gchar  *database);
53 
54   /* padding for future expansion */
55   void (*_gdict_speller_1) (void);
56   void (*_gdict_speller_2) (void);
57   void (*_gdict_speller_3) (void);
58   void (*_gdict_speller_4) (void);
59 };
60 
61 GType                 gdict_speller_get_type         (void) G_GNUC_CONST;
62 
63 GtkWidget *           gdict_speller_new              (void);
64 GtkWidget *           gdict_speller_new_with_context (GdictContext *context);
65 
66 void                  gdict_speller_set_context      (GdictSpeller *speller,
67 						      GdictContext *context);
68 GdictContext *        gdict_speller_get_context      (GdictSpeller *speller);
69 void                  gdict_speller_set_database     (GdictSpeller *speller,
70 						      const gchar *database);
71 const gchar *         gdict_speller_get_database     (GdictSpeller *speller);
72 void                  gdict_speller_set_strategy     (GdictSpeller *speller,
73 						      const gchar  *strategy);
74 const gchar *         gdict_speller_get_strategy     (GdictSpeller *speller);
75 
76 void                  gdict_speller_clear            (GdictSpeller *speller);
77 void                  gdict_speller_match            (GdictSpeller *speller,
78 						      const gchar  *word);
79 
80 gint                  gdict_speller_count_matches    (GdictSpeller *speller);
81 gchar **              gdict_speller_get_matches      (GdictSpeller *speller,
82 						      gsize         length);
83 
84 G_END_DECLS
85 
86 #endif /* __GDICT_SPELLER_H__ */
87