Define new 'pivot-prop-loadable' property
[nautilus-actions.git] / src / core / na-module.h
blob50648ebaa8e46c33abf545fb0c923f55bd90b0a9
1 /*
2 * Nautilus-Actions
3 * A Nautilus extension which offers configurable context menu modules.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifndef __CORE_NA_MODULE_H__
32 #define __CORE_NA_MODULE_H__
34 /* @title: NAModule
35 * @short_description: The #NAModule Class Definition
36 * @include: core/na-module.h
38 * The NAModule class manages Nautilus-Actions extensions as dynamically
39 * loadable modules (plugins).
41 * NAModule
42 * +- is derived from GTypeModule
43 * +- which itself implements GTypePlugin
45 * Each NAModule physically corresponds to a dynamically loadable library
46 * (i.e. a plugin). A NAModule implements one or more interfaces, and/or
47 * provides one or more services.
49 * Interfaces (resp. services) are implemented (resp. provided) by GObjects
50 * which are dynamically instantiated at plugin initial-load time.
52 * So the dynamic is as follows:
53 * - NAPivot scans for the PKGLIBDIR directory, trying to dynamically
54 * load all found libraries
55 * - to be considered as a N-A plugin, a library must implement some
56 * functions (see api/na-api.h)
57 * - for each found plugin, NAPivot calls na_api_list_types() which
58 * returns the type of GObjects implemented in the plugin
59 * - NAPivot dynamically instantiates a GObject for each returned GType.
61 * After that, when NAPivot wants to access, say to NAIIOProvider
62 * interfaces, it asks each module for its list of objects which implement
63 * this given interface.
64 * Interface API is then called against the returned GObject.
67 #include <glib-object.h>
69 G_BEGIN_DECLS
71 #define NA_MODULE_TYPE ( na_module_get_type())
72 #define NA_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_MODULE_TYPE, NAModule ))
73 #define NA_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_MODULE_TYPE, NAModuleClass ))
74 #define NA_IS_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_MODULE_TYPE ))
75 #define NA_IS_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_MODULE_TYPE ))
76 #define NA_MODULE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_MODULE_TYPE, NAModuleClass ))
78 typedef struct _NAModulePrivate NAModulePrivate;
80 typedef struct {
81 /*< private >*/
82 GTypeModule parent;
83 NAModulePrivate *private;
85 NAModule;
87 typedef struct _NAModuleClassPrivate NAModuleClassPrivate;
89 typedef struct {
90 /*< private >*/
91 GTypeModuleClass parent;
92 NAModuleClassPrivate *private;
94 NAModuleClass;
96 GType na_module_get_type ( void );
98 void na_module_dump ( const NAModule *module );
99 GList *na_module_load_modules ( void );
101 GList *na_module_get_extensions_for_type( GList *modules, GType type );
102 void na_module_free_extensions_list ( GList *extensions );
104 gboolean na_module_has_id ( NAModule *module, const gchar *id );
106 void na_module_release_modules ( GList *modules );
108 G_END_DECLS
110 #endif /* __CORE_NA_MODULE_H__ */