90de1664ad848227f2329b201bcbbde401644c29
[claws.git] / src / plugins / vcalendar / plugin.c
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2007 Colin Leroy <colin@colino.net> and 
4  * the Claws Mail team
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #ifdef HAVE_CONFIG_H
22 #  include "config.h"
23 #include "claws-features.h"
24 #endif
25
26 #include <glib.h>
27 #include <glib/gi18n.h>
28
29 #include <time.h>
30 #include <stddef.h>
31 #include <curl/curl.h>
32
33 #include "version.h"
34 #include "vcalendar.h"
35 #include "claws.h"
36 #include "plugin.h"
37
38 #include "vcal_dbus.h"
39 #include "vcal_prefs.h"
40
41 gint plugin_init(gchar **error)
42 {
43         if (!check_plugin_version(MAKE_NUMERIC_VERSION(3,8,1,46),
44                                 VERSION_NUMERIC, _("vCalendar"), error))
45                 return -1;
46
47         tzset();
48
49         curl_global_init(CURL_GLOBAL_DEFAULT);
50         vcalendar_init();
51         if (vcalprefs.calendar_server)
52                 connect_dbus();
53
54         return 0;
55 }
56
57 gboolean plugin_done(void)
58 {
59         if (vcalprefs.calendar_server)
60                 disconnect_dbus();
61         vcalendar_done();
62
63         return TRUE;
64 }
65
66 const gchar *plugin_name(void)
67 {
68         return _("vCalendar");
69 }
70
71 const gchar *plugin_desc(void)
72 {
73         return _("This plugin enables vCalendar message handling like that produced "
74                  "by Evolution or Outlook.\n\n"
75                  "When loaded, it will create a vCalendar mailbox in the Folder "
76                  "List, which will be populated by meetings that you have accepted "
77                  "or created.\n"
78                  "Meeting requests that you receive will be presented in an "
79                  "appropriate form and you will be able to accept or decline them.\n"
80                  "To create a meeting right-click on the vCalendar or "
81                  "Meetings folder and choose \"New meeting...\".\n\n"
82                  "You will also be able to subscribe to remote webCal feeds,"
83                  "export your meetings and calendars, publish your free/busy "
84                  "information and retrieve that information from others.");
85 }
86
87 const gchar *plugin_type(void)
88 {
89         return "GTK2";
90 }
91
92 const gchar *plugin_licence(void)
93 {
94         return "GPL3+";
95 }
96
97 const gchar *plugin_version(void)
98 {
99         return VERSION;
100 }
101
102 struct PluginFeature *plugin_provides(void)
103 {
104         static struct PluginFeature features[] = 
105                 { {PLUGIN_MIMEVIEWER, "text/calendar"},
106                   {PLUGIN_FOLDERCLASS, N_("Calendar")},
107                   {PLUGIN_NOTHING, NULL}};
108         return features;
109 }