diff options
author | NotZed <NotZed@HelixCode.com> | 2000-05-02 03:47:12 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-02 03:47:12 +0800 |
commit | fed684880e2a47aaa0ee109bd8df0db1a5589c79 (patch) | |
tree | 548a551579178c78ea7f57a14e6f0d69ef57c1db /camel/camel-mime-message.h | |
parent | 0b889518d2fdfd0e296179bf581c7fbff4e5210e (diff) | |
download | gsoc2013-evolution-fed684880e2a47aaa0ee109bd8df0db1a5589c79.tar.gz gsoc2013-evolution-fed684880e2a47aaa0ee109bd8df0db1a5589c79.tar.zst gsoc2013-evolution-fed684880e2a47aaa0ee109bd8df0db1a5589c79.zip |
More message cleanup. Flags now work, are saved, and the delete
flag causes an expunge to expunge the deleted messages.
2000-05-01 NotZed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-summary.c
(camel_mbox_summary_set_flags_by_uid): New function to update the
flags in the summary.
(camel_mbox_summary_expunge): Expunge messages from a folder.
(offset_content): Re-align offsets of summary when messages
added/removed to an existing summary.
(camel_mbox_summary_remove_uid): Remove a message summary entry by
uid.
(index_folder): Restore flags from X-Evolution header, if they are set.
* providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
Connect to the message_changed signal.
(_init): Set permanent flags to something reasonable. No user
flags yet ...
(message_changed): If the flags of the message change, update the
flags in the summary.
(mbox_expunge): Implement the expunge.
(camel_mbox_folder_class_init): Renamed all leading _'s to mbox_'s
* camel-folder.c (_finalize): Uh, dont free permanent_flags
anymore (this wouldn't failed anyway, it was a GList !!!)
* camel-folder.h (struct _CamelFolder): Change permanent_flags to
a bitfield.
(list_permanent_flags): Renamed to get_permanent_flags, and
returns a bitfield.
(camel_folder_expunge): Changed expunge to a void type. The
messages would no longer be useful after they have been removed
...
* camel-mime-message.c (set_flag): Removed.
(camel_mime_message_set_flag): Removed.
(get_flag): Removed.
(camel_mime_message_get_flag): Removed.
(add_flag_to_list): Removed.
(get_flag_list): Removed.
(camel_mime_message_get_flag_list): Removed.
(camel_mime_message_get_flags): New interface to get system flags.
(camel_mime_message_set_flags): " to set ".
(camel_mime_message_get_user_flag): To get a user flag.
(camel_mime_message_set_user_flag): To set a user flag.
(finalize): Hmm, the old one free'd the key and data, not good
when the data is a boolean ...
svn path=/trunk/; revision=2716
Diffstat (limited to 'camel/camel-mime-message.h')
-rw-r--r-- | camel/camel-mime-message.h | 74 |
1 files changed, 30 insertions, 44 deletions
diff --git a/camel/camel-mime-message.h b/camel/camel-mime-message.h index 141747e3cb..c790138f70 100644 --- a/camel/camel-mime-message.h +++ b/camel/camel-mime-message.h @@ -1,10 +1,8 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* camelMimeMessage.h : class for a mime message */ - -/* +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */ +/* camelMimeMessage.h : class for a mime message * - * Author : - * Bertrand Guiheneuf <bertrand@helixcode.com> + * Authors: Bertrand Guiheneuf <bertrand@helixcode.com> + * Michael Zucchi <notzed@helixcode.com> * * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com) * @@ -54,6 +52,18 @@ extern "C" { /* specify local time */ #define CAMEL_MESSAGE_DATE_CURRENT (~0) +/* system flag bits */ +enum _CamelMessageFlags { + CAMEL_MESSAGE_ANSWERED = 1<<0, + CAMEL_MESSAGE_DELETED = 1<<1, + CAMEL_MESSAGE_DRAFT = 1<<2, + CAMEL_MESSAGE_FLAGGED = 1<<3, + CAMEL_MESSAGE_SEEN = 1<<4, + /* following flags are for the folder, and are not really permanent flags */ + CAMEL_MESSAGE_FOLDER_FLAGGED = 1<<16, /* for use by the folder implementation */ + CAMEL_MESSAGE_USER = 1<<31 /* supports user flags */ +}; + struct _CamelMimeMessage { CamelMimePart parent_object; @@ -71,49 +81,28 @@ struct _CamelMimeMessage GHashTable *recipients; /* hash table of CamelInternetAddress's */ /* other fields */ - GHashTable *flags; /* boolean values */ + guint32 flags; /* system flags */ + GHashTable *user_flags; /* if present, then true */ gboolean expunged; guint message_number; /* set by folder object when retrieving message */ gchar *message_uid; CamelFolder *folder; - }; - +enum _MessageChangeType { + MESSAGE_FLAGS_CHANGED, + MESSAGE_ENVELOPE_CHANGED, +}; typedef struct { CamelMimePartClass parent_class; - + + /* signals */ + void (*message_changed) (CamelMimeMessage *, enum _MessageChangeType type); + /* Virtual methods */ - void (*set_received_date) (CamelMimeMessage *mime_message, - const gchar *received_date); - const gchar * (*get_received_date) (CamelMimeMessage *mime_message); - const gchar * (*get_sent_date) (CamelMimeMessage *mime_message); - void (*set_reply_to) (CamelMimeMessage *mime_message, - const gchar *reply_to); - const gchar * (*get_reply_to) (CamelMimeMessage *mime_message); - void (*set_subject) (CamelMimeMessage *mime_message, - const gchar *subject); - const gchar * (*get_subject) (CamelMimeMessage *mime_message); - void (*set_from) (CamelMimeMessage *mime_message, - const gchar *from); - const gchar * (*get_from) (CamelMimeMessage *mime_message); - void (*add_recipient) (CamelMimeMessage *mime_message, - const gchar *recipient_type, - const gchar *recipient); - void (*remove_recipient) (CamelMimeMessage *mime_message, - const gchar *recipient_type, - const gchar *recipient); - const GList * (*get_recipients) (CamelMimeMessage *mime_message, - const gchar *recipient_type); - void (*set_flag) (CamelMimeMessage *mime_message, - const gchar *flag, - gboolean value); - gboolean (*get_flag) (CamelMimeMessage *mime_message, - const gchar *flag); - GList * (*get_flag_list) (CamelMimeMessage *mime_message); void (*set_message_number) (CamelMimeMessage *mime_message, guint number); guint (*get_message_number) (CamelMimeMessage *mime_message); @@ -157,13 +146,10 @@ void camel_mime_message_remove_recipient_name (CamelMimeMessage *mime_message, const CamelInternetAddress *camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const char *type); - -void camel_mime_message_set_flag (CamelMimeMessage *mime_message, - const gchar *flag, - gboolean value); -gboolean camel_mime_message_get_flag (CamelMimeMessage *mime_message, - const gchar *flag); -GList * camel_mime_message_get_flag_list (CamelMimeMessage *mime_message); +guint32 camel_mime_message_get_flags (CamelMimeMessage *m); +void camel_mime_message_set_flags (CamelMimeMessage *m, guint32 flags, guint32 set); +gboolean camel_mime_message_get_user_flag (CamelMimeMessage *m, const char *name); +void camel_mime_message_set_user_flag (CamelMimeMessage *m, const char *name, gboolean value); guint camel_mime_message_get_message_number (CamelMimeMessage *mime_message); |