aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-12-05 23:49:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-12-08 03:01:04 +0800
commit4611bcd7b8958c5ffadccc8b68989c839cf3f144 (patch)
tree3bb49a586ad0c41b6d215aac868f5acfaad1c201 /em-format
parent91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8 (diff)
downloadgsoc2013-evolution-4611bcd7b8958c5ffadccc8b68989c839cf3f144.tar.gz
gsoc2013-evolution-4611bcd7b8958c5ffadccc8b68989c839cf3f144.tar.zst
gsoc2013-evolution-4611bcd7b8958c5ffadccc8b68989c839cf3f144.zip
EMailParserExtension cleanups.
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-parser-extension.c13
-rw-r--r--em-format/e-mail-parser-extension.h23
2 files changed, 24 insertions, 12 deletions
diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c
index 589fae31f7..72f1fd8445 100644
--- a/em-format/e-mail-parser-extension.c
+++ b/em-format/e-mail-parser-extension.c
@@ -25,6 +25,12 @@ G_DEFINE_INTERFACE (
e_mail_parser_extension,
E_TYPE_MAIL_EXTENSION)
+static guint32
+mail_parser_extension_get_flags (EMailParserExtension *extension)
+{
+ return 0;
+}
+
/**
* EMailParserExtension:
*
@@ -33,9 +39,9 @@ G_DEFINE_INTERFACE (
*/
static void
-e_mail_parser_extension_default_init (EMailParserExtensionInterface *iface)
+e_mail_parser_extension_default_init (EMailParserExtensionInterface *interface)
{
-
+ interface->get_flags = mail_parser_extension_get_flags;
}
/**
@@ -94,8 +100,7 @@ e_mail_parser_extension_get_flags (EMailParserExtension *extension)
g_return_val_if_fail (E_IS_MAIL_PARSER_EXTENSION (extension), 0);
interface = E_MAIL_PARSER_EXTENSION_GET_INTERFACE (extension);
- if (interface->get_flags == NULL)
- return 0;
+ g_return_val_if_fail (interface->get_flags != NULL, 0);
return interface->get_flags (extension);
}
diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h
index 0dcff76212..101c1320dc 100644
--- a/em-format/e-mail-parser-extension.h
+++ b/em-format/e-mail-parser-extension.h
@@ -50,16 +50,25 @@ G_BEGIN_DECLS
typedef struct _EMailParserExtension EMailParserExtension;
typedef struct _EMailParserExtensionInterface EMailParserExtensionInterface;
+/**
+ * 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.
+ **/
typedef enum {
- E_MAIL_PARSER_EXTENSION_INLINE = 1 << 0, /* Don't parse as attachment */
- E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION = 1 << 1, /* Always expand */
- E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE = 1 << 2 /* Always check what's inside */
+ E_MAIL_PARSER_EXTENSION_INLINE = 1 << 0,
+ E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION = 1 << 1,
+ E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE = 1 << 2
} EMailParserExtensionFlags;
struct _EMailParserExtensionInterface {
EMailExtensionInterface parent_interface;
- GSList * (*parse) (EMailParserExtension *extension,
+ GSList * (*parse) (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *mime_part,
GString *part_id,
@@ -70,14 +79,12 @@ struct _EMailParserExtensionInterface {
};
GType e_mail_parser_extension_get_type
- (void);
-
-GSList * e_mail_parser_extension_parse (EMailParserExtension *extension,
+ (void) G_GNUC_CONST;
+GSList * e_mail_parser_extension_parse (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *mime_part,
GString *part_id,
GCancellable *cancellable);
-
guint32 e_mail_parser_extension_get_flags
(EMailParserExtension *extension);