## EMailFormatter EMailFormatter |

## Synopsis

    struct              EMailFormatter;
    enum                EMailFormatterHeaderFlags;
    enum                EMailFormatterMode;
    struct              EMailFormatterContext;
    EMailFormatter *    e_mail_formatter_new                (void);
    void                e_mail_formatter_format_sync        (EMailFormatter *formatter,
                                                             EMailPartList *part_list,
                                                             GOutputStream *stream,
                                                             EMailFormatterHeaderFlags flags,
                                                             EMailFormatterMode mode,
                                                             GCancellable *cancellable);
    void                e_mail_formatter_format             (EMailFormatter *formatter,
                                                             EMailPartList *part_list,
                                                             GOutputStream *stream,
                                                             EMailFormatterHeaderFlags flags,
                                                             EMailFormatterMode mode,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancellable,
                                                             gpointer user_data);
    gboolean            e_mail_formatter_format_finish      (EMailFormatter *formatter,
                                                             GAsyncResult *result,
                                                             GError **error);
    gboolean            e_mail_formatter_format_as          (EMailFormatter *formatter,
                                                             EMailFormatterContext *context,
                                                             EMailPart *part,
                                                             GOutputStream *stream,
                                                             const gchar *as_mime_type,
                                                             GCancellable *cancellable);
    void                e_mail_formatter_format_text        (EMailFormatter *formatter,
                                                             EMailPart *part,
                                                             GOutputStream *stream,
                                                             GCancellable *cancellable);
    const gchar *       e_mail_formatter_get_sub_html_header
                                                            (EMailFormatter *formatter);
    gchar *             e_mail_formatter_get_html_header    (EMailFormatter *formatter);
    EMailExtensionRegistry * e_mail_formatter_get_extension_registry
                                                            (EMailFormatter *formatter);
    CamelMimeFilterToHTMLFlags e_mail_formatter_get_text_format_flags
                                                            (EMailFormatter *formatter);
    enum                EMailFormatterColor;
    const GdkRGBA *     e_mail_formatter_get_color          (EMailFormatter *formatter,
                                                             EMailFormatterColor type);
    void                e_mail_formatter_set_color          (EMailFormatter *formatter,
                                                             EMailFormatterColor type,
                                                             const GdkRGBA *color);
    void                e_mail_formatter_update_style       (EMailFormatter *formatter,
                                                             GtkStateFlags state);
    EImageLoadingPolicy e_mail_formatter_get_image_loading_policy
                                                            (EMailFormatter *formatter);
    void                e_mail_formatter_set_image_loading_policy
                                                            (EMailFormatter *formatter,
                                                             EImageLoadingPolicy policy);
    gboolean            e_mail_formatter_get_mark_citations (EMailFormatter *formatter);
    void                e_mail_formatter_set_mark_citations (EMailFormatter *formatter,
                                                             gboolean mark_citations);
    gboolean            e_mail_formatter_get_show_sender_photo
                                                            (EMailFormatter *formatter);
    void                e_mail_formatter_set_show_sender_photo
                                                            (EMailFormatter *formatter,
                                                             gboolean show_sender_photo);
    gboolean            e_mail_formatter_get_animate_images (EMailFormatter *formatter);
    void                e_mail_formatter_set_animate_images (EMailFormatter *formatter,
                                                             gboolean animate_images);
    gboolean            e_mail_formatter_get_show_real_date (EMailFormatter *formatter);
    void                e_mail_formatter_set_show_real_date (EMailFormatter *formatter,
                                                             gboolean show_real_date);
    const gchar *       e_mail_formatter_get_charset        (EMailFormatter *formatter);
    gchar *             e_mail_formatter_dup_charset        (EMailFormatter *formatter);
    void                e_mail_formatter_set_charset        (EMailFormatter *formatter,
                                                             const gchar *charset);
    const gchar *       e_mail_formatter_get_default_charset
                                                            (EMailFormatter *formatter);
    gchar *             e_mail_formatter_dup_default_charset
                                                            (EMailFormatter *formatter);
    void                e_mail_formatter_set_default_charset
                                                            (EMailFormatter *formatter,
                                                             const gchar *charset);
    void                e_mail_formatter_format_header      (EMailFormatter *formatter,
                                                             GString *buffer,
                                                             const gchar *header_name,
                                                             const gchar *header_value,
                                                             guint32 flags,
                                                             const gchar *charset);
    void                e_mail_formatter_format_text_header (EMailFormatter *formatter,
                                                             GString *buffer,
                                                             const gchar *label,
                                                             const gchar *value,
                                                             guint32 flags);
    gchar *             e_mail_formatter_format_address     (EMailFormatter *formatter,
                                                             GString *out,
                                                             struct _camel_header_address *a,
                                                             const gchar *field,
                                                             gboolean no_links,
                                                             gboolean elipsize);
    void                e_mail_formatter_canon_header_name  (gchar *name);
    GList *             e_mail_formatter_find_rfc822_end_iter
                                                            (GList *rfc822_start_iter);
    gchar *             e_mail_formatter_parse_html_mnemonics
                                                            (const gchar *label,
                                                             gchar **out_access_key);

