evolution-3.6.4/modules/calendar/e-cal-event-hook.c

No issues found

 1 /*
 2  * e-cal-event-hook.c
 3  *
 4  * This program is free software; you can redistribute it and/or
 5  * modify it under the terms of the GNU Lesser General Public
 6  * License as published by the Free Software Foundation; either
 7  * version 2 of the License, or (at your option) version 3.
 8  *
 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with the program; if not, see <http://www.gnu.org/licenses/>
16  *
17  *
18  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
19  *
20  */
21 
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25 
26 #include "e-cal-event-hook.h"
27 
28 #include "e-util/e-event.h"
29 #include "calendar/gui/e-cal-event.h"
30 
31 static const EEventHookTargetMask masks[] = {
32 	{ "migration", E_CAL_EVENT_MODULE_MIGRATION },
33 	{ NULL }
34 };
35 
36 static const EEventHookTargetMap targets[] = {
37 	{ "module", E_CAL_EVENT_TARGET_BACKEND, masks },
38 	{ NULL }
39 };
40 
41 static void
42 cal_event_hook_class_init (EEventHookClass *class)
43 {
44 	EPluginHookClass *plugin_hook_class;
45 	gint ii;
46 
47 	plugin_hook_class = E_PLUGIN_HOOK_CLASS (class);
48 	plugin_hook_class->id = "org.gnome.evolution.calendar.events:1.0";
49 
50 	class->event = (EEvent *) e_cal_event_peek ();
51 
52 	for (ii = 0; targets[ii].type != NULL; ii++)
53 		e_event_hook_class_add_target_map (
54 			(EEventHookClass *) class, &targets[ii]);
55 }
56 
57 void
58 e_cal_event_hook_register_type (GTypeModule *type_module)
59 {
60 	const GTypeInfo type_info = {
61 		sizeof (EEventHookClass),
62 		(GBaseInitFunc) NULL,
63 		(GBaseFinalizeFunc) NULL,
64 		(GClassInitFunc) cal_event_hook_class_init,
65 		(GClassFinalizeFunc) NULL,
66 		NULL,  /* class_data */
67 		sizeof (EEventHook),
68 		0,     /* n_preallocs */
69 		(GInstanceInitFunc) NULL,
70 		NULL   /* value_table */
71 	};
72 
73 	g_type_module_register_type (
74 		type_module, e_event_hook_get_type (),
75 		"ECalEventHook", &type_info, 0);
76 }