2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999,2000 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #include <sys/types.h>
29 typedef struct _MsgInfo MsgInfo;
35 /* permanent flags (0x0000ffff) */
41 MSG_FORWARDED = 1 << 5,
43 /* temporary flags (0xffff0000) */
49 MSG_ENCRYPTED = 1 << 27,
56 #define MSG_PERMANENT_FLAG_MASK (MSG_NEW | \
62 #define MSG_CACHED_FLAG_MASK (MSG_MIME)
64 #define MSG_SET_FLAGS(msg, flags) { (msg) |= (flags); }
65 #define MSG_UNSET_FLAGS(msg, flags) { (msg) &= ~(flags); }
66 #define MSG_IS_NEW(msg) ((msg & MSG_NEW) != 0)
67 #define MSG_IS_UNREAD(msg) ((msg & MSG_UNREAD) != 0)
68 #define MSG_IS_MARKED(msg) ((msg & MSG_MARKED) != 0)
69 #define MSG_IS_DELETED(msg) ((msg & MSG_DELETED) != 0)
70 #define MSG_IS_REPLIED(msg) ((msg & MSG_REPLIED) != 0)
71 #define MSG_IS_FORWARDED(msg) ((msg & MSG_FORWARDED) != 0)
73 #define MSG_IS_MOVE(msg) ((msg & MSG_MOVE) != 0)
74 #define MSG_IS_COPY(msg) ((msg & MSG_COPY) != 0)
76 #define MSG_IS_QUEUED(msg) ((msg & MSG_QUEUED) != 0)
77 #define MSG_IS_DRAFT(msg) ((msg & MSG_DRAFT) != 0)
78 #define MSG_IS_ENCRYPTED(msg) ((msg & MSG_ENCRYPTED) != 0)
79 #define MSG_IS_IMAP(msg) ((msg & MSG_IMAP) != 0)
80 #define MSG_IS_MIME(msg) ((msg & MSG_MIME) != 0)
81 #define MSG_IS_NEWS(msg) ((msg & MSG_NEWS) != 0)
82 #define MSG_IS_CACHED(msg) ((msg & MSG_CACHED) != 0)
84 #define WRITE_CACHE_DATA_INT(n, fp) \
85 fwrite(&n, sizeof(n), 1, fp)
87 #define WRITE_CACHE_DATA(data, fp) \
91 if (data == NULL || (len = strlen(data)) == 0) { \
93 WRITE_CACHE_DATA_INT(len, fp); \
96 WRITE_CACHE_DATA_INT(len, fp); \
97 fwrite(data, len, 1, fp); \
121 FolderItem *to_folder;
125 gchar *dispositionnotificationto;
126 gchar *returnreceiptto;
133 /* used only for encrypted messages */
134 gchar *plaintext_file;
135 guint decryption_failed : 1;
138 GHashTable *procmsg_msg_hash_table_create (GSList *mlist);
139 void procmsg_msg_hash_table_append (GHashTable *msg_table,
141 GHashTable *procmsg_to_folder_hash_table_create (GSList *mlist);
143 GSList *procmsg_read_cache (FolderItem *item,
145 void procmsg_set_flags (GSList *mlist,
147 gint procmsg_get_last_num_in_cache (GSList *mlist);
148 void procmsg_write_cache (MsgInfo *msginfo,
150 void procmsg_write_flags (MsgInfo *msginfo,
152 void procmsg_get_mark_sum (const gchar *folder,
156 FILE *procmsg_open_mark_file (const gchar *folder,
159 void procmsg_move_messages (GSList *mlist);
160 void procmsg_copy_messages (GSList *mlist);
162 gchar *procmsg_get_message_file_path (MsgInfo *msginfo);
163 gchar *procmsg_get_message_file (MsgInfo *msginfo);
164 FILE *procmsg_open_message (MsgInfo *msginfo);
165 gboolean procmsg_msg_exist (MsgInfo *msginfo);
167 void procmsg_empty_trash (void);
168 gint procmsg_send_queue (void);
169 void procmsg_print_message (MsgInfo *msginfo,
170 const gchar *cmdline);
172 MsgInfo *procmsg_msginfo_copy (MsgInfo *msginfo);
173 void procmsg_msginfo_free (MsgInfo *msginfo);
175 gint procmsg_cmp_msgnum_for_sort (gconstpointer a,
178 #endif /* __PROCMSG_H__ */