mailbox-list-notify.h revision 24acd68c82dc137b88bb3ba3258b9d1f7ebcb44d
#ifndef MAILBOX_LIST_NOTIFY_H
#define MAILBOX_LIST_NOTIFY_H
#include "guid.h"
struct mailbox_list_notify;
enum mailbox_list_notify_event {
MAILBOX_LIST_NOTIFY_CREATE = 0x01,
MAILBOX_LIST_NOTIFY_DELETE = 0x02,
MAILBOX_LIST_NOTIFY_RENAME = 0x04,
MAILBOX_LIST_NOTIFY_SUBSCRIBE = 0x08,
MAILBOX_LIST_NOTIFY_UNSUBSCRIBE = 0x10,
MAILBOX_LIST_NOTIFY_UIDVALIDITY = 0x20,
MAILBOX_LIST_NOTIFY_APPENDS = 0x40,
MAILBOX_LIST_NOTIFY_EXPUNGES = 0x80,
MAILBOX_LIST_NOTIFY_SEEN_CHANGES = 0x100,
#define MAILBOX_LIST_NOTIFY_STATUS \
};
struct mailbox_list_notify {
struct mailbox_list *list;
};
struct mailbox_list_notify_rec {
/* For all events: */
const char *storage_name, *vname;
/* For selectable mailboxes: */
/* For rename: */
const char *old_vname;
};
/* Monitor for specified changes in the mailbox list.
Returns 0 if ok, -1 if notifications aren't supported. */
struct mailbox_list_notify **notify_r);
/* Get the next change. Returns 1 if record was returned, 0 if there are no
more changes currently or -1 if some error occurred */
const struct mailbox_list_notify_rec **rec_r);
/* Call the specified callback when something changes. */
#endif