X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-plugin.h;h=7d9a99a09ad8845c1a3c2c7d73f2849eb9df57d4;hp=4f9cc78f290e4afc7867ef7113de04fb5ca27cf7;hb=0cd3bbc169fe8d5a35d6d61555668244b4d04067;hpb=627c4af6ac85444cc3256fa568baf4a8d62178ae diff --git a/src/modest-plugin.h b/src/modest-plugin.h index 4f9cc78..7d9a99a 100644 --- a/src/modest-plugin.h +++ b/src/modest-plugin.h @@ -33,6 +33,12 @@ #include #include #include +#include +#include + +#define MODEST_API_VERSION_STR2_HELPER(x) #x +#define MODEST_API_VERSION_STR_HELPER(x) MODEST_API_VERSION_STR2_HELPER(x) +#define MODEST_API_VERSION_STR MODEST_API_VERSION_STR_HELPER(MODEST_API_VERSION) G_BEGIN_DECLS @@ -53,6 +59,7 @@ struct _ModestPlugin { struct _ModestPluginClass { GObjectClass parent_class; + const gchar * (*get_version) (void); }; /** @@ -75,10 +82,15 @@ plugin_name##_get_type (void) \ static void plugin_name##_init (PluginName *self); \ static void plugin_name##_class_init (PluginName##Class *klass); \ static gpointer plugin_name##_parent_class = NULL; \ +static const gchar *plugin_name##_internal_get_version (void) \ +{ \ + return MODEST_API_VERSION_STR; \ +} \ static void plugin_name##_class_intern_init (gpointer klass) \ { \ plugin_name##_parent_class = g_type_class_peek_parent (klass); \ plugin_name##_class_init ((PluginName##Class *) klass); \ + ((ModestPluginClass *)klass)->get_version = plugin_name##_internal_get_version; \ } \ \ G_MODULE_EXPORT GType \ @@ -110,7 +122,9 @@ register_modest_plugin (GTypeModule *module) \ /* Global methods providing access to singletons without using modest runtime */ ModestAccountMgr *modest_plugin_get_account_mgr (void); ModestProtocolRegistry *modest_plugin_get_protocol_registry (void); - +ModestTnyAccountStore *modest_plugin_get_account_store (void); +ModestMailOperationQueue *modest_plugin_get_mail_operation_queue (void); +const gchar *modest_plugin_get_api_version (ModestPlugin *plugin); G_END_DECLS #endif /* __MODEST_PLUGIN_H__ */