NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
notify.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_LIB_NOTIFY_H
24 #define MUTT_LIB_NOTIFY_H
25 
26 #include <stdbool.h>
27 #include "notify_type.h"
28 #include "observer.h"
29 
30 struct Notify;
31 
32 struct Notify *notify_new(void);
33 void notify_free(struct Notify **ptr);
34 void notify_set_parent(struct Notify *notify, struct Notify *parent);
35 
36 bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data);
37 bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data);
38 bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data);
40 
41 #endif /* MUTT_LIB_NOTIFY_H */
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
Definition: notify.c:228
struct Notify * notify
Notifications: ColorId, EventColor.
Definition: color.c:95
Observer of notifications.
NotifyType
Notification Types.
Definition: notify_type.h:31
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:93
int(* observer_t)(struct NotifyCallback *nc)
Prototype for a notification callback function.
Definition: observer.h:58
struct Notify * parent
Definition: notify.c:52
Notification API.
Definition: notify.c:50
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:73
static void * global_data
Original opaque data in fallback implementation.
Definition: qsort_r.c:41
Notification Types.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:171
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:189
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:60
void notify_observer_remove_all(struct Notify *notify)
Remove all the observers from an object.
Definition: notify.c:253