OF_ASSUME_NONNULL_BEGIN
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
@class OFNotificationCenterHandle;
#ifdef OF_HAVE_BLOCKS
/**
* @brief A block which is called when a notification has been posted.
*
* @param notification The notification that has been posted
*/
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-
-
+
+
+ (OFNotificationCenter *)defaultCenter;
/**
* @brief Adds an observer for the specified notification and object.
*
* @param observer The object that should receive notifications
* @param selector The selector to call on the observer on notifications. The
* method must take exactly one object of type @ref
* OFNotification.
* method must take exactly one object of type
* @ref OFNotification.
* @param name The name of the notification to observe
* @param object The object that should be sending the notification, or `nil`
* if the object should be ignored to determine what
* notifications to deliver
*/
- (void)addObserver: (id)observer
selector: (SEL)selector
* @param name The name of the notification to observe
* @param object The object that should be sending the notification, or `nil`
* if the object should be ignored to determine what
* notifications to deliver
* @param block The block to handle notifications
* @return An opaque object to remove the observer again
*/
- (OFNotificationCenterHandle *)addObserverForName: (OFNotificationName)name
object: (nullable id)object
usingBlock: (OFNotificationCenterBlock)block;
- (id)addObserverForName: (OFNotificationName)name
object: (nullable id)object
usingBlock: (OFNotificationCenterBlock)block;
/**
* @brief Removes an observer. The specified observer must be one returned by
* @ref addObserver:selector:name:object:.
*
* @param observer The object that was returned when adding the observer
*/
- (void)removeObserver: (OFNotificationCenterHandle *)observer;
- (void)removeObserver: (id)observer;
#endif
/**
* @brief Posts the specified notification.
*
* @param notification The notification to post
*/