plugin.h 2.43 KB
Newer Older
1 2
#ifndef GNUMERIC_PLUGIN_H
#define GNUMERIC_PLUGIN_H
3

Chyla Zbigniew's avatar
Chyla Zbigniew committed
4
#include "gnumeric.h"
Jody Goldberg's avatar
Jody Goldberg committed
5
#include <glib-object.h>
Jody Goldberg's avatar
Jody Goldberg committed
6

7
/*
8
 * Use "#define PLUGIN_DEBUG x" to enable some plugin related debugging
9
 * messages.
10
#undef PLUGIN_DEBUG
11 12
 * Define PLUGIN_ALWAYS_LOAD to disable loading on demand feature
 */
13

14 15
#define GNM_PLUGIN_TYPE        (gnm_plugin_get_type ())
#define GNM_PLUGIN(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PLUGIN_TYPE, GnmPlugin))
Jody Goldberg's avatar
Jody Goldberg committed
16
#define IS_GNM_PLUGIN(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PLUGIN_TYPE))
17 18 19 20 21 22 23

GType gnm_plugin_get_type (void);

void         gnm_plugin_activate (GnmPlugin *pinfo, ErrorInfo **ret_error);
void         gnm_plugin_deactivate (GnmPlugin *pinfo, ErrorInfo **ret_error);
gboolean     gnm_plugin_is_active (GnmPlugin *pinfo);
gboolean     gnm_plugin_can_deactivate (GnmPlugin *pinfo);
Jody Goldberg's avatar
Jody Goldberg committed
24 25
void         gnm_plugin_load_service (GnmPlugin *pinfo, GnmPluginService *service, ErrorInfo **ret_error);
void         gnm_plugin_unload_service (GnmPlugin *pinfo, GnmPluginService *service, ErrorInfo **ret_error);
26 27 28 29
gboolean     gnm_plugin_is_loaded (GnmPlugin *pinfo);
void         gnm_plugin_use_ref (GnmPlugin *pinfo);
void         gnm_plugin_use_unref (GnmPlugin *pinfo);

30 31 32 33 34
char const  *gnm_plugin_get_dir_name (GnmPlugin *pinfo);
char const  *gnm_plugin_get_id (GnmPlugin *pinfo);
char const  *gnm_plugin_get_name (GnmPlugin *pinfo);
char const  *gnm_plugin_get_description (GnmPlugin *pinfo);
char const  *gnm_plugin_get_textdomain (GnmPlugin *pinfo);
35
GSList      *gnm_plugin_get_dependencies_ids (GnmPlugin *pinfo);
36
GSList      *gnm_plugin_get_services (GnmPlugin *pinfo);
37

38 39 40
/*
 *
 */
41

42
void         plugins_init (GnmCmdContext *context);
Chyla Zbigniew's avatar
Chyla Zbigniew committed
43
void         plugins_shutdown (void);
Jody Goldberg's avatar
Jody Goldberg committed
44
void         plugins_register_loader (const gchar *id_str, GnmPluginService *service);
45 46 47 48 49 50
void         plugins_unregister_loader (const gchar *id_str);
GnmPlugin   *plugins_get_plugin_by_id (const gchar *plugin_id);
GSList      *plugins_get_available_plugins (void);
void         plugins_rescan (ErrorInfo **ret_error, GSList **ret_new_plugins);
void         plugin_db_mark_plugin_for_deactivation (GnmPlugin *pinfo, gboolean mark);
gboolean     plugin_db_is_plugin_marked_for_deactivation (GnmPlugin *pinfo);
51 52
void         plugin_db_activate_plugin_list (GSList *plugins, ErrorInfo **ret_error);
void         plugin_db_deactivate_plugin_list (GSList *plugins, ErrorInfo **ret_error);
53

54
void plugin_message (gint level, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
55

56
#endif /* GNUMERIC_PLUGIN_H */