Top |
Functions
Description
CamelIMAPXMailbox models the current state of an IMAP mailbox as accumulated from untagged IMAP server responses in the current session.
In particular, a CamelIMAPXMailbox should not be populated with locally cached information from the previous session. This is why instantiation requires a CamelIMAPXListResponse.
Functions
camel_imapx_mailbox_new ()
CamelIMAPXMailbox * camel_imapx_mailbox_new (CamelIMAPXListResponse *response
,CamelIMAPXNamespace *namespace_
);
Creates a new CamelIMAPXMailbox from response
and namespace
.
The mailbox's name, path separator character, and attribute set are initialized from the CamelIMAPXListResponse.
Since: 3.12
camel_imapx_mailbox_clone ()
CamelIMAPXMailbox * camel_imapx_mailbox_clone (CamelIMAPXMailbox *mailbox
,const gchar *new_mailbox_name
);
Creates an identical copy of mailbox
, except for the mailbox name.
The copied CamelIMAPXMailbox is given the name new_mailbox_name
.
The new_mailbox_name
must be in the same IMAP namespace as mailbox
.
This is primarily useful for handling mailbox renames. It is safer to create a new CamelIMAPXMailbox instance with the new name than to try and rename an existing CamelIMAPXMailbox, which could disrupt mailbox operations in progress as well as data structures that track mailboxes by name.
Since: 3.12
camel_imapx_mailbox_get_state ()
CamelIMAPXMailboxState
camel_imapx_mailbox_get_state (CamelIMAPXMailbox *mailbox
);
Returns current state of the mailbox. This is used for folder structure updates, to identify newly created, updated, renamed or removed mailboxes.
Since: 3.16
camel_imapx_mailbox_set_state ()
void camel_imapx_mailbox_set_state (CamelIMAPXMailbox *mailbox
,CamelIMAPXMailboxState state
);
Sets current (update) state of the mailbox. This is used for folder structure updates, to identify newly created, updated, renamed or removed mailboxes.
Since: 3.16
camel_imapx_mailbox_exists ()
gboolean
camel_imapx_mailbox_exists (CamelIMAPXMailbox *mailbox
);
Convenience function returns whether mailbox
exists; that is, whether it
lacks a CAMEL_IMAPX_LIST_ATTR_NONEXISTENT attribute.
Non-existent mailboxes should generally be disregarded.
Since: 3.12
camel_imapx_mailbox_compare ()
gint camel_imapx_mailbox_compare (CamelIMAPXMailbox *mailbox_a
,CamelIMAPXMailbox *mailbox_b
);
Compares two CamelIMAPXMailbox instances by their mailbox names.
Returns
a negative value if mailbox_a
compares before mailbox_b
,
zero if they compare equal, or a positive value if mailbox_a
compares after mailbox_b
Since: 3.12
camel_imapx_mailbox_matches ()
gboolean camel_imapx_mailbox_matches (CamelIMAPXMailbox *mailbox
,const gchar *pattern
);
Returns TRUE
if mailbox
's name matches pattern
. The pattern
may
contain wildcard characters '*' and '%', which are interpreted similar
to the IMAP LIST command.
Since: 3.12
camel_imapx_mailbox_get_name ()
const gchar *
camel_imapx_mailbox_get_name (CamelIMAPXMailbox *mailbox
);
Returns the mailbox name for mailbox
.
Since: 3.12
camel_imapx_mailbox_get_separator ()
gchar
camel_imapx_mailbox_get_separator (CamelIMAPXMailbox *mailbox
);
Returns the path separator character for mailbox
.
Since: 3.12
camel_imapx_mailbox_dup_folder_path ()
gchar *
camel_imapx_mailbox_dup_folder_path (CamelIMAPXMailbox *mailbox
);
Returns the mailbox name as folder path.
Since: 3.16
camel_imapx_mailbox_get_namespace ()
CamelIMAPXNamespace *
camel_imapx_mailbox_get_namespace (CamelIMAPXMailbox *mailbox
);
Returns the CamelIMAPXNamespace representing the IMAP server namespace
to which mailbox
belongs.
Since: 3.12
camel_imapx_mailbox_get_messages ()
guint32
camel_imapx_mailbox_get_messages (CamelIMAPXMailbox *mailbox
);
Returns the last known number of messages in the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_messages ()
void camel_imapx_mailbox_set_messages (CamelIMAPXMailbox *mailbox
,guint32 messages
);
Updates the last known number of messages in the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_recent ()
guint32
camel_imapx_mailbox_get_recent (CamelIMAPXMailbox *mailbox
);
Returns the last known number of messages with the \Recent flag set.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_recent ()
void camel_imapx_mailbox_set_recent (CamelIMAPXMailbox *mailbox
,guint32 recent
);
Updates the last known number of messages with the \Recent flag set.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_unseen ()
guint32
camel_imapx_mailbox_get_unseen (CamelIMAPXMailbox *mailbox
);
Returns the last known number of messages which do not have the \Seen flag set.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_unseen ()
void camel_imapx_mailbox_set_unseen (CamelIMAPXMailbox *mailbox
,guint32 unseen
);
Updates the last known number of messages which do not have the \Seen flag set.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_uidnext ()
guint32
camel_imapx_mailbox_get_uidnext (CamelIMAPXMailbox *mailbox
);
Returns the last known next unique identifier value of the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_uidnext ()
void camel_imapx_mailbox_set_uidnext (CamelIMAPXMailbox *mailbox
,guint32 uidnext
);
Updates the last known next unique identifier value of the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_uidvalidity ()
guint32
camel_imapx_mailbox_get_uidvalidity (CamelIMAPXMailbox *mailbox
);
Returns the last known unique identifier validity value of the mailbox.
This valud should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_uidvalidity ()
void camel_imapx_mailbox_set_uidvalidity (CamelIMAPXMailbox *mailbox
,guint32 uidvalidity
);
Updates the last known unique identifier validity value of the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_highestmodseq ()
guint64
camel_imapx_mailbox_get_highestmodseq (CamelIMAPXMailbox *mailbox
);
Returns the last known highest mod-sequence value of all messages in the mailbox, or zero if the server does not support the persistent storage of mod-sequences for the mailbox.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_set_highestmodseq ()
void camel_imapx_mailbox_set_highestmodseq (CamelIMAPXMailbox *mailbox
,guint64 highestmodseq
);
Updates the last known highest mod-sequence value of all messages in the mailbox. If the server does not support the persistent storage of mod-sequences for the mailbox then the value should remain zero.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_get_permanentflags ()
guint32
camel_imapx_mailbox_get_permanentflags
(CamelIMAPXMailbox *mailbox
);
Since: 3.16
camel_imapx_mailbox_set_permanentflags ()
void camel_imapx_mailbox_set_permanentflags (CamelIMAPXMailbox *mailbox
,guint32 permanentflags
);
Updates the last know value for PERMANENTFLAGS for this mailbox.
Since: 3.16
camel_imapx_mailbox_dup_quota_roots ()
gchar **
camel_imapx_mailbox_dup_quota_roots (CamelIMAPXMailbox *mailbox
);
Returns the last known list of quota roots for mailbox
as described
in RFC 2087,
or NULL
if no quota information for mailbox
is available.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
The returned newly-allocated, NULL
-terminated string array should
be freed with g_strfreev()
when finished with it.
Since: 3.12
camel_imapx_mailbox_set_quota_roots ()
void camel_imapx_mailbox_set_quota_roots (CamelIMAPXMailbox *mailbox
,const gchar **quota_roots
);
Updates the last known list of quota roots for mailbox
as described
in RFC 2087.
This value should reflect the present state of the IMAP server as reported through untagged server responses in the current session.
Since: 3.12
camel_imapx_mailbox_copy_message_map ()
GSequence *
camel_imapx_mailbox_copy_message_map (CamelIMAPXMailbox *mailbox
);
Creates a copy of mailbox
's message map: a GSequence of 32-bit integers
which map message sequence numbers (MSNs) to unique identifiers (UIDs).
Free the returned GSequence with g_sequeuce_free()
when finished with it.
Since: 3.12
camel_imapx_mailbox_take_message_map ()
void camel_imapx_mailbox_take_message_map (CamelIMAPXMailbox *mailbox
,GSequence *message_map
);
Takes ownership of a GSequence of 32-bit integers which map message
sequence numbers (MSNs) to unique identifiers (UIDs) for mailbox
.
The message_map
is expected to be assembled from a local cache of
previously fetched UIDs. The mailbox
will update it as untagged
server responses are processed.
Since: 3.12
camel_imapx_mailbox_get_msn_for_uid ()
gboolean camel_imapx_mailbox_get_msn_for_uid (CamelIMAPXMailbox *mailbox
,guint32 uid
,guint32 *out_msn
);
Given a message's unique identifier (uid
), write the message's sequence
number to out_msn
and return TRUE
. If the unique identifier is unknown
(as far as mailbox
has been informed), the function returns FALSE
.
Parameters
mailbox |
||
uid |
a message's unique identifier |
|
out_msn |
return location for the message's sequence number, or |
Since: 3.12
camel_imapx_mailbox_get_uid_for_msn ()
gboolean camel_imapx_mailbox_get_uid_for_msn (CamelIMAPXMailbox *mailbox
,guint32 msn
,guint32 *out_uid
);
Given a message's sequence number (msn
), write the message's unique
identifier to out_uid
and return TRUE
. If the sequence number is out of
range (as far as mailbox
has been informed), the function returns FALSE
.
Parameters
mailbox |
||
msn |
a message's sequence number (1..n) |
|
out_uid |
return location for the message's unique identifier, or |
Since: 3.12
camel_imapx_mailbox_deleted ()
void
camel_imapx_mailbox_deleted (CamelIMAPXMailbox *mailbox
);
Adds the CAMEL_IMAPX_LIST_ATTR_NONEXISTENT attribute to mailbox
.
Call this function after successfully completing a DELETE command.
Since: 3.12
camel_imapx_mailbox_subscribed ()
void
camel_imapx_mailbox_subscribed (CamelIMAPXMailbox *mailbox
);
Add the CAMEL_IMAPX_LIST_ATTR_SUBSCRIBED attribute to mailbox
.
Call this function after successfully completing a SUBSCRIBE command.
Since: 3.12
camel_imapx_mailbox_unsubscribed ()
void
camel_imapx_mailbox_unsubscribed (CamelIMAPXMailbox *mailbox
);
Removes the CAMEL_IMAPX_LIST_ATTR_SUBSCRIBED attribute from mailbox
.
Call this function after successfully completing an UNSUBSCRIBE command.
Since: 3.12
camel_imapx_mailbox_has_attribute ()
gboolean camel_imapx_mailbox_has_attribute (CamelIMAPXMailbox *mailbox
,const gchar *attribute
);
Returns whether mailbox
includes the given mailbox attribute.
The attribute
should be one of the LIST attribute macros defined
for CamelIMAPXListResponse.
Since: 3.12
camel_imapx_mailbox_handle_list_response ()
void camel_imapx_mailbox_handle_list_response (CamelIMAPXMailbox *mailbox
,CamelIMAPXListResponse *response
);
Updates the internal state of mailbox
from the data in response
.
Since: 3.12
camel_imapx_mailbox_handle_lsub_response ()
void camel_imapx_mailbox_handle_lsub_response (CamelIMAPXMailbox *mailbox
,CamelIMAPXListResponse *response
);
Updates the internal state of mailbox
from the data in response
.
Since: 3.12
camel_imapx_mailbox_handle_status_response ()
void camel_imapx_mailbox_handle_status_response (CamelIMAPXMailbox *mailbox
,CamelIMAPXStatusResponse *response
);
Updates the internal state of mailbox
from the data in response
.
Since: 3.12
camel_imapx_mailbox_get_update_count ()
gint
camel_imapx_mailbox_get_update_count (CamelIMAPXMailbox *mailbox
);
camel_imapx_mailbox_inc_update_count ()
void camel_imapx_mailbox_inc_update_count (CamelIMAPXMailbox *mailbox
,gint inc
);
camel_imapx_mailbox_get_change_stamp ()
gint
camel_imapx_mailbox_get_change_stamp (CamelIMAPXMailbox *mailbox
);
Types and Values
struct CamelIMAPXMailbox
struct CamelIMAPXMailbox;
Contains only private data that should be read and manipulated using the functions below.
Since: 3.12