aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-05-19 14:06:35 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-05-19 14:06:35 +0800
commit16eefad8858f0821257487aa1a6ac970708fd972 (patch)
tree8b5a0b36c9c0b0f454e10c371c68fe19954ad0ce /mail/em-format-html.c
parentc780968accce9d39e56b2ac21d0c751e1c2b0a91 (diff)
downloadgsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar.gz
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar.bz2
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar.lz
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar.xz
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.tar.zst
gsoc2013-evolution-16eefad8858f0821257487aa1a6ac970708fd972.zip
fix rodney's name choices. fix multiple-inclusion. fix forward references.
2005-05-19 Not Zed <NotZed@Ximian.com> * em-folder-utils.h: fix rodney's name choices. fix multiple-inclusion. fix forward references. fix all callers. add many fixme's for the busted api's. * em-format-quote.c (emfq_format_clone): use pseudo mime type to find message formatter. * em-format-html-display.c (efhd_format_message): remove, it didn't do anything. * em-format-html.c (efh_format_message): make this a handler callback. * em-format.c (emf_message_rfc822): make this use the pseudo mime-type x-evolution/message/rfc822 instead of the hardcoded format_message callback. * em-format-html-display.c (efhd_message_prefix): make this use a pseudo-mime-type handler rather than hard-coded, so it can be overridden by a plugin. svn path=/trunk/; revision=29382
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 87d840923d..d00387ba80 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -95,9 +95,10 @@ static void efh_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *han
static gboolean efh_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh);
static void efh_gtkhtml_destroy(GtkHTML *html, EMFormatHTML *efh);
+static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info);
+
static void efh_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormat *emfsource);
static void efh_format_error(EMFormat *emf, CamelStream *stream, const char *txt);
-static void efh_format_message(EMFormat *, CamelStream *, CamelMedium *);
static void efh_format_source(EMFormat *, CamelStream *, CamelMimePart *);
static void efh_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *);
static void efh_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid);
@@ -219,7 +220,6 @@ efh_class_init(GObjectClass *klass)
{
((EMFormatClass *)klass)->format_clone = efh_format_clone;
((EMFormatClass *)klass)->format_error = efh_format_error;
- ((EMFormatClass *)klass)->format_message = efh_format_message;
((EMFormatClass *)klass)->format_source = efh_format_source;
((EMFormatClass *)klass)->format_attachment = efh_format_attachment;
((EMFormatClass *)klass)->format_secure = efh_format_secure;
@@ -1106,6 +1106,10 @@ static EMFormatHandler type_builtin_table[] = {
{ "image/jpg", (EMFormatFunc)efh_image },
{ "image/pjpeg", (EMFormatFunc)efh_image },
+
+ /* special internal types */
+
+ { "x-evolution/message/rfc822", (EMFormatFunc)efh_format_message }
};
static void
@@ -1159,8 +1163,14 @@ static void efh_format_do(struct _mail_msg *mm)
if (((EMFormat *)m->format)->mode == EM_FORMAT_SOURCE) {
em_format_format_source((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message);
} else {
- em_format_format_prefix((EMFormat *)m->format, (CamelStream *)m->estream);
- em_format_format_message((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMedium *)m->message);
+ const EMFormatHandler *handle;
+
+ handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/prefix");
+ if (handle)
+ handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle);
+ handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/rfc822");
+ if (handle)
+ handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle);
}
camel_stream_flush((CamelStream *)m->estream);
@@ -1688,7 +1698,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
}
}
-static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part)
+static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
{
/* TODO: make this validity stuff a method */
EMFormatHTML *efh = (EMFormatHTML *) emf;
@@ -1701,10 +1711,10 @@ static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *
camel_stream_printf(stream, "<blockquote>\n");
if (!efh->hide_headers)
- efh_format_headers(efh, stream, part);
+ efh_format_headers(efh, stream, (CamelMedium *)part);
camel_stream_printf(stream, EM_FORMAT_HTML_VPAD);
- em_format_part(emf, stream, (CamelMimePart *)part);
+ em_format_part(emf, stream, part);
if (emf->message != (CamelMimeMessage *)part)
camel_stream_printf(stream, "</blockquote>\n");