#ifndef MAILBOX_LIST_ITER_H
#define MAILBOX_LIST_ITER_H
#include "mail-namespace.h"
#include "mailbox-list.h"
enum mailbox_list_iter_flags {
/* Ignore index file and ACLs (used by ACL plugin internally) */
/* Don't list autocreated mailboxes (e.g. INBOX) unless they
physically exist */
/* Skip all kinds of mailbox aliases. This typically includes symlinks
that point to the same directory. Also when iterating with
mailbox_list_iter_init_namespaces() skip namespaces that
have alias_for set. */
/* For mailbox_list_iter_init_namespaces(): '*' in a pattern doesn't
match beyond namespace boundary (e.g. "foo*" or "*o" doesn't match
"foo." namespace's mailboxes, but "*.*" does). also '%' can't match
namespace prefixes, if there exists a parent namespace whose children
it matches. */
/* List only subscribed mailboxes */
/* Return MAILBOX_CHILD_* if mailbox's children match selection
criteria, even if the mailbox itself wouldn't match. */
/* Return only mailboxes that have special use flags */
/* Don't return any flags unless it can be done without cost */
/* Return MAILBOX_SUBSCRIBED flag */
/* Return children flags */
/* Return IMAP special use flags */
};
struct mailbox_info {
const char *vname;
const char *special_use;
};
/* Returns a single pattern from given reference and pattern. */
/* Initialize new mailbox list request. Pattern may contain '%' and '*'
wildcards as defined by RFC-3501. */
struct mailbox_list_iterate_context *
enum mailbox_list_iter_flags flags);
/* Like mailbox_list_iter_init(), but support multiple patterns. Patterns is
a NULL-terminated list of strings. It must contain at least one pattern. */
struct mailbox_list_iterate_context *
const char *const *patterns,
enum mailbox_list_iter_flags flags);
/* List mailbox_list_iter_init_multiple(), but list mailboxes from all the
specified namespaces. If it fails, the error message is set to the first
namespaces->list. */
struct mailbox_list_iterate_context *
const char *const *patterns,
enum mail_namespace_type type_mask,
enum mailbox_list_iter_flags flags);
/* Get next mailbox. Returns the mailbox name */
const struct mailbox_info *
/* Deinitialize mailbox list request. Returns -1 if some error
occurred while listing. The error string can be looked up with
mailbox_list_get_last_error(). */
/* List one mailbox. Returns 1 if info returned, 0 if mailbox doesn't exist,
-1 if error. */
enum mailbox_info_flags *flags_r);
/* Returns 1 if mailbox has children, 0 if not, -1 if error. */
#endif