ObjFW
Loading...
Searching...
No Matches
OFNotification.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21
22OF_ASSUME_NONNULL_BEGIN
23
26@class OFConstantString;
27@class OFDictionary OF_GENERIC(KeyType, ObjectType);
28
33
41{
43 id _Nullable _object;
44 OFDictionary *_Nullable _userInfo;
45 OF_RESERVE_IVARS(OFNotification, 4)
46}
47
51@property (readonly, nonatomic) OFNotificationName name;
57@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id object;
62@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFDictionary *userInfo;
72+ (instancetype)notificationWithName: (OFNotificationName)name
73 object: (nullable id)object;
74
85+ (instancetype)notificationWithName: (OFNotificationName)name
86 object: (nullable id)object
87 userInfo: (nullable OFDictionary *)userInfo;
88
98- (instancetype)initWithName: (OFNotificationName)name
99 object: (nullable id)object;
100
111- (instancetype)initWithName: (OFNotificationName)name
112 object: (nullable id)object
113 userInfo: (nullable OFDictionary *)userInfo
114 OF_DESIGNATED_INITIALIZER;
115
116- (instancetype)init OF_UNAVAILABLE;
117@end
118
119OF_ASSUME_NONNULL_END
OFConstantString * OFNotificationName
A name for a notification.
Definition OFNotification.h:32
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:42
An abstract class for storing objects in a dictionary.
Definition OFDictionary.h:84
A class to represent a notification for or from OFNotificationCenter.
Definition OFNotification.h:42
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A protocol for the creation of copies.
Definition OFObject.h:1350