New hooklist to collect avatar data from headers
[claws.git] / src / procmsg.h
index 859d1c56e503734d5673afd266bcc1d26c2a500d..52b04c0652b5a90b62a0d03a29d136f67b25fa4f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 #define __PROCMSG_H__
 
 #ifdef HAVE_CONFIG_H
-#  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
 #include <sys/types.h>
 #include <string.h>
 #include "utils.h"
-
-typedef struct _MsgInfo                        MsgInfo;
-typedef struct _MsgFlags               MsgFlags;
-typedef struct _MsgFileInfo            MsgFileInfo;
-typedef struct _MsgInfoUpdate          MsgInfoUpdate;
-typedef struct _MailFilteringData      MailFilteringData;
-
-typedef struct _MsgInfoExtraData       MsgInfoExtraData;
-
-typedef GSList MsgInfoList;
-typedef GSList MsgNumberList;
+#include "proctypes.h"
 
 #define MSG_NEW                        (1U << 0)
 #define MSG_UNREAD             (1U << 1)
@@ -95,8 +85,6 @@ typedef GSList MsgNumberList;
 #define        MSG_RESERVED_CLAWS      (1U << 30)   /* for claws-mail */
 #define        MSG_RESERVED            (1U << 31)
 
-typedef guint32 MsgPermFlags;
-
 #define MSG_MOVE               (1U << 0)
 #define MSG_COPY               (1U << 1)
 #define MSG_MOVE_DONE          (1U << 15)              
@@ -110,8 +98,6 @@ typedef guint32 MsgPermFlags;
 #define MSG_HAS_ATTACHMENT     (1U << 30)
 #define MSG_SCANNED            (1U << 31)
 
-typedef guint32 MsgTmpFlags;
-
 #define MSG_CACHED_FLAG_MASK   (MSG_MULTIPART | MSG_ENCRYPTED | MSG_SIGNED | MSG_HAS_ATTACHMENT | MSG_SCANNED)
 
 #define MSG_SET_FLAGS(msg, flags)      { (msg) |= (flags); }
@@ -174,11 +160,10 @@ typedef guint32 MsgTmpFlags;
 
 typedef enum {
        MSGINFO_UPDATE_FLAGS = 1 << 0,
-       MSGINFO_UPDATE_DELETED = 1 << 1,
-       MSGINFO_UPDATE_ADDED = 1 << 2
+       MSGINFO_UPDATE_DELETED = 1 << 1
 } MsgInfoUpdateFlags;
 
-#include "procmime.h"
+#include "prefs_account.h"
 #include "prefs_filtering.h"
 #include "folder.h"
 
@@ -246,6 +231,7 @@ struct _MsgInfo
        gint total_size;
        gint planned_download;
 
+       /* list of tags ids */
        GSList *tags;
 
        MsgInfoExtraData *extradata;
@@ -253,8 +239,7 @@ struct _MsgInfo
 
 struct _MsgInfoExtraData
 {
-       gchar *xface;
-       gchar *face;
+       GSList *avatars;
 
        gchar *dispositionnotificationto;
        gchar *returnreceiptto;
@@ -273,6 +258,12 @@ struct _MsgInfoExtraData
        gchar *list_owner;
 };
 
+struct _MsgInfoAvatar
+{
+       gint avatar_id;
+       gchar *avatar_src;
+};
+
 struct _MsgFileInfo
 {
        MsgInfo *msginfo;
@@ -294,9 +285,17 @@ struct _MailFilteringData
        PrefsAccount *account;
 };
 
+struct _AvatarCaptureData
+{
+       MsgInfo *msginfo;
+       const gchar *header;
+       const gchar *content;
+};
+
 GSList *procmsg_read_cache             (FolderItem     *item,
                                         gboolean        scan_file);
-void   procmsg_msg_list_free           (GSList         *mlist);
+void   procmsg_msg_list_free           (MsgInfoList    *mlist);
+MsgNumberList *procmsg_get_number_list_for_msgs(MsgInfoList *msglist);
 void   procmsg_get_mark_sum            (const gchar    *folder,
                                         gint           *new_msgs,
                                         gint           *unread_msgs,
@@ -401,4 +400,9 @@ gchar *procmsg_msginfo_get_tags_str(MsgInfo *msginfo);
 void procmsg_msginfo_update_tags(MsgInfo *msginfo, gboolean set, gint id);
 void procmsg_msginfo_clear_tags(MsgInfo *msginfo);
 void procmsg_msginfo_commit_tags(GSList *msglist);
+MsgInfo *procmsg_get_msginfo_from_identifier(const gchar *id);
+gchar *procmsg_msginfo_get_identifier(MsgInfo *msginfo);
+
+gchar *procmsg_msginfo_get_avatar(MsgInfo *msginfo, gint type);
+void procmsg_msginfo_add_avatar(MsgInfo *msginfo, gint type, const gchar *data);
 #endif /* __PROCMSG_H__ */