1 /* gdict-source-loader.h - Source loader for Gdict
2  *
3  * Copyright (C) 2005  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_SOURCE_LOADER_H__
20 #define __GDICT_SOURCE_LOADER_H__
21 
22 #include <glib-object.h>
23 #include "gdict-source.h"
24 
25 G_BEGIN_DECLS
26 
27 #define GDICT_TYPE_SOURCE_LOADER	    (gdict_source_loader_get_type ())
28 #define GDICT_SOURCE_LOADER(obj)	    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoader))
29 #define GDICT_IS_SOURCE_LOADER(obj)	    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SOURCE_LOADER))
30 #define GDICT_SOURCE_LOADER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderClass))
31 #define GDICT_IS_SOURCE_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SOURCE_LOADER))
32 #define GDICT_SOURCE_LOADER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderClass))
33 
34 typedef struct _GdictSourceLoader	 GdictSourceLoader;
35 typedef struct _GdictSourceLoaderClass	 GdictSourceLoaderClass;
36 typedef struct _GdictSourceLoaderPrivate GdictSourceLoaderPrivate;
37 
38 
39 struct _GdictSourceLoader
40 {
41   /*< private >*/
42   GObject parent_instance;
43 
44   GdictSourceLoaderPrivate *priv;
45 };
46 
47 struct _GdictSourceLoaderClass
48 {
49   GObjectClass parent_class;
50 
51   void (*source_loaded) (GdictSourceLoader *loader,
52   			 GdictSource       *source);
53 
54   /* padding for future expansion */
55   void (*_gdict_source_1) (void);
56   void (*_gdict_source_2) (void);
57   void (*_gdict_source_3) (void);
58   void (*_gdict_source_4) (void);
59 };
60 
61 GType gdict_source_loader_get_type (void) G_GNUC_CONST;
62 
63 GdictSourceLoader *    gdict_source_loader_new             (void);
64 void                   gdict_source_loader_update          (GdictSourceLoader *loader);
65 void                   gdict_source_loader_add_search_path (GdictSourceLoader *loader,
66 							    const gchar       *path);
67 const GSList *         gdict_source_loader_get_paths       (GdictSourceLoader *loader);
68 gchar **               gdict_source_loader_get_names       (GdictSourceLoader *loader,
69 							    gsize             *length) G_GNUC_MALLOC;
70 const GSList *         gdict_source_loader_get_sources     (GdictSourceLoader *loader);
71 GdictSource *          gdict_source_loader_get_source      (GdictSourceLoader *loader,
72 							    const gchar       *name);
73 gboolean               gdict_source_loader_has_source      (GdictSourceLoader *loader,
74                                                             const gchar       *source_name);
75 gboolean               gdict_source_loader_remove_source   (GdictSourceLoader *loader,
76 							    const gchar       *name);
77 
78 G_END_DECLS
79 
80 #endif /* __GDICT_SOURCE_LOADER_H__ */
81