aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-print-config-headers.h
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-12 04:05:22 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-08 12:25:15 +0800
commit27c92e7f3d166e0ab38ad8d652b3c5079a86cddb (patch)
tree9c73eca9a1e88ad2f5401e8b0960b93434edc3f7 /mail/e-mail-print-config-headers.h
parent64388b6b828c49827dad1159dac1482cc9840650 (diff)
downloadgsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar.gz
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar.bz2
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar.lz
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar.xz
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.tar.zst
gsoc2013-evolution-27c92e7f3d166e0ab38ad8d652b3c5079a86cddb.zip
Add EMailPrintConfigHeaders.
This splits the print dialog's "Headers" tab into a separate widget. EMailPrintConfigHeaders takes an EMailPartHeaders and displays its print model, which is a representation of all message headers (except subject) with an on/off flag for each. The headers can be toggled and reordered, and the changes are written back to the print model. During printing, EMailFormatterPrintHeaders uses the same print model to determine which headers to show and in what order (except subject). This approach is much saner than the old method, which was trying to manipulate WebKitWebView DOM directly to toggle and reorder headers. This approach also happens to work, whereas the old method did not.
Diffstat (limited to 'mail/e-mail-print-config-headers.h')
-rw-r--r--mail/e-mail-print-config-headers.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/mail/e-mail-print-config-headers.h b/mail/e-mail-print-config-headers.h
new file mode 100644
index 0000000000..5b7d923a07
--- /dev/null
+++ b/mail/e-mail-print-config-headers.h
@@ -0,0 +1,69 @@
+/*
+ * e-mail-print-config-headers.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#ifndef E_MAIL_PRINT_CONFIG_HEADERS_H
+#define E_MAIL_PRINT_CONFIG_HEADERS_H
+
+#include <em-format/e-mail-part-headers.h>
+
+/* Standard GObject macros */
+#define E_TYPE_MAIL_PRINT_CONFIG_HEADERS \
+ (e_mail_print_config_headers_get_type ())
+#define E_MAIL_PRINT_CONFIG_HEADERS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_MAIL_PRINT_CONFIG_HEADERS, EMailPrintConfigHeaders))
+#define E_MAIL_PRINT_CONFIG_HEADERS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_MAIL_PRINT_CONFIG_HEADERS, EMailPrintConfigHeadersClass))
+#define E_IS_MAIL_PRINT_CONFIG_HEADERS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_MAIL_PRINT_CONFIG_HEADERS))
+#define E_IS_MAIL_PRINT_CONFIG_HEADERS_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_MAIL_PRINT_CONFIG_HEADERS))
+#define E_MAIL_PRINT_CONFIG_HEADERS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MAIL_PRINT_CONFIG_HEADERS, EMailPrintConfigHeadersClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EMailPrintConfigHeaders EMailPrintConfigHeaders;
+typedef struct _EMailPrintConfigHeadersClass EMailPrintConfigHeadersClass;
+typedef struct _EMailPrintConfigHeadersPrivate EMailPrintConfigHeadersPrivate;
+
+struct _EMailPrintConfigHeaders {
+ GtkBox parent;
+ EMailPrintConfigHeadersPrivate *priv;
+};
+
+struct _EMailPrintConfigHeadersClass {
+ GtkBoxClass parent_class;
+};
+
+GType e_mail_print_config_headers_get_type
+ (void) G_GNUC_CONST;
+GtkWidget * e_mail_print_config_headers_new
+ (EMailPartHeaders *part);
+EMailPartHeaders *
+ e_mail_print_config_headers_ref_part
+ (EMailPrintConfigHeaders *config);
+
+G_END_DECLS
+
+#endif /* E_MAIL_PRINT_CONFIG_HEADERS_H */
+