## Object Hierarchy

      GObject
       +----EMailFormatter
             +----EMailFormatterPrint
             +----EMailFormatterQuote

## Implemented Interfaces

EMailFormatter implements EExtensible.

## Properties

      "animate-images"           gboolean              : Read / Write
      "body-color"               GdkRGBA*              : Read / Write
      "charset"                  gchar*                : Read / Write
      "citation-color"           GdkRGBA*              : Read / Write
      "content-color"            GdkRGBA*              : Read / Write
      "default-charset"          gchar*                : Read / Write
      "frame-color"              GdkRGBA*              : Read / Write
      "header-color"             GdkRGBA*              : Read / Write
      "image-loading-policy"     EImageLoadingPolicy   : Read / Write
      "mark-citations"           gboolean              : Read / Write
      "show-real-date"           gboolean              : Read / Write / Construct
      "show-sender-photo"        gboolean              : Read / Write / Construct
      "text-color"               GdkColor*             : Read / Write

## Signals

      "need-redraw"                                    : Run First

## Description

## Details

### struct EMailFormatter

    struct EMailFormatter;

### enum EMailFormatterHeaderFlags

    typedef enum {
     /*< flags >*/
    	E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE = 1 << 0,
    	E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED = 1 << 1,
    	E_MAIL_FORMATTER_HEADER_FLAG_HTML = 1 << 2,
    	E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS = 1 << 3,
    	E_MAIL_FORMATTER_HEADER_FLAG_BOLD = 1 << 4,
    	E_MAIL_FORMATTER_HEADER_FLAG_NODEC = 1 << 5,
    	E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN = 1 << 6,
    	E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS = 1 << 7,
    	E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE = 1 << 8
    } EMailFormatterHeaderFlags;

`E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE` |
`E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED` |
`E_MAIL_FORMATTER_HEADER_FLAG_HTML` |
`E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS` |
`E_MAIL_FORMATTER_HEADER_FLAG_BOLD` |
`E_MAIL_FORMATTER_HEADER_FLAG_NODEC` |
`E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN` |
`E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS` |
`E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE` |

### enum EMailFormatterMode

    typedef enum {
    	E_MAIL_FORMATTER_MODE_INVALID = -1,
    	E_MAIL_FORMATTER_MODE_NORMAL = 0,
    	E_MAIL_FORMATTER_MODE_SOURCE,
    	E_MAIL_FORMATTER_MODE_RAW,
    	E_MAIL_FORMATTER_MODE_CID,
    	E_MAIL_FORMATTER_MODE_PRINTING,
    	E_MAIL_FORMATTER_MODE_ALL_HEADERS
    } EMailFormatterMode;

`E_MAIL_FORMATTER_MODE_INVALID` |
`E_MAIL_FORMATTER_MODE_NORMAL` |
`E_MAIL_FORMATTER_MODE_SOURCE` |
`E_MAIL_FORMATTER_MODE_RAW` |
`E_MAIL_FORMATTER_MODE_CID` |
`E_MAIL_FORMATTER_MODE_PRINTING` |
`E_MAIL_FORMATTER_MODE_ALL_HEADERS` |

### struct EMailFormatterContext

    struct EMailFormatterContext {
    	EMailPartList *part_list;
    	EMailFormatterMode mode;
    	EMailFormatterHeaderFlags flags;

    	gchar *uri;
    };

### e_mail_formatter_new ()

    EMailFormatter *    e_mail_formatter_new                (void);

### e_mail_formatter_format_sync ()

    void                e_mail_formatter_format_sync        (EMailFormatter *formatter,
                                                             EMailPartList *part_list,
                                                             GOutputStream *stream,
                                                             EMailFormatterHeaderFlags flags,
                                                             EMailFormatterMode mode,
                                                             GCancellable *cancellable);

### e_mail_formatter_format ()

    void                e_mail_formatter_format             (EMailFormatter *formatter,
                                                             EMailPartList *part_list,
                                                             GOutputStream *stream,
                                                             EMailFormatterHeaderFlags flags,
                                                             EMailFormatterMode mode,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancellable,
                                                             gpointer user_data);

