mail-namespace.h revision a02c3e423f365d54ad731811dcb2cfad0c0e3cbb
#ifndef MAIL_NAMESPACE_H
#define MAIL_NAMESPACE_H
#include "mail-user.h"
enum namespace_type {
};
enum namespace_flags {
/* Namespace contains the INBOX mailbox (there can be only one) */
NAMESPACE_FLAG_INBOX = 0x01,
/* Namespace is visible only by explicitly using its full prefix */
NAMESPACE_FLAG_HIDDEN = 0x02,
/* Namespace prefix is visible with LIST */
NAMESPACE_FLAG_LIST_PREFIX = 0x04,
/* Namespace prefix isn't visible with LIST, but child mailboxes are */
NAMESPACE_FLAG_LIST_CHILDREN = 0x08,
/* Namespace uses its own subscriptions. */
NAMESPACE_FLAG_SUBSCRIPTIONS = 0x10,
/* Namespace is created for internal use only. */
NAMESPACE_FLAG_INTERNAL = 0x1000,
/* Namespace was created automatically (for shared mailboxes) */
NAMESPACE_FLAG_AUTOCREATED = 0x2000,
/* Namespace has at least some usable mailboxes. Autocreated namespaces
that don't have usable mailboxes may be removed automatically. */
NAMESPACE_FLAG_USABLE = 0x4000
};
struct mail_namespace {
/* Namespaces are sorted by their prefix length, "" comes first */
struct mail_namespace *next;
enum namespace_type type;
enum namespace_flags flags;
struct mailbox_list *list;
/* FIXME: we should support multiple storages in one namespace */
struct mail_storage *storage;
};
/* Called after namespaces has been created */
/* Destroy a single namespace and remove it from user's namespaces list. */
/* Update hierarchy separators in given name to real_sep characters. */
/* Write virtual mailbox name to dest and return it. Separators are changed to
virtual ones and namespace prefix is inserted except for INBOX. */
const char *name);
/* Returns the hierarchy separator for mailboxes that are listed at root. */
/* Returns namespace based on the mailbox name's prefix. Updates mailbox to
be a valid name inside the namespace (prefix is skipped, hierarchy separator
is changed to real_sep). If no namespaces were found, returns NULL. */
struct mail_namespace *
/* Like above, but ignore hidden namespaces. */
struct mail_namespace *
const char **mailbox);
/* Like above, but find only from namespaces with subscriptions flag set. */
struct mail_namespace *
const char **mailbox);
/* Like above, but find only from namespaces with subscriptions flag not set. */
struct mail_namespace *
const char **mailbox);
/* Returns the INBOX namespace */
struct mail_namespace *
/* Returns TRUE if the given namespace matches the mailbox's prefix.
Updates mailbox name to be a valid name inside the namespace. */
const char **mailbox);
/* Find a namespace with given prefix. */
struct mail_namespace *
const char *prefix);
/* Like _find_prefix(), but ignore trailing separator */
struct mail_namespace *
const char *prefix);
/* Called internally by mail_storage_create(). */
#endif