bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_vfuncs_init {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Return the default config for an event (or NULL if config is
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * required). */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_vfuncs_mbox {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Output debug information about a message event. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*debug_mbox)(struct push_notification_txn_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Called when message data is about to be free'd. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*free_mbox)(struct push_notification_txn_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_vfuncs_mbox_triggers {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox event: create mailbox. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*create)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox event: delete mailbox. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*delete)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox event: rename mailbox. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*rename)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox event: subscribe mailbox. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*subscribe)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox event: unsubscribe mailbox. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*unsubscribe)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_vfuncs_msg {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Output debug information about a message event. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*debug_msg)(struct push_notification_txn_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Called when message data is about to be free'd. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*free_msg)(struct push_notification_txn_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_vfuncs_msg_triggers {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message event: save message (from MTA). */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*save)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message event: append message (from MUA). */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*append)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message event: expunge message. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*expunge)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message event: flag change. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*flagchange)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message event: keyword change. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void (*keywordchange)(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *ec,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz const char *const *old_keywords);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz const struct push_notification_event *event;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_vfuncs_init init;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_vfuncs_mbox mbox;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_vfuncs_mbox_triggers mbox_triggers;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_vfuncs_msg msg;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_vfuncs_msg_triggers msg_triggers;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *event;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern ARRAY_TYPE(push_notification_event) push_notification_events;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_event_init(struct push_notification_driver_txn *dtxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz(const struct push_notification_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz(const struct push_notification_event *event);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#endif /* PUSH_NOTIFICATION_EVENTS_H */