Blame src/modules/calendar/e-cal-event-hook.c

Packit 15f964
/*
Packit 15f964
 * e-cal-event-hook.c
Packit 15f964
 *
Packit 15f964
 * This program is free software; you can redistribute it and/or modify it
Packit 15f964
 * under the terms of the GNU Lesser General Public License as published by
Packit 15f964
 * the Free Software Foundation.
Packit 15f964
 *
Packit 15f964
 * This program is distributed in the hope that it will be useful, but
Packit 15f964
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
Packit 15f964
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit 15f964
 * for more details.
Packit 15f964
 *
Packit 15f964
 * You should have received a copy of the GNU Lesser General Public License
Packit 15f964
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit 15f964
 *
Packit 15f964
 *
Packit 15f964
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
Packit 15f964
 *
Packit 15f964
 */
Packit 15f964
Packit 15f964
#include "evolution-config.h"
Packit 15f964
Packit 15f964
#include "e-cal-event-hook.h"
Packit 15f964
Packit 15f964
#include "calendar/gui/e-cal-event.h"
Packit 15f964
Packit 15f964
static const EEventHookTargetMask masks[] = {
Packit 15f964
	{ "migration", E_CAL_EVENT_MODULE_MIGRATION },
Packit 15f964
	{ NULL }
Packit 15f964
};
Packit 15f964
Packit 15f964
static const EEventHookTargetMap targets[] = {
Packit 15f964
	{ "module", E_CAL_EVENT_TARGET_BACKEND, masks },
Packit 15f964
	{ NULL }
Packit 15f964
};
Packit 15f964
Packit 15f964
static void
Packit 15f964
cal_event_hook_class_init (EEventHookClass *class)
Packit 15f964
{
Packit 15f964
	EPluginHookClass *plugin_hook_class;
Packit 15f964
	gint ii;
Packit 15f964
Packit 15f964
	plugin_hook_class = E_PLUGIN_HOOK_CLASS (class);
Packit 15f964
	plugin_hook_class->id = "org.gnome.evolution.calendar.events:1.0";
Packit 15f964
Packit 15f964
	class->event = (EEvent *) e_cal_event_peek ();
Packit 15f964
Packit 15f964
	for (ii = 0; targets[ii].type != NULL; ii++)
Packit 15f964
		e_event_hook_class_add_target_map (
Packit 15f964
			(EEventHookClass *) class, &targets[ii]);
Packit 15f964
}
Packit 15f964
Packit 15f964
void
Packit 15f964
e_cal_event_hook_register_type (GTypeModule *type_module)
Packit 15f964
{
Packit 15f964
	const GTypeInfo type_info = {
Packit 15f964
		sizeof (EEventHookClass),
Packit 15f964
		(GBaseInitFunc) NULL,
Packit 15f964
		(GBaseFinalizeFunc) NULL,
Packit 15f964
		(GClassInitFunc) cal_event_hook_class_init,
Packit 15f964
		(GClassFinalizeFunc) NULL,
Packit 15f964
		NULL,  /* class_data */
Packit 15f964
		sizeof (EEventHook),
Packit 15f964
		0,     /* n_preallocs */
Packit 15f964
		(GInstanceInitFunc) NULL,
Packit 15f964
		NULL   /* value_table */
Packit 15f964
	};
Packit 15f964
Packit 15f964
	g_type_module_register_type (
Packit 15f964
		type_module, e_event_hook_get_type (),
Packit 15f964
		"ECalEventHook", &type_info, 0);
Packit 15f964
}