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

No issues found

 1 /*
 2  * e-cal-config-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-config-hook.h"
27 
28 #include "e-util/e-config.h"
29 #include "calendar/gui/e-cal-config.h"
30 
31 static const EConfigHookTargetMask no_masks[] = {
32 	{ NULL }
33 };
34 
35 static const EConfigHookTargetMap targets[] = {
36 	{ "source", EC_CONFIG_TARGET_SOURCE, no_masks },
37 	{ "prefs", EC_CONFIG_TARGET_PREFS, no_masks },
38 	{ NULL }
39 };
40 
41 static void
42 cal_config_hook_class_init (EConfigHookClass *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.config:1.0";
49 
50 	class->config_class = g_type_class_ref (e_cal_config_get_type ());
51 
52 	for (ii = 0; targets[ii].type != NULL; ii++)
53 		e_config_hook_class_add_target_map (
54 			(EConfigHookClass *) class, &targets[ii]);
55 }
56 
57 void
58 e_cal_config_hook_register_type (GTypeModule *type_module)
59 {
60 	const GTypeInfo type_info = {
61 		sizeof (EConfigHookClass),
62 		(GBaseInitFunc) NULL,
63 		(GBaseFinalizeFunc) NULL,
64 		(GClassInitFunc) cal_config_hook_class_init,
65 		(GClassFinalizeFunc) NULL,
66 		NULL,  /* class_data */
67 		sizeof (EConfigHook),
68 		0,     /* n_preallocs */
69 		(GInstanceInitFunc) NULL,
70 		NULL   /* value_table */
71 	};
72 
73 	g_type_module_register_type (
74 		type_module, e_config_hook_get_type (),
75 		"ECalConfigHook", &type_info, 0);
76 }