2011-02-16 [paul] 3.7.8cvs57
[claws.git] / src / common / plugin.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef PLUGIN_H
21 #define PLUGIN_H 1
22
23 #include <glib.h>
24
25 typedef struct _Plugin Plugin;
26
27 typedef enum {
28         PLUGIN_NOTHING,
29         PLUGIN_MIMEVIEWER,
30         PLUGIN_MIMEPARSER,
31         PLUGIN_FOLDERCLASS,
32         PLUGIN_FILTERING,
33         PLUGIN_PRIVACY,
34         PLUGIN_NOTIFIER,
35         PLUGIN_UTILITY,
36         PLUGIN_OTHER
37 } PluginFeatureType;
38
39 struct PluginFeature {
40         PluginFeatureType type;
41         const gchar *subtype;
42 };
43
44 /* Functions to implement by the plugin */
45 gint plugin_init                (gchar          **error);
46 gboolean plugin_done            (void);
47 const gchar *plugin_name        (void);
48 const gchar *plugin_desc        (void);
49 const gchar *plugin_version     (void);
50 struct PluginFeature *plugin_provides (void);
51
52 /* Functions by the sylpheed plugin system */
53 Plugin *plugin_load             (const gchar     *filename,
54                                  gchar          **error);
55 void plugin_unload              (Plugin          *plugin);
56 void plugin_load_all            (const gchar     *type);
57 void plugin_unload_all          (const gchar     *type);
58 void plugin_save_list           (void);
59 void plugin_load_standard_plugins (void);
60
61 GSList *plugin_get_list         (void);
62 GSList *plugin_get_unloaded_list(void);
63 const gchar *plugin_get_name    (Plugin          *plugin);
64 const gchar *plugin_get_desc    (Plugin          *plugin);
65 const gchar *plugin_get_version (Plugin          *plugin);
66 const gchar *plugin_get_error   (Plugin          *plugin);
67 Plugin      *plugin_get_loaded_by_name(const gchar *name);
68 gint check_plugin_version       (guint32 minimum_claws_version,
69                                  guint32 compiled_claws_version,
70                                  const gchar *plugin_name,
71                                  gchar **error);
72 #endif