## EMailParser

EMailParser

## Synopsis

    struct              EMailParser;
    EMailParser *       e_mail_parser_new                   (CamelSession *session);
    EMailPartList *     e_mail_parser_parse_sync            (EMailParser *parser,
                                                             CamelFolder *folder,
                                                             const gchar *message_uid,
                                                             CamelMimeMessage *message,
                                                             GCancellable *cancellable);
    void                e_mail_parser_parse                 (EMailParser *parser,
                                                             CamelFolder *folder,
                                                             const gchar *message_uid,
                                                             CamelMimeMessage *message,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancellable,
                                                             gpointer user_data);
    EMailPartList *     e_mail_parser_parse_finish          (EMailParser *parser,
                                                             GAsyncResult *result,
                                                             GError **error);
    gboolean            e_mail_parser_parse_part            (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             GCancellable *cancellable,
                                                             GQueue *out_mail_parts);
    gboolean            e_mail_parser_parse_part_as         (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             const gchar *mime_type,
                                                             GCancellable *cancellable,
                                                             GQueue *out_mail_parts);
    void                e_mail_parser_error                 (EMailParser *parser,
                                                             GQueue *out_mail_parts,
                                                             const gchar *format,
                                                             ...);
    void                e_mail_parser_wrap_as_attachment    (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             GQueue *parts_queue);
    CamelSession *      e_mail_parser_get_session           (EMailParser *parser);
    EMailExtensionRegistry * e_mail_parser_get_extension_registry
                                                            (EMailParser *parser);

## Object Hierarchy

      GObject
       +----EMailParser

## Properties

      "session"                  CamelSession*         : Read / Write / Construct Only

## Description

## Details

### struct EMailParser

    struct EMailParser;

### e_mail_parser_new ()

    EMailParser *       e_mail_parser_new                   (CamelSession *session);

### e_mail_parser_parse_sync ()

    EMailPartList *     e_mail_parser_parse_sync            (EMailParser *parser,
                                                             CamelFolder *folder,
                                                             const gchar *message_uid,
                                                             CamelMimeMessage *message,
                                                             GCancellable *cancellable);

Parses the `message` synchronously. Returns a list of EMailPart<!-//>s which represents structure of the message and additional properties of each part.

Note that this function can block for a while, so it's not a good idea to call it from main thread.

`parser` : | an EMailParser
`folder` : | (allow none) a CamelFolder containing the `message` or `NULL`
`message_uid` : | (allow none) UID of the `message` within the `folder` or `NULL`
`message` : | a CamelMimeMessage
`cancellable` : | (allow-none) a GCancellable
Returns : | An EMailPartsList

### e_mail_parser_parse ()

    void                e_mail_parser_parse                 (EMailParser *parser,
                                                             CamelFolder *folder,
                                                             const gchar *message_uid,
                                                             CamelMimeMessage *message,
                                                             GAsyncReadyCallback callback,
                                                             GCancellable *cancellable,
                                                             gpointer user_data);

Asynchronous version of `e_mail_parser_parse_sync()`.

`parser` : | an EMailParser
`message` : | a CamelMimeMessage
`callback` : | a GAsyncReadyCallback
`cancellable` : | (allow-none) a GCancellable
`user_data` : | (allow-none) user data passed to the callback

### e_mail_parser_parse_finish ()

    EMailPartList *     e_mail_parser_parse_finish          (EMailParser *parser,
                                                             GAsyncResult *result,
                                                             GError **error);

### e_mail_parser_parse_part ()

    gboolean            e_mail_parser_parse_part            (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             GCancellable *cancellable,
                                                             GQueue *out_mail_parts);

### e_mail_parser_parse_part_as ()

    gboolean            e_mail_parser_parse_part_as         (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             const gchar *mime_type,
                                                             GCancellable *cancellable,
                                                             GQueue *out_mail_parts);

### e_mail_parser_error ()

    void                e_mail_parser_error                 (EMailParser *parser,
                                                             GQueue *out_mail_parts,
                                                             const gchar *format,
                                                             ...);

### e_mail_parser_wrap_as_attachment ()

    void                e_mail_parser_wrap_as_attachment    (EMailParser *parser,
                                                             CamelMimePart *part,
                                                             GString *part_id,
                                                             GQueue *parts_queue);

### e_mail_parser_get_session ()

    CamelSession *      e_mail_parser_get_session           (EMailParser *parser);

### e_mail_parser_get_extension_registry ()

    EMailExtensionRegistry * e_mail_parser_get_extension_registry
                                                            (EMailParser *parser);

## Property Details

### The `"session"` property

      "session"                  CamelSession*         : Read / Write / Construct Only