2005-09-14 [paul] 1.9.14cvs26
[claws.git] / src / procmsg.h
index 650b82d6f6162d1ce51f99d5670a584ecf22c9ef..671f7181e7a67d1ae4ae8c839bbe80e7258c28ba 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 Hiroyuki Yamamoto
  *
  * 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
@@ -45,7 +45,9 @@ typedef GSList MsgNumberList;
 #define MSG_DELETED            (1U << 3)
 #define MSG_REPLIED            (1U << 4)
 #define MSG_FORWARDED          (1U << 5)
+#if 0
 #define MSG_REALLY_DELETED     (1U << 6)               /* mbox stuff */
+#endif
 
 #define MSG_CLABEL_SBIT        (7)             /* start bit of color label */
 #define MAKE_MSG_CLABEL(h, m, l)       (((h) << (MSG_CLABEL_SBIT + 2)) | \
@@ -89,12 +91,13 @@ typedef guint32 MsgPermFlags;
 #define MSG_IMAP               (1U << 19)
 #define MSG_NEWS               (1U << 20)
 #define MSG_SIGNED             (1U << 21)
-#define MSG_MIME               (1U << 29)
-#define MSG_CACHED             (1U << 31)
+#define MSG_MULTIPART          (1U << 29)
+#define MSG_HAS_ATTACHMENT     (1U << 30)
+#define MSG_SCANNED            (1U << 31)
 
 typedef guint32 MsgTmpFlags;
 
-#define MSG_CACHED_FLAG_MASK   (MSG_MIME | MSG_ENCRYPTED | MSG_SIGNED)
+#define MSG_CACHED_FLAG_MASK   (MSG_MULTIPART | MSG_ENCRYPTED | MSG_SIGNED | MSG_HAS_ATTACHMENT | MSG_SCANNED)
 
 #define MSG_SET_FLAGS(msg, flags)      { (msg) |= (flags); }
 #define MSG_UNSET_FLAGS(msg, flags)    { (msg) &= ~(flags); }
@@ -132,8 +135,9 @@ typedef guint32 MsgTmpFlags;
 #define MSG_IS_SIGNED(msg)             (((msg).tmp_flags & MSG_SIGNED) != 0)
 #define MSG_IS_IMAP(msg)               (((msg).tmp_flags & MSG_IMAP) != 0)
 #define MSG_IS_NEWS(msg)               (((msg).tmp_flags & MSG_NEWS) != 0)
-#define MSG_IS_MIME(msg)               (((msg).tmp_flags & MSG_MIME) != 0)
-#define MSG_IS_CACHED(msg)             (((msg).tmp_flags & MSG_CACHED) != 0)
+#define MSG_IS_MULTIPART(msg)          (((msg).tmp_flags & MSG_MULTIPART) != 0)
+#define MSG_IS_WITH_ATTACHMENT(msg)    (((msg).tmp_flags & MSG_HAS_ATTACHMENT) != 0)
+#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)
@@ -143,10 +147,16 @@ typedef guint32 MsgTmpFlags;
 
 #define MSGINFO_UPDATE_HOOKLIST "msginfo_update"
 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"
+#define MAIL_POSTFILTERING_HOOKLIST "mail_postfiltering_hooklist"
+
+typedef enum {
+       MSGINFO_UPDATE_FLAGS = 1 << 0,
+       MSGINFO_UPDATE_DELETED = 1 << 1
+} MsgInfoUpdateFlags;
 
-#include "folder.h"
 #include "procmime.h"
 #include "prefs_filtering.h"
+#include "folder.h"
 
 struct _MsgFlags
 {
@@ -186,7 +196,7 @@ struct _MsgInfo
        gchar *dispositionnotificationto;
        gchar *returnreceiptto;
 
-       gchar *references;
+       GSList *references;
        gchar *fromspace;
 
        gint score;
@@ -194,7 +204,15 @@ struct _MsgInfo
 
        /* used only for encrypted messages */
        gchar *plaintext_file;
-       guint decryption_failed : 1;
+        
+        gint hidden;
+       
+       /* used only for partially received messages */
+       gchar *partial_recv;
+       gint total_size;
+       gchar *account_server;
+       gchar *account_login;
+       gint planned_download;
 };
 
 struct _MsgFileInfo