### e_mail_formatter_format_finish ()

    gboolean            e_mail_formatter_format_finish      (EMailFormatter *formatter,
                                                             GAsyncResult *result,
                                                             GError **error);

### e_mail_formatter_format_as ()

    gboolean            e_mail_formatter_format_as          (EMailFormatter *formatter,
                                                             EMailFormatterContext *context,
                                                             EMailPart *part,
                                                             GOutputStream *stream,
                                                             const gchar *as_mime_type,
                                                             GCancellable *cancellable);

Formats given `part` using a `formatter` extension for given mime type. When the mime type is `NULL`, the function will try to lookup the best formatter for given `part` by it's default mime type.

`formatter` : | an EMailFormatter
`context` : | an EMailFormatterContext
`part` : | an EMailPart
`stream` : | a GOutputStream
`as_mime_type` : | (allow-none) mime-type to use for formatting, or `NULL`
`cancellable` : | (allow-none) an optional GCancellable
Returns : | `TRUE` on success, `FALSE` when no suitable formatter is found or when it fails to format the part.

### e_mail_formatter_format_text ()

    void                e_mail_formatter_format_text        (EMailFormatter *formatter,
                                                             EMailPart *part,
                                                             GOutputStream *stream,
                                                             GCancellable *cancellable);

### e_mail_formatter_get_sub_html_header ()

    const gchar *       e_mail_formatter_get_sub_html_header
                                                            (EMailFormatter *formatter);

### e_mail_formatter_get_html_header ()

    gchar *             e_mail_formatter_get_html_header    (EMailFormatter *formatter);

### e_mail_formatter_get_extension_registry ()

    EMailExtensionRegistry * e_mail_formatter_get_extension_registry
                                                            (EMailFormatter *formatter);

### e_mail_formatter_get_text_format_flags ()

    CamelMimeFilterToHTMLFlags e_mail_formatter_get_text_format_flags
                                                            (EMailFormatter *formatter);

### enum EMailFormatterColor

    typedef enum {
    	E_MAIL_FORMATTER_COLOR_BODY,		/* header area background */
    	E_MAIL_FORMATTER_COLOR_CITATION, /* citation font color */
    	E_MAIL_FORMATTER_COLOR_CONTENT,		/* message area background */
    	E_MAIL_FORMATTER_COLOR_FRAME,		/* frame around message area */
    	E_MAIL_FORMATTER_COLOR_HEADER,		/* header font color */
    	E_MAIL_FORMATTER_COLOR_TEXT,		/* message font color */
    	E_MAIL_FORMATTER_NUM_COLOR_TYPES /*< skip >*/
    } EMailFormatterColor;

`E_MAIL_FORMATTER_COLOR_BODY` |
`E_MAIL_FORMATTER_COLOR_CITATION` |
`E_MAIL_FORMATTER_COLOR_CONTENT` |
`E_MAIL_FORMATTER_COLOR_FRAME` |
`E_MAIL_FORMATTER_COLOR_HEADER` |
`E_MAIL_FORMATTER_COLOR_TEXT` |
`E_MAIL_FORMATTER_NUM_COLOR_TYPES` |

### e_mail_formatter_get_color ()

    const GdkRGBA *     e_mail_formatter_get_color          (EMailFormatter *formatter,
                                                             EMailFormatterColor type);

### e_mail_formatter_set_color ()

    void                e_mail_formatter_set_color          (EMailFormatter *formatter,
                                                             EMailFormatterColor type,
                                                             const GdkRGBA *color);

### e_mail_formatter_update_style ()

    void                e_mail_formatter_update_style       (EMailFormatter *formatter,
                                                             GtkStateFlags state);

### e_mail_formatter_get_image_loading_policy ()

    EImageLoadingPolicy e_mail_formatter_get_image_loading_policy
                                                            (EMailFormatter *formatter);

### e_mail_formatter_set_image_loading_policy ()

    void                e_mail_formatter_set_image_loading_policy
                                                            (EMailFormatter *formatter,
                                                             EImageLoadingPolicy policy);

### e_mail_formatter_get_mark_citations ()

    gboolean            e_mail_formatter_get_mark_citations (EMailFormatter *formatter);

### e_mail_formatter_set_mark_citations ()

    void                e_mail_formatter_set_mark_citations (EMailFormatter *formatter,
                                                             gboolean mark_citations);

### e_mail_formatter_get_show_sender_photo ()

    gboolean            e_mail_formatter_get_show_sender_photo
                                                            (EMailFormatter *formatter);

