4 Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
7 Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
9 This file is part of libFoundation.
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted, provided
13 that the above copyright notice appear in all copies and that both that
14 copyright notice and this permission notice appear in supporting
17 We disclaim all warranties with regard to this software, including all
18 implied warranties of merchantability and fitness, in no event shall
19 we be liable for any special, indirect or consequential damages or any
20 damages whatsoever resulting from loss of use, data or profits, whether in
21 an action of contract, negligence or other tortious action, arising out of
22 or in connection with the use or performance of this software.
25 #ifndef __NSNotification_h__
26 #define __NSNotification_h__
28 #include <Foundation/NSObject.h>
29 #include <Foundation/NSUtilities.h>
30 #include <Foundation/NSMapTable.h>
32 @class NSMutableDictionary;
34 @class NSMutableArray;
41 @interface NSNotification : NSObject <NSCoding>
43 + (NSNotification*)notificationWithName:(NSString *)name object:object;
44 + (NSNotification*)notificationWithName:(NSString *)aName
45 object:(id)anObject userInfo:(NSDictionary *)userInfo;
47 - (id)initWithName:(NSString *)aName object:(id)anObject
48 userInfo:(NSDictionary *)anUserInfo;
50 - (NSString *)notificationName;
52 - (id)notificationObject;
54 - (NSDictionary *)userInfo;
59 * NSNotificationCenter
62 struct _NSNotificationRegistrationList;
64 @interface NSNotificationCenter : NSObject
66 NSMapTable *nameToObjects;
70 + (NSNotificationCenter *)defaultCenter;
72 // Posting Notifications
73 - (void)postNotification:(NSNotification *)notification;
74 - (void)postNotificationName:(NSString *)notificationName object:(id)object;
75 - (void)postNotificationName:(NSString *)notificationName object:(id)object
76 userInfo:(NSDictionary *)userInfo;
78 // Adding and Removing Observers
80 - (void)addObserver:(id)observer selector:(SEL)selector
81 name:(NSString *)name object:object;
82 - (void)removeObserver:(id)observer
83 name:(NSString *)name object:(id)object;
84 - (void)removeObserver:(id)observer;
88 #endif /* __NSNotification_h__ */