[evolution] EMailReader: Add a get_alert_sink() method.



commit c53fd13220a177dedacca7b702c6dde5eb0a47f1
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Oct 31 21:40:42 2010 -0400

    EMailReader: Add a get_alert_sink() method.

 mail/e-mail-browser.c               |    7 +++++++
 mail/e-mail-notebook-view.c         |   15 +++++++++++++++
 mail/e-mail-paned-view.c            |   15 +++++++++++++++
 mail/e-mail-reader.c                |   13 +++++++++++++
 mail/e-mail-reader.h                |    3 +++
 modules/mail/e-mail-shell-content.c |   15 +++++++++++++++
 6 files changed, 68 insertions(+), 0 deletions(-)
---
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index 5c8dba2..72afe77 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -746,6 +746,12 @@ mail_browser_get_action_group (EMailReader *reader)
 	return priv->action_group;
 }
 
+static EAlertSink *
+mail_browser_get_alert_sink (EMailReader *reader)
+{
+	return E_ALERT_SINK (reader);
+}
+
 static EMailBackend *
 mail_browser_get_backend (EMailReader *reader)
 {
@@ -922,6 +928,7 @@ static void
 e_mail_browser_reader_init (EMailReaderInterface *interface)
 {
 	interface->get_action_group = mail_browser_get_action_group;
+	interface->get_alert_sink = mail_browser_get_alert_sink;
 	interface->get_backend = mail_browser_get_backend;
 	interface->get_formatter = mail_browser_get_formatter;
 	interface->get_hide_deleted = mail_browser_get_hide_deleted;
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 1fd9c73..c0fbcf5 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -770,6 +770,20 @@ mail_notebook_view_get_action_group (EMailReader *reader)
 	return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window);
 }
 
+static EAlertSink *
+mail_notebook_view_get_alert_sink (EMailReader *reader)
+{
+	EMailView *view;
+	EShellView *shell_view;
+	EShellContent *shell_content;
+
+	view = E_MAIL_VIEW (reader);
+	shell_view = e_mail_view_get_shell_view (view);
+	shell_content = e_shell_view_get_shell_content (shell_view);
+
+	return E_ALERT_SINK (shell_content);
+}
+
 static EMailBackend *
 mail_notebook_view_get_backend (EMailReader *reader)
 {
@@ -1310,6 +1324,7 @@ static void
 e_mail_notebook_view_reader_init (EMailReaderInterface *interface)
 {
 	interface->get_action_group = mail_notebook_view_get_action_group;
+	interface->get_alert_sink = mail_notebook_view_get_alert_sink;
 	interface->get_backend = mail_notebook_view_get_backend;
 	interface->get_formatter = mail_notebook_view_get_formatter;
 	interface->get_hide_deleted = mail_notebook_view_get_hide_deleted;
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index b298c5e..f592701 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -371,6 +371,20 @@ mail_paned_view_get_action_group (EMailReader *reader)
 	return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window);
 }
 
+static EAlertSink *
+mail_paned_view_get_alert_sink (EMailReader *reader)
+{
+	EMailView *view;
+	EShellView *shell_view;
+	EShellContent *shell_content;
+
+	view = E_MAIL_VIEW (reader);
+	shell_view = e_mail_view_get_shell_view (view);
+	shell_content = e_shell_view_get_shell_content (shell_view);
+
+	return E_ALERT_SINK (shell_content);
+}
+
 static EMailBackend *
 mail_paned_view_get_backend (EMailReader *reader)
 {
@@ -943,6 +957,7 @@ static void
 e_mail_paned_view_reader_init (EMailReaderInterface *interface)
 {
 	interface->get_action_group = mail_paned_view_get_action_group;
+	interface->get_alert_sink = mail_paned_view_get_alert_sink;
 	interface->get_backend = mail_paned_view_get_backend;
 	interface->get_formatter = mail_paned_view_get_formatter;
 	interface->get_hide_deleted = mail_paned_view_get_hide_deleted;
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index f5c511c..8432e33 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -3819,6 +3819,19 @@ e_mail_reader_get_action_group (EMailReader *reader)
 	return interface->get_action_group (reader);
 }
 
+EAlertSink *
+e_mail_reader_get_alert_sink (EMailReader *reader)
+{
+	EMailReaderInterface *interface;
+
+	g_return_val_if_fail (E_IS_MAIL_READER (reader), NULL);
+
+	interface = E_MAIL_READER_GET_INTERFACE (reader);
+	g_return_val_if_fail (interface->get_alert_sink != NULL, NULL);
+
+	return interface->get_alert_sink (reader);
+}
+
 EMailBackend *
 e_mail_reader_get_backend (EMailReader *reader)
 {
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index ff7ae42..d9a78f2 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -29,6 +29,7 @@
 
 #include <gtk/gtk.h>
 #include <camel/camel.h>
+#include <e-util/e-alert-sink.h>
 #include <mail/e-mail-backend.h>
 #include <mail/em-format-html.h>
 
@@ -85,6 +86,7 @@ struct _EMailReaderInterface {
 
 	GtkActionGroup *
 			(*get_action_group)	(EMailReader *reader);
+	EAlertSink *	(*get_alert_sink)	(EMailReader *reader);
 	EMailBackend *	(*get_backend)		(EMailReader *reader);
 	EMFormatHTML *	(*get_formatter)	(EMailReader *reader);
 	gboolean	(*get_hide_deleted)	(EMailReader *reader);
@@ -121,6 +123,7 @@ GtkAction *	e_mail_reader_get_action	(EMailReader *reader,
 						 const gchar *action_name);
 GtkActionGroup *
 		e_mail_reader_get_action_group	(EMailReader *reader);
+EAlertSink *	e_mail_reader_get_alert_sink	(EMailReader *reader);
 EMailBackend *	e_mail_reader_get_backend	(EMailReader *reader);
 EMFormatHTML *	e_mail_reader_get_formatter	(EMailReader *reader);
 gboolean	e_mail_reader_get_hide_deleted	(EMailReader *reader);
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 2872da5..9ec0cb8 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -269,6 +269,20 @@ mail_shell_content_get_action_group (EMailReader *reader)
 	return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window);
 }
 
+static EAlertSink *
+mail_shell_content_get_alert_sink (EMailReader *reader)
+{
+	EMailShellContentPrivate *priv;
+
+	priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader);
+
+	/* Forward this to our internal EMailView, which
+	 * also implements the EMailReader interface. */
+	reader = E_MAIL_READER (priv->mail_view);
+
+	return e_mail_reader_get_alert_sink (reader);
+}
+
 static EMailBackend *
 mail_shell_content_get_backend (EMailReader *reader)
 {
@@ -450,6 +464,7 @@ static void
 mail_shell_content_reader_init (EMailReaderInterface *interface)
 {
 	interface->get_action_group = mail_shell_content_get_action_group;
+	interface->get_alert_sink = mail_shell_content_get_alert_sink;
 	interface->get_backend = mail_shell_content_get_backend;
 	interface->get_formatter = mail_shell_content_get_formatter;
 	interface->get_hide_deleted = mail_shell_content_get_hide_deleted;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]