@@ -206,6 +224,7 @@ struct _MsgFileInfo
 
 struct _MsgInfoUpdate {
        MsgInfo *msginfo;
+       MsgInfoUpdateFlags flags;
 };
 
 struct _MailFilteringData
@@ -232,18 +251,18 @@ void      procmsg_get_mark_sum            (const gchar    *folder,
 
 GNode  *procmsg_get_thread_tree                (GSList         *mlist);
 
-void   procmsg_move_messages           (GSList         *mlist);
+gint   procmsg_move_messages           (GSList         *mlist);
 void   procmsg_copy_messages           (GSList         *mlist);
 
+/* return path is locale charset */
 gchar  *procmsg_get_message_file_path  (MsgInfo        *msginfo);
 gchar  *procmsg_get_message_file       (MsgInfo        *msginfo);
+gchar  *procmsg_get_message_file_full  (MsgInfo        *msginfo, 
+                                        gboolean        get_headers,
+                                        gboolean        get_body);
 GSList *procmsg_get_message_file_list  (MsgInfoList    *mlist);
 void   procmsg_message_file_list_free  (MsgInfoList    *file_list);
 FILE   *procmsg_open_message           (MsgInfo        *msginfo);
-#if USE_GPGME
-FILE   *procmsg_open_message_decrypted (MsgInfo        *msginfo,
-                                        MimeInfo      **mimeinfo);
-#endif
 gboolean procmsg_msg_exist             (MsgInfo        *msginfo);
 
 void   procmsg_get_filter_keyword      (MsgInfo          *msginfo,
@@ -251,9 +270,12 @@ void       procmsg_get_filter_keyword      (MsgInfo          *msginfo,
                                         gchar           **key,
                                         PrefsFilterType   type);
 
-void   procmsg_empty_trash             (void);
+void   procmsg_empty_trash             (FolderItem     *trash);
+void   procmsg_empty_all_trash         (void);
+
 gint   procmsg_send_queue              (FolderItem     *queue,
                                         gboolean        save_msgs);
+gboolean procmsg_queue_is_empty        (FolderItem *queue);
 gint   procmsg_save_to_outbox          (FolderItem     *outbox,
                                         const gchar    *file,
                                         gboolean        is_queued);
@@ -273,10 +295,15 @@ gint procmsg_send_message_queue           (const gchar *file);
 
 void procmsg_msginfo_set_flags         (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,
-                                         MsgTmpFlags tmp_flags);
+                                        MsgTmpFlags tmp_flags);
 void procmsg_msginfo_unset_flags       (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,
-                                         MsgTmpFlags tmp_flags);
+                                        MsgTmpFlags tmp_flags);
+void procmsg_msginfo_change_flags      (MsgInfo *msginfo, 
+                                        MsgPermFlags add_perm_flags, 
+                                        MsgTmpFlags add_tmp_flags,
+                                        MsgPermFlags rem_perm_flags, 
+                                        MsgTmpFlags rem_tmp_flags);
 gint procmsg_remove_special_headers    (const gchar    *in, 
                                         const gchar    *out);
 
@@ -289,5 +316,8 @@ void procmsg_update_unread_children (MsgInfo        *info,
 void procmsg_msginfo_set_to_folder     (MsgInfo        *msginfo,
                                         FolderItem     *to_folder);
 gboolean procmsg_msginfo_filter                (MsgInfo        *msginfo);
+MsgInfo *procmsg_msginfo_new_from_mimeinfo
+                                       (MsgInfo        *src_msginfo, 
+                                        MimeInfo       *mimeinfo);
 
 #endif /* __PROCMSG_H__ */