mail-storage-hooks.h revision e563b8a1457be8c08cc7567043c9f06b8243a025
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef MAIL_STORAGE_HOOKS_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define MAIL_STORAGE_HOOKS_H
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
80c1d98d3638b71e57a39cafa88b9122bf8169c6Timo Sirainenstruct module;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct mail_user;
94a8cb0ee1d85569ad1a2acacd92d3ce22f8a1cbTimo Sirainenstruct mail_storage;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct mail_namespace;
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainenstruct mailbox_list;
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainenstruct mailbox;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct mail;
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstruct mail_storage_hooks {
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen void (*mail_user_created)(struct mail_user *user);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen void (*mail_namespace_storage_added)(struct mail_namespace *ns);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen void (*mail_namespaces_created)(struct mail_namespace *namespaces);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen void (*mail_storage_created)(struct mail_storage *storage);
31ddc75584c5cde53d2e78a737587f2e7fdcb0d2Timo Sirainen void (*mailbox_list_created)(struct mailbox_list *list);
8887bf3757d51d73887dd20b1db3334d867d3817Timo Sirainen void (*mailbox_allocated)(struct mailbox *box);
8887bf3757d51d73887dd20b1db3334d867d3817Timo Sirainen void (*mailbox_opened)(struct mailbox *box);
369a1084c500a9df7448ffa9409ce32e42060bc2Timo Sirainen void (*mail_allocated)(struct mail *mail);
51b979b6414b940f04677a7e2d064be119345954Timo Sirainen};
51b979b6414b940f04677a7e2d064be119345954Timo Sirainen
51b979b6414b940f04677a7e2d064be119345954Timo Sirainenvoid mail_storage_hooks_init(void);
c53e8ee216904ffe6de4f6518d9f9f5107b7610eTimo Sirainenvoid mail_storage_hooks_deinit(void);
589a9c6e8ee22071c14171c04bfc6bfe17121871Timo Sirainen
589a9c6e8ee22071c14171c04bfc6bfe17121871Timo Sirainenvoid mail_storage_hooks_add(struct module *module,
ef5fb27361cc5e15766e85e28355750ff04b13c9Timo Sirainen const struct mail_storage_hooks *hooks);
ef5fb27361cc5e15766e85e28355750ff04b13c9Timo Sirainen/* Add hooks to this plugin regardless of whether it exists in user's
ef5fb27361cc5e15766e85e28355750ff04b13c9Timo Sirainen mail_plugins setting. */
ef5fb27361cc5e15766e85e28355750ff04b13c9Timo Sirainenvoid mail_storage_hooks_add_forced(struct module *module,
a53cb86b4d733d9c48ee4d285bed477c80825804Timo Sirainen const struct mail_storage_hooks *hooks);
a53cb86b4d733d9c48ee4d285bed477c80825804Timo Sirainenvoid mail_storage_hooks_remove(const struct mail_storage_hooks *hooks);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid mail_storage_hooks_add_internal(const struct mail_storage_hooks *hooks);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid mail_storage_hooks_remove_internal(const struct mail_storage_hooks *hooks);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid hook_mail_user_created(struct mail_user *user);
b7b81543899e306c71e6152516d8698416162bcbTimo Sirainenvoid hook_mail_namespace_storage_added(struct mail_namespace *ns);
fd3d711f219fd6813492acbe051e04327f0ca0f0Timo Sirainenvoid hook_mail_namespaces_created(struct mail_namespace *namespaces);
6ec7cf71ccd0eed1f9cc1b0bda8960796b04160bTimo Sirainenvoid hook_mail_storage_created(struct mail_storage *storage);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid hook_mailbox_list_created(struct mailbox_list *list);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid hook_mailbox_allocated(struct mailbox *box);
fd3d711f219fd6813492acbe051e04327f0ca0f0Timo Sirainenvoid hook_mailbox_opened(struct mailbox *box);
db5164c9a1129af0cfb11fc18d88da361a8011fbTimo Sirainenvoid hook_mail_allocated(struct mail *mail);
db5164c9a1129af0cfb11fc18d88da361a8011fbTimo Sirainen
db5164c9a1129af0cfb11fc18d88da361a8011fbTimo Sirainen#endif
db5164c9a1129af0cfb11fc18d88da361a8011fbTimo Sirainen