EMailParserExtension

EMailParserExtension

Synopsis

struct              EMailParserExtension;
enum                EMailParserExtensionFlags;
gboolean            e_mail_parser_extension_parse       (EMailParserExtension *extension,
                                                         EMailParser *parser,
                                                         CamelMimePart *mime_part,
                                                         GString *part_id,
                                                         GCancellable *cancellable,
                                                         GQueue *out_mail_parts);

Object Hierarchy

  GObject
   +----EMailParserExtension

Description

Details

struct EMailParserExtension

struct EMailParserExtension;

The EMailParserExtension is an abstract interface for all extensions for EMailParser.


enum EMailParserExtensionFlags

typedef enum {
 /*< flags >*/
	E_MAIL_PARSER_EXTENSION_INLINE			= 1 << 0,
	E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION = 1 << 1,
	E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE		= 1 << 2
} EMailParserExtensionFlags;

E_MAIL_PARSER_EXTENSION_INLINE

Don't parse as attachment.

E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION

Always expand.

E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE

Always check what's inside.

e_mail_parser_extension_parse ()

gboolean            e_mail_parser_extension_parse       (EMailParserExtension *extension,
                                                         EMailParser *parser,
                                                         CamelMimePart *mime_part,
                                                         GString *part_id,
                                                         GCancellable *cancellable,
                                                         GQueue *out_mail_parts);

A virtual function reimplemented in all mail parser extensions. The function decodes and parses the mime_part, appending one or more EMailPart<!-//>s to the out_mail_parts queue.

When the function is unable to parse the mime_part (either because it's broken or because it is a different MIME type then the extension is specialized for), the function will return FALSE to indicate to the EMailParser that it should pick another extension.

When the mime_part contains for example multipart/mixed of one RFC822 message with an attachment and of one image, then parser must make sure that parts are appeded to out_mail_parts in the correct order.

part1.rfc822.plain_text part1.rfc822.attachment part2.image

Implementation of this function must be thread-safe.

extension :

an EMailParserExtension

parser :

a EMailParser

mime_part :

(allow-none) a CamelMimePart to parse

part_id :

a GString to which parser will append ID of the parsed part.

cancellable :

(allow-none) A GCancellable

out_mail_parts :

a GQueue to deposit EMailPart instances

Returns :

TRUE if the mime_part was handled (even if no EMailPart<!-//>s were added to out_mail_parts), or FALSE if the mime_part was not handled