Go to the documentation of this file.
67 struct Notify *notify = *ptr;
108 enum NotifyType event_type,
int event_subtype,
void *event_data)
110 if (!source || !current)
153 int event_subtype,
void *event_data)
155 return send(notify, notify, event_type, event_subtype, event_data);
172 if (!notify || !callback)
#define STAILQ_INIT(head)
Data passed to a notification function.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
#define STAILQ_REMOVE(head, elm, type, field)
struct ObserverList observers
struct Observer * observer
An Observer.
int(* observer_t)(struct NotifyCallback *nc)
Prototype for a notification callback function.
#define STAILQ_FOREACH(var, head, field)
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
struct Notify * notify_new(void)
Create a new notifications handler.
NotifyType
Notification Types.
static bool send(struct Notify *source, struct Notify *current, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
void * global_data
Private data to pass to callback.
#define STAILQ_INSERT_HEAD(head, elm, field)
struct Notify * current
Notify object being observed.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
void * event_data
Data from notify_send()
void notify_observer_remove_all(struct Notify *notify)
Remove all the observers from an object.
observer_t callback
Callback function for events.
void notify_free(struct Notify **ptr)
Free a notification handler.
An observer of notifications.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.