evolution-3.6.4/modules/mail/e-mail-event-hook.c

No issues found

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found e-mail-event-hook.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
clang-analyzer no-output-found e-mail-event-hook.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
  1 /*
  2  * e-mail-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-mail-event-hook.h"
 27 
 28 #include "e-util/e-event.h"
 29 #include "mail/em-event.h"
 30 
 31 static const EEventHookTargetMask folder_masks[] = {
 32 	{ "newmail", EM_EVENT_FOLDER_NEWMAIL },
 33 	{ NULL }
 34 };
 35 
 36 static const EEventHookTargetMask composer_masks[] = {
 37 	{ "sendoption", EM_EVENT_COMPOSER_SEND_OPTION },
 38 	{ NULL }
 39 };
 40 
 41 static const EEventHookTargetMask message_masks[] = {
 42 	{ "replyall", EM_EVENT_MESSAGE_REPLY_ALL },
 43 	{ "reply", EM_EVENT_MESSAGE_REPLY },
 44 	{ NULL }
 45 };
 46 
 47 static const EEventHookTargetMask send_receive_masks[] = {
 48 	{ "sendreceive", EM_EVENT_SEND_RECEIVE },
 49 	{ NULL }
 50 };
 51 
 52 static const EEventHookTargetMask custom_icon_masks[] = {
 53 	{ "customicon", EM_EVENT_CUSTOM_ICON },
 54 	{ NULL }
 55 };
 56 
 57 static const EEventHookTargetMap targets[] = {
 58 	{ "folder", EM_EVENT_TARGET_FOLDER, folder_masks },
 59 	{ "message", EM_EVENT_TARGET_MESSAGE, message_masks },
 60 	{ "composer", EM_EVENT_TARGET_COMPOSER, composer_masks },
 61 	{ "sendreceive", EM_EVENT_TARGET_SEND_RECEIVE, send_receive_masks },
 62 	{ "customicon", EM_EVENT_TARGET_CUSTOM_ICON, custom_icon_masks },
 63 	{ NULL }
 64 };
 65 
 66 static void
 67 mail_event_hook_class_init (EEventHookClass *class)
 68 {
 69 	EPluginHookClass *plugin_hook_class;
 70 	gint ii;
 71 
 72 	plugin_hook_class = E_PLUGIN_HOOK_CLASS (class);
 73 	plugin_hook_class->id = "org.gnome.evolution.mail.events:1.0";
 74 
 75 	class->event = (EEvent *) em_event_peek ();
 76 
 77 	for (ii = 0; targets[ii].type != NULL; ii++)
 78 		e_event_hook_class_add_target_map (
 79 			(EEventHookClass *) class, &targets[ii]);
 80 }
 81 
 82 void
 83 e_mail_event_hook_register_type (GTypeModule *type_module)
 84 {
 85 	const GTypeInfo type_info = {
 86 		sizeof (EEventHookClass),
 87 		(GBaseInitFunc) NULL,
 88 		(GBaseFinalizeFunc) NULL,
 89 		(GClassInitFunc) mail_event_hook_class_init,
 90 		(GClassFinalizeFunc) NULL,
 91 		NULL,  /* class_data */
 92 		sizeof (EEventHook),
 93 		0,     /* n_preallocs */
 94 		(GInstanceInitFunc) NULL,
 95 		NULL   /* value_table */
 96 	};
 97 
 98 	g_type_module_register_type (
 99 		type_module, e_event_hook_get_type (),
100 		"EMailEventHook", &type_info, 0);
101 }