aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-03-29 00:38:11 +0800
committerDan Vrátil <dvratil@redhat.com>2012-03-29 00:38:25 +0800
commit6d2c382788a4042d53f49a080acd11b499aa52f6 (patch)
tree3834f0836340918ba17594a603ba61c13b9929a0 /mail/em-composer-utils.c
parent6bd1c6833a2c51898ac45865767dd01ba66a95c5 (diff)
downloadgsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar.gz
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar.bz2
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar.lz
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar.xz
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.tar.zst
gsoc2013-evolution-6d2c382788a4042d53f49a080acd11b499aa52f6.zip
WebKit port - port formatter and mail module
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 745609fbc0..f4b8560f81 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -51,12 +51,14 @@
#include <composer/e-composer-actions.h>
#include <composer/e-composer-post-header.h>
+#include "e-mail-printer.h"
#include "em-utils.h"
#include "em-composer-utils.h"
#include "em-folder-selector.h"
#include "em-folder-tree.h"
#include "em-format-html.h"
#include "em-format-html-print.h"
+#include "em-format-html-display.h"
#include "em-format-quote.h"
#include "em-event.h"
#include "mail-send-recv.h"
@@ -929,17 +931,38 @@ em_utils_composer_save_to_outbox_cb (EMsgComposer *composer,
}
static void
+composer_print_done_cb (EMailPrinter *emp,
+ GtkPrintOperation *operation,
+ GtkPrintOperationResult result,
+ gpointer user_data)
+{
+ EMFormat *emf = user_data;
+ g_object_unref (emf);
+ g_object_unref (emp);
+}
+
+static void
em_utils_composer_print_cb (EMsgComposer *composer,
GtkPrintOperationAction action,
CamelMimeMessage *message,
EActivity *activity,
EMailSession *session)
{
- EMFormatHTMLPrint *efhp;
+ EMailPrinter *emp;
+ EMFormatHTMLDisplay *efhd;
+
+ efhd = em_format_html_display_new ();
+ ((EMFormat *) efhd)->message_uid = g_strdup (camel_mime_message_get_message_id (message));
+
+ /* Parse the message */
+ em_format_parse ((EMFormat *) efhd, message, NULL, NULL);
+
+ /* Use EMailPrinter and WebKit to print the message */
+ emp = e_mail_printer_new ((EMFormatHTML *) efhd);
+ g_signal_connect (emp, "done",
+ G_CALLBACK (composer_print_done_cb), efhd);
- efhp = em_format_html_print_new (NULL, action);
- em_format_html_print_message (efhp, message, NULL, NULL);
- g_object_unref (efhp);
+ e_mail_printer_print (emp, FALSE, NULL);
}
/* Composing messages... */