56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen#ifndef NOTIFY_PLUGIN_H
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen#define NOTIFY_PLUGIN_H
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen
a8fe899601735459641edae975c0fa08be8482e2Timo Sirainen#include "mail-types.h"
a8fe899601735459641edae975c0fa08be8482e2Timo Sirainen
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct mail;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct mail_transaction_commit_changes;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct mail_storage;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct mailbox_transaction_context;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct mailbox_list;
61b0637759146621cbb7edcbd0b03a71cfd66dfeTimo Sirainenstruct mailbox;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct notify_context;
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainenstruct module;
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct notify_vfuncs {
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void *(*mail_transaction_begin)(struct mailbox_transaction_context *t);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_save)(void *txn, struct mail *mail);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_copy)(void *txn, struct mail *src, struct mail *dst);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_expunge)(void *txn, struct mail *mail);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_update_flags)(void *txn, struct mail *mail,
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen enum mail_flags old_flags);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_update_keywords)(void *txn, struct mail *mail,
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen const char *const *old_keywords);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_transaction_commit)(void *txn,
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen struct mail_transaction_commit_changes *changes);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mail_transaction_rollback)(void *txn);
132bfe8fcb7a1be790dc8b5bf9d155c9f060808dTimo Sirainen void (*mailbox_create)(struct mailbox *box);
95c4f06cba717df14358ec883b1bd1aec6cbf0a1Timo Sirainen void (*mailbox_update)(struct mailbox *box);
61b0637759146621cbb7edcbd0b03a71cfd66dfeTimo Sirainen void *(*mailbox_delete_begin)(struct mailbox *box);
61b0637759146621cbb7edcbd0b03a71cfd66dfeTimo Sirainen void (*mailbox_delete_commit)(void *txn, struct mailbox *box);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen void (*mailbox_delete_rollback)(void *txn);
71e88fae3be360e9a93b3398e743f99a6f05d2edTimo Sirainen void (*mailbox_rename)(struct mailbox *src, struct mailbox *dest);
95c4f06cba717df14358ec883b1bd1aec6cbf0a1Timo Sirainen void (*mailbox_set_subscribed)(struct mailbox *box, bool subscribed);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen};
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenstruct notify_context *
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainennotify_register(const struct notify_vfuncs *vfuncs);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenvoid notify_unregister(struct notify_context *ctx);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainenvoid notify_plugin_init(struct module *module);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainenvoid notify_plugin_deinit(void);
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen
56c35c844320b0a157d1aaa6b3e62b7f3851b235Timo Sirainen#endif