NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
notify.h
Go to the documentation of this file.
1
23#ifndef MUTT_MUTT_NOTIFY_H
24#define MUTT_MUTT_NOTIFY_H
25
26#include <stdbool.h>
27#include "notify_type.h"
28#include "observer.h"
29
30struct Notify;
31
32struct Notify *notify_new(void);
33void notify_free(struct Notify **ptr);
34void notify_set_parent(struct Notify *notify, struct Notify *parent);
35
36bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data);
37bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data);
38bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data);
39void notify_observer_remove_all(struct Notify *notify);
40
41#endif /* MUTT_MUTT_NOTIFY_H */
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:191
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:62
void notify_observer_remove_all(struct Notify *notify)
Remove all the observers from an object.
Definition: notify.c:256
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:173
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:95
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:75
Notification Types.
NotifyType
Notification Types.
Definition: notify_type.h:34
Observer of notifications.
int(* observer_t)(struct NotifyCallback *nc)
Definition: observer.h:54
Notification API.
Definition: notify.c:53
struct Notify * parent
Parent of the notification object.
Definition: notify.c:54