2006-08-11 [colin] 2.4.0cvs41
[claws.git] / src / procmsg.h
index bd89894c43f378c1c8b006458b7076c0acff814b..761b175bcda431675e02e98cc65a56f570f4f977 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws 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
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifndef __PROCMSG_H__
@@ -45,9 +45,7 @@ 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_POSTFILTERED       (1U << 14)
 
 #define MSG_CLABEL_SBIT        (7)             /* start bit of color label */
 #define MAKE_MSG_CLABEL(h, m, l)       (((h) << (MSG_CLABEL_SBIT + 2)) | \
@@ -74,6 +72,7 @@ typedef GSList MsgNumberList;
 #define MSG_IGNORE_THREAD      (1U << 10)   /* ignore threads */
 #define MSG_LOCKED             (1U << 11)   /* msg is locked  */
 #define MSG_RETRCPT_SENT       (1U << 12)   /* new one */ 
+#define MSG_SPAM               (1U << 13)   /* new one */ 
                                                
 /* RESERVED */
 #define        MSG_RESERVED_CLAWS      (1U << 30)   /* for sylpheed-claws */
@@ -117,6 +116,7 @@ typedef guint32 MsgTmpFlags;
 #define MSG_IS_REPLIED(msg)            (((msg).perm_flags & MSG_REPLIED) != 0)
 #define MSG_IS_LOCKED(msg)             (((msg).perm_flags & MSG_LOCKED) != 0)
 #define MSG_IS_FORWARDED(msg)          (((msg).perm_flags & MSG_FORWARDED) != 0)
+#define MSG_IS_POSTFILTERED(msg)       (((msg).perm_flags & MSG_POSTFILTERED) != 0)
 
 #define MSG_GET_COLORLABEL(msg)                (((msg).perm_flags & MSG_CLABEL_FLAG_MASK))
 #define MSG_GET_COLORLABEL_VALUE(msg)  (MSG_GET_COLORLABEL(msg) >> MSG_CLABEL_SBIT)
@@ -144,6 +144,7 @@ typedef guint32 MsgTmpFlags;
 #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_SPAM(msg)               (((msg).perm_flags & MSG_SPAM) != 0)
 
 #define MSGINFO_UPDATE_HOOKLIST "msginfo_update"
 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"
@@ -151,7 +152,7 @@ typedef guint32 MsgTmpFlags;
 
 typedef enum {
        MSGINFO_UPDATE_FLAGS = 1 << 0,
-       MSGINFO_UPDATE_DELETED = 1 << 1,
+       MSGINFO_UPDATE_DELETED = 1 << 1
 } MsgInfoUpdateFlags;
 
 #include "procmime.h"
@@ -191,7 +192,12 @@ struct _MsgInfo
        FolderItem *folder;
        FolderItem *to_folder;
 
+       FolderItem *to_filter_folder;   
+       gboolean is_move;
+       gboolean is_copy;
+
        gchar *xface;
+       gchar *face;
 
        gchar *dispositionnotificationto;
        gchar *returnreceiptto;
@@ -200,7 +206,6 @@ struct _MsgInfo
        gchar *fromspace;
 
        gint score;
-       gint threadscore;
 
        /* used only for encrypted messages */
        gchar *plaintext_file;
@@ -213,6 +218,14 @@ struct _MsgInfo
        gchar *account_server;
        gchar *account_login;
        gint planned_download;
+
+       /* Mailing list support */
+       gchar *list_post;
+       gchar *list_subscribe;
+       gchar *list_unsubscribe;
+       gchar *list_help;
+       gchar *list_archive;
+       gchar *list_owner;
 };
 
 struct _MsgFileInfo
@@ -274,7 +287,8 @@ void        procmsg_empty_trash             (FolderItem     *trash);
 void   procmsg_empty_all_trash         (void);
 
 gint   procmsg_send_queue              (FolderItem     *queue,
-                                        gboolean        save_msgs);
+                                        gboolean        save_msgs,
+                                        gchar          **errstr);
 gboolean procmsg_queue_is_empty        (FolderItem *queue);
 gint   procmsg_save_to_outbox          (FolderItem     *outbox,
                                         const gchar    *file,
@@ -291,7 +305,8 @@ guint        procmsg_msginfo_memusage       (MsgInfo        *msginfo);
 
 gint procmsg_cmp_msgnum_for_sort       (gconstpointer   a,
                                         gconstpointer   b);
-gint procmsg_send_message_queue                (const gchar *file);
+gint procmsg_send_message_queue                (const gchar *file,
+                                        gchar **errstr);
 
 void procmsg_msginfo_set_flags         (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,
@@ -315,9 +330,19 @@ void procmsg_update_unread_children        (MsgInfo        *info,
                                         gboolean        newly_marked);
 void procmsg_msginfo_set_to_folder     (MsgInfo        *msginfo,
                                         FolderItem     *to_folder);
-gboolean procmsg_msginfo_filter                (MsgInfo        *msginfo);
+gboolean procmsg_msginfo_filter                (MsgInfo                *msginfo,
+                                                                        PrefsAccount   *ac_prefs);
 MsgInfo *procmsg_msginfo_new_from_mimeinfo
                                        (MsgInfo        *src_msginfo, 
                                         MimeInfo       *mimeinfo);
 
+void procmsg_register_spam_learner (int (*learn_func)(MsgInfo *info, GSList *list, gboolean spam));
+void procmsg_unregister_spam_learner (int (*learn_func)(MsgInfo *info, GSList *list, gboolean spam));
+gboolean procmsg_spam_can_learn                (void);
+void procmsg_spam_set_folder           (const char *item_identifier);
+FolderItem *procmsg_spam_get_folder    (void);
+int procmsg_spam_learner_learn         (MsgInfo *msginfo, GSList *msglist, gboolean spam);
+gboolean procmsg_have_queued_mails_fast (void);
+gboolean procmsg_is_sending(void);
+
 #endif /* __PROCMSG_H__ */