Revert "Remove plaintext_file member of struct MsgInfo."
[claws.git] / src / procmsg.h
index 264dd4031d37282b3a545aad67ac95306fca408b..5152c05bff69cee48272a26e51b0cf40c1a1a687 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 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 <time.h>
 #include <sys/types.h>
 #include <string.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 "utils.h"
+#include "proctypes.h"
 
 #define MSG_NEW                        (1U << 0)
 #define MSG_UNREAD             (1U << 1)
@@ -47,7 +38,6 @@ typedef GSList MsgNumberList;
 #define MSG_DELETED            (1U << 3)
 #define MSG_REPLIED            (1U << 4)
 #define MSG_FORWARDED          (1U << 5)
-#define MSG_POSTFILTERED       (1U << 14)
 
 #define MSG_CLABEL_SBIT        (6)             /* start bit of color label */
 /* color labels use 4 bits: 6, 7, 8, 9; bit weight is 7<8<9<6,
@@ -86,13 +76,15 @@ typedef GSList MsgNumberList;
 #define MSG_LOCKED             (1U << 11)   /* msg is locked  */
 #define MSG_RETRCPT_SENT       (1U << 12)   /* new one */ 
 #define MSG_SPAM               (1U << 13)   /* new one */ 
-                                               
+#define MSG_POSTFILTERED       (1U << 14)
+#define MSG_WATCH_THREAD       (1U << 15)   /* watch threads */
+#define MSG_FULLY_CACHED       (1U << 16)   /* IMAP: fully cached */
+#define MSG_RETRCPT_GOT                (1U << 17)   /* got return receipt */
+       
 /* RESERVED */
 #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)              
@@ -106,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); }
@@ -154,11 +144,13 @@ typedef guint32 MsgTmpFlags;
 #define MSG_IS_SCANNED(msg)            (((msg).tmp_flags & MSG_SCANNED) != 0)
 
 /* Claws related flags */
-#define MSG_IS_REALLY_DELETED(msg)     (((msg).perm_flags & MSG_REALLY_DELETED) != 0)
 #define MSG_IS_IGNORE_THREAD(msg)      (((msg).perm_flags & MSG_IGNORE_THREAD) != 0)
 #define MSG_IS_RETRCPT_PENDING(msg)    (((msg).perm_flags & MSG_RETRCPT_PENDING) != 0)
 #define MSG_IS_RETRCPT_SENT(msg)       (((msg).perm_flags & MSG_RETRCPT_SENT) != 0)
+#define MSG_IS_RETRCPT_GOT(msg)                (((msg).perm_flags & MSG_RETRCPT_GOT) != 0)
 #define MSG_IS_SPAM(msg)               (((msg).perm_flags & MSG_SPAM) != 0)
+#define MSG_IS_WATCH_THREAD(msg)       (((msg).perm_flags & MSG_WATCH_THREAD) != 0)
+#define MSG_IS_FULLY_CACHED(msg)       (((msg).perm_flags & MSG_FULLY_CACHED) != 0)
 
 #define MSGINFO_UPDATE_HOOKLIST "msginfo_update"
 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"
@@ -170,7 +162,7 @@ typedef enum {
        MSGINFO_UPDATE_DELETED = 1 << 1
 } MsgInfoUpdateFlags;
 
-#include "procmime.h"
+#include "prefs_account.h"
 #include "prefs_filtering.h"
 #include "folder.h"
 
@@ -180,6 +172,13 @@ struct _MsgFlags
        MsgTmpFlags  tmp_flags;
 };
 
+typedef enum {
+       IS_NOTHING = 0,
+       IS_MOVE,
+       IS_COPY,
+       IS_DELE
+} FiltOp;
+
 /* *********************************************************** *
  * WARNING: When adding or removing members to this structure, *
  * be sure to update procmsg.c::procmsg_msginfo_memusage()  to *
@@ -192,7 +191,7 @@ struct _MsgInfo
        guint refcnt;
 
        guint  msgnum;
-       off_t  size;
+       goffset  size;
        time_t mtime;
        time_t date_t;
        time_t thread_date;
@@ -215,8 +214,7 @@ struct _MsgInfo
        FolderItem *to_folder;
 
        FolderItem *to_filter_folder;   
-       gboolean is_move;
-       gboolean is_copy;
+       FiltOp filter_op;
 
        GSList *references;
        gchar *fromspace;
@@ -232,6 +230,7 @@ struct _MsgInfo
        gint total_size;
        gint planned_download;
 
+       /* list of tags ids */
        GSList *tags;
 
        MsgInfoExtraData *extradata;
@@ -239,12 +238,13 @@ struct _MsgInfo
 
 struct _MsgInfoExtraData
 {
-       gchar *xface;
-       gchar *face;
+       GSList *avatars;
 
        gchar *dispositionnotificationto;
        gchar *returnreceiptto;
 
+       gchar *resent_from;
+
        /* used only for partially received messages */
        gchar *partial_recv;
        gchar *account_server;
@@ -259,6 +259,12 @@ struct _MsgInfoExtraData
        gchar *list_owner;
 };
 
+struct _MsgInfoAvatar
+{
+       gint avatar_id;
+       gchar *avatar_src;
+};
+
 struct _MsgFileInfo
 {
        MsgInfo *msginfo;
@@ -280,9 +286,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,
@@ -317,17 +331,26 @@ void      procmsg_empty_all_trash         (void);
 gint   procmsg_send_queue              (FolderItem     *queue,
                                         gboolean        save_msgs,
                                         gchar          **errstr);
+gboolean procmsg_queue_lock            (gchar          **errstr);
+void     procmsg_queue_unlock          (void);
 gboolean procmsg_queue_is_empty        (FolderItem *queue);
-void   procmsg_print_message           (MsgInfo        *msginfo,
-                                        const gchar    *cmdline);
 
 MsgInfo *procmsg_msginfo_new           ();
 MsgInfo *procmsg_msginfo_new_ref       (MsgInfo        *msginfo);
 MsgInfo *procmsg_msginfo_copy          (MsgInfo        *msginfo);
 MsgInfo *procmsg_msginfo_get_full_info (MsgInfo        *msginfo);
+MsgInfo *procmsg_msginfo_get_full_info_from_file
+                                       (MsgInfo *msginfo, 
+                                       const gchar *file);
 void    procmsg_msginfo_free           (MsgInfo        *msginfo);
 guint   procmsg_msginfo_memusage       (MsgInfo        *msginfo);
 
+gint procmsg_send_message_queue_with_lock(const gchar *file,
+                                         gchar **errstr,
+                                         FolderItem *queue,
+                                         gint msgnum,
+                                         gboolean *queued_removed);
+
 gint procmsg_send_message_queue                (const gchar *file,
                                         gchar **errstr,
                                         FolderItem *queue, 
@@ -348,6 +371,8 @@ void procmsg_msginfo_change_flags   (MsgInfo *msginfo,
 gint procmsg_remove_special_headers    (const gchar    *in, 
                                         const gchar    *out);
 
+gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
+                           gboolean is_queued);
 gboolean procmsg_msg_has_flagged_parent        (MsgInfo        *info,
                                         MsgPermFlags    perm_flags);
 gboolean procmsg_msg_has_marked_parent (MsgInfo        *info);
@@ -375,4 +400,10 @@ gboolean procmsg_is_sending(void);
 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__ */