### e_mail_formatter_set_show_sender_photo ()

    void                e_mail_formatter_set_show_sender_photo
                                                            (EMailFormatter *formatter,
                                                             gboolean show_sender_photo);

### e_mail_formatter_get_animate_images ()

    gboolean            e_mail_formatter_get_animate_images (EMailFormatter *formatter);

### e_mail_formatter_set_animate_images ()

    void                e_mail_formatter_set_animate_images (EMailFormatter *formatter,
                                                             gboolean animate_images);

### e_mail_formatter_get_show_real_date ()

    gboolean            e_mail_formatter_get_show_real_date (EMailFormatter *formatter);

### e_mail_formatter_set_show_real_date ()

    void                e_mail_formatter_set_show_real_date (EMailFormatter *formatter,
                                                             gboolean show_real_date);

### e_mail_formatter_get_charset ()

    const gchar *       e_mail_formatter_get_charset        (EMailFormatter *formatter);

### e_mail_formatter_dup_charset ()

    gchar *             e_mail_formatter_dup_charset        (EMailFormatter *formatter);

### e_mail_formatter_set_charset ()

    void                e_mail_formatter_set_charset        (EMailFormatter *formatter,
                                                             const gchar *charset);

### e_mail_formatter_get_default_charset ()

    const gchar *       e_mail_formatter_get_default_charset
                                                            (EMailFormatter *formatter);

### e_mail_formatter_dup_default_charset ()

    gchar *             e_mail_formatter_dup_default_charset
                                                            (EMailFormatter *formatter);

### e_mail_formatter_set_default_charset ()

    void                e_mail_formatter_set_default_charset
                                                            (EMailFormatter *formatter,
                                                             const gchar *charset);

### e_mail_formatter_format_header ()

    void                e_mail_formatter_format_header      (EMailFormatter *formatter,
                                                             GString *buffer,
                                                             const gchar *header_name,
                                                             const gchar *header_value,
                                                             guint32 flags,
                                                             const gchar *charset);

### e_mail_formatter_format_text_header ()

    void                e_mail_formatter_format_text_header (EMailFormatter *formatter,
                                                             GString *buffer,
                                                             const gchar *label,
                                                             const gchar *value,
                                                             guint32 flags);

### e_mail_formatter_format_address ()

    gchar *             e_mail_formatter_format_address     (EMailFormatter *formatter,
                                                             GString *out,
                                                             struct _camel_header_address *a,
                                                             const gchar *field,
                                                             gboolean no_links,
                                                             gboolean elipsize);

### e_mail_formatter_canon_header_name ()

    void                e_mail_formatter_canon_header_name  (gchar *name);

### e_mail_formatter_find_rfc822_end_iter ()

    GList *             e_mail_formatter_find_rfc822_end_iter
                                                            (GList *rfc822_start_iter);

### e_mail_formatter_parse_html_mnemonics ()

    gchar *             e_mail_formatter_parse_html_mnemonics
                                                            (const gchar *label,
                                                             gchar **out_access_key);

## Property Details

### The `"animate-images"` property

      "animate-images"           gboolean              : Read / Write

Default value: FALSE

### The `"body-color"` property

      "body-color"               GdkRGBA*              : Read / Write

### The `"charset"` property

      "charset"                  gchar*                : Read / Write

Default value: NULL

### The `"citation-color"` property

      "citation-color"           GdkRGBA*              : Read / Write

### The `"content-color"` property

      "content-color"            GdkRGBA*              : Read / Write

### The `"default-charset"` property

      "default-charset"          gchar*                : Read / Write

Default value: NULL

### The `"frame-color"` property

      "frame-color"              GdkRGBA*              : Read / Write

### The `"header-color"` property

      "header-color"             GdkRGBA*              : Read / Write

### The `"image-loading-policy"` property

      "image-loading-policy"     EImageLoadingPolicy   : Read / Write

Default value: E_IMAGE_LOADING_POLICY_NEVER

### The `"mark-citations"` property

      "mark-citations"           gboolean              : Read / Write

Default value: TRUE

### The `"show-real-date"` property

      "show-real-date"           gboolean              : Read / Write / Construct

Default value: TRUE

### The `"show-sender-photo"` property

      "show-sender-photo"        gboolean              : Read / Write / Construct

Default value: FALSE

### The `"text-color"` property

      "text-color"               GdkColor*             : Read / Write

## Signal Details

### The `"need-redraw"` signal

    void                user_function                      (EMailFormatter *emailformatter,
                                                            gpointer        user_data)           : Run First