1
/* Interface for NSNotification and NSNotificationCenter for GNUstep
2
Copyright (C) 1996,1999 Free Software Foundation, Inc.
4
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
7
This file is part of the GNUstep Base Library.
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Library General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
24
#ifndef __NSNotification_h_GNUSTEP_BASE_INCLUDE
25
#define __NSNotification_h_GNUSTEP_BASE_INCLUDE
27
#include <Foundation/NSObject.h>
28
#include <Foundation/NSMapTable.h>
34
@interface NSNotification : NSObject <NSCopying, NSCoding>
41
/* Creating a Notification Object */
42
+ (NSNotification*) notificationWithName: (NSString*)name
45
+ (NSNotification*) notificationWithName: (NSString*)name
47
userInfo: (NSDictionary*)info;
49
/* Querying a Notification Object */
53
- (NSDictionary*) userInfo;
59
@interface NSNotificationCenter : NSObject <GCFinalization>
64
+ (NSNotificationCenter*) defaultCenter;
66
- (void) addObserver: (id)observer
71
- (void) removeObserver: (id)observer;
72
- (void) removeObserver: (id)observer
76
- (void) postNotification: (NSNotification*)notification;
77
- (void) postNotificationName: (NSString*)name
79
- (void) postNotificationName: (NSString*)name
81
userInfo: (NSDictionary*)info;
86
@interface NSNotification (GNUstep)
87
- (id) initWithName: (NSString*)name
89
userInfo: (NSDictionary*)user_info;
92
@interface NSNotificationCenter (GNUstep)
94
* Extensions for maximising posting performance - these options are
95
* NOT adjustable for the default notification center.
97
* You can disable locking in a multi-threaded program if you KNOW that only
98
* one thread will ever use the notification center.
100
* You can turn on 'immutability' if you KNOW that the posting of a
101
* notification will never result in an attempt to modify the center.
102
* In this case, the center can optimise delivery of notifications.
104
- (BOOL) setImmutableInPost: (BOOL)flag;
105
- (BOOL) setLockingDisabled: (BOOL)flag;
109
#endif /*__NSNotification_h_GNUSTEP_BASE_INCLUDE */