NeoMutt  2020-11-20
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);
39 void notify_observer_remove_all(struct Notify *notify);
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:207
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:82
int(* observer_t)(struct NotifyCallback *nc)
Prototype for a notification callback function.
Definition: observer.h:54
struct Notify * parent
Definition: notify.c:41
Notification API.
Definition: notify.c:39
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:62
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:152
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:169
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:49
void notify_observer_remove_all(struct Notify *notify)
Remove all the observers from an object.
Definition: notify.c:232