1 /* Evolution calendar - caldav backend factory
3 * Copyright (C) 2005 Novell, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Author: Christian Kellner <gicmo@gnome.org>
27 #include "e-cal-backend-caldav-factory.h"
28 #include "e-cal-backend-caldav.h"
31 ECalBackendFactory parent_object;
32 } ECalBackendCalDAVFactory;
35 ECalBackendFactoryClass parent_class;
36 } ECalBackendCalDAVFactoryClass;
39 e_cal_backend_caldav_factory_instance_init (ECalBackendCalDAVFactory *factory)
44 _get_protocol (ECalBackendFactory *factory)
50 _events_new_backend (ECalBackendFactory *factory, ESource *source)
52 return g_object_new (E_TYPE_CAL_BACKEND_CALDAV,
54 "kind", ICAL_VEVENT_COMPONENT,
58 static icalcomponent_kind
59 _events_get_kind (ECalBackendFactory *factory)
61 return ICAL_VEVENT_COMPONENT;
65 events_backend_factory_class_init (ECalBackendCalDAVFactoryClass *klass)
67 E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
68 E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind = _events_get_kind;
69 E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend = _events_new_backend;
73 events_backend_factory_get_type (GTypeModule *module)
78 sizeof (ECalBackendCalDAVFactoryClass),
79 NULL, /* base_class_init */
80 NULL, /* base_class_finalize */
81 (GClassInitFunc) events_backend_factory_class_init,
82 NULL, /* class_finalize */
83 NULL, /* class_data */
86 (GInstanceInitFunc) e_cal_backend_caldav_factory_instance_init
89 type = g_type_module_register_type (module,
90 E_TYPE_CAL_BACKEND_FACTORY,
91 "ECalBackendCalDAVEventsFactory",
98 static GType caldav_types[1];
101 eds_module_initialize (GTypeModule *module)
103 caldav_types[0] = events_backend_factory_get_type (module);
107 eds_module_shutdown (void)
112 eds_module_list_types (const GType **types, int *num_types)
114 *types = caldav_types;