Introspection fixes.
[gnumeric.git] / src / gnm-plugin.h
blob93ee6a476cecd50c902892fc444ec2ef34e7bab9
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_PLUGIN_H_
3 # define _GNM_PLUGIN_H_
5 #include <gnumeric.h>
6 #include <goffice/goffice.h>
7 #include <goffice/app/module-plugin-defs.h>
8 #include <tools/gnm-solver.h>
9 #include <gmodule.h>
11 G_BEGIN_DECLS
13 #define GNM_PLUGIN_LOADER_MODULE_TYPE (gnm_plugin_loader_module_get_type ())
14 #define GNM_PLUGIN_LOADER_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PLUGIN_LOADER_MODULE_TYPE, GnmPluginLoaderModule))
15 GType gnm_plugin_loader_module_get_type (void);
17 #define GNM_PLUGIN_SERVICE_FUNCTION_GROUP_TYPE (gnm_plugin_service_function_group_get_type ())
18 #define GNM_PLUGIN_SERVICE_FUNCTION_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PLUGIN_SERVICE_FUNCTION_GROUP_TYPE, GnmPluginServiceFunctionGroup))
19 #define GNM_IS_PLUGIN_SERVICE_FUNCTION_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PLUGIN_SERVICE_FUNCTION_GROUP_TYPE))
21 GType gnm_plugin_service_function_group_get_type (void);
22 typedef struct GnmPluginServiceFunctionGroup_ GnmPluginServiceFunctionGroup;
23 typedef struct {
24 gboolean (*func_desc_load) (GOPluginService *service, char const *name,
25 GnmFuncDescriptor *res);
26 } GnmPluginServiceFunctionGroupCallbacks;
28 #define GNM_PLUGIN_SERVICE_UI_TYPE (gnm_plugin_service_ui_get_type ())
29 #define GNM_PLUGIN_SERVICE_UI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PLUGIN_SERVICE_UI_TYPE, PluginServiceUI))
30 #define GNM_IS_PLUGIN_SERVICE_UI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PLUGIN_SERVICE_UI_TYPE))
32 GType gnm_plugin_service_ui_get_type (void);
33 typedef struct GnmPluginServiceUI_ PluginServiceUI;
34 typedef struct {
35 void (*plugin_func_exec_action) (
36 GOPluginService *service, GnmAction const *action,
37 WorkbookControl *wbc, GOErrorInfo **ret_error);
38 } GnmPluginServiceUICallbacks;
40 /* This type is intended for use with "ui" service.
41 * Plugins should define arrays of structs of the form:
42 * GnmModulePluginUIActions <service-id>_actions[] = { ... };
44 typedef struct {
45 char const *name;
46 void (*handler) (GnmAction const *action, WorkbookControl *wbc);
47 } GnmModulePluginUIActions;
49 #define GNM_PLUGIN_SERVICE_SOLVER_TYPE (gnm_plugin_service_solver_get_type ())
50 #define GNM_PLUGIN_SERVICE_SOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PLUGIN_SERVICE_SOLVER_TYPE, PluginServiceSolver))
51 #define GNM_IS_PLUGIN_SERVICE_SOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PLUGIN_SERVICE_SOLVER_TYPE))
53 GType gnm_plugin_service_solver_get_type (void);
54 typedef struct GnmPluginServiceSolver_ PluginServiceSolver;
55 typedef struct {
56 GnmSolverCreator creator;
57 GnmSolverFactoryFunctional functional;
58 } GnmPluginServiceSolverCallbacks;
60 /**************************************************************************/
61 #define GNM_PLUGIN_MODULE_HEADER \
62 G_MODULE_EXPORT GOPluginModuleDepend const go_plugin_depends [] = { \
63 { "goffice", GOFFICE_API_VERSION }, \
64 { "gnumeric", GNM_VERSION_FULL } \
65 }; \
66 G_MODULE_EXPORT GOPluginModuleHeader const go_plugin_header = \
67 { GOFFICE_MODULE_PLUGIN_MAGIC_NUMBER, G_N_ELEMENTS (go_plugin_depends) }
69 /**************************************************************************/
71 void gnm_plugins_init (GOCmdContext *c);
73 G_END_DECLS
75 #endif /* _GNM_PLUGIN_H_ */