2002-06-06 14:02:59 +00:00
|
|
|
|
/** Interface for NSNotification and NSNotificationCenter for GNUstep
|
1999-06-17 13:17:28 +00:00
|
|
|
|
Copyright (C) 1996,1999 Free Software Foundation, Inc.
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
2002-06-06 14:02:59 +00:00
|
|
|
|
Rewrite by: Richard Frith-Macdonald <rfm@gnu.org>
|
1996-03-03 01:41:55 +00:00
|
|
|
|
Created: March 1996
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
|
This file is part of the GNUstep Base Library.
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Library General Public License for more details.
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1996-02-13 16:09:50 +00:00
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
|
License along with this library; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
2002-06-06 14:02:59 +00:00
|
|
|
|
|
|
|
|
|
AutogsdocSource: NSNotification.m
|
|
|
|
|
AutogsdocSource: NSNotificationCenter.m
|
1996-03-03 01:41:55 +00:00
|
|
|
|
*/
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
|
#ifndef __NSNotification_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
|
#define __NSNotification_h_GNUSTEP_BASE_INCLUDE
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
1998-07-21 17:56:48 +00:00
|
|
|
|
#include <Foundation/NSObject.h>
|
1999-06-17 13:17:28 +00:00
|
|
|
|
#include <Foundation/NSMapTable.h>
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
|
@class NSDictionary;
|
1999-06-17 13:17:28 +00:00
|
|
|
|
@class NSLock;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1999-06-17 13:17:28 +00:00
|
|
|
|
@interface NSNotification : NSObject <NSCopying, NSCoding>
|
1998-07-21 17:56:48 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1998-07-21 17:56:48 +00:00
|
|
|
|
/* Creating a Notification Object */
|
1996-03-03 01:41:55 +00:00
|
|
|
|
+ (NSNotification*) notificationWithName: (NSString*)name
|
1999-06-17 13:17:28 +00:00
|
|
|
|
object: (id)object;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
|
|
|
|
+ (NSNotification*) notificationWithName: (NSString*)name
|
1999-06-17 13:17:28 +00:00
|
|
|
|
object: (id)object
|
2001-12-17 14:31:42 +00:00
|
|
|
|
userInfo: (NSDictionary*)info;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
|
|
|
|
/* Querying a Notification Object */
|
|
|
|
|
|
|
|
|
|
- (NSString*) name;
|
1999-06-17 13:17:28 +00:00
|
|
|
|
- (id) object;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
- (NSDictionary*) userInfo;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-06-17 13:17:28 +00:00
|
|
|
|
@interface NSNotificationCenter : NSObject <GCFinalization>
|
|
|
|
|
{
|
1999-09-16 07:21:34 +00:00
|
|
|
|
void *_table;
|
1999-06-17 13:17:28 +00:00
|
|
|
|
}
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
|
|
|
|
+ (NSNotificationCenter*) defaultCenter;
|
|
|
|
|
|
1999-06-17 13:17:28 +00:00
|
|
|
|
- (void) addObserver: (id)observer
|
2002-06-06 14:02:59 +00:00
|
|
|
|
selector: (SEL)selector
|
1996-03-03 01:41:55 +00:00
|
|
|
|
name: (NSString*)name
|
1999-06-17 13:17:28 +00:00
|
|
|
|
object: (id)object;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1999-06-17 13:17:28 +00:00
|
|
|
|
- (void) removeObserver: (id)observer;
|
|
|
|
|
- (void) removeObserver: (id)observer
|
|
|
|
|
name: (NSString*)name
|
|
|
|
|
object: (id)object;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
|
1999-06-17 13:17:28 +00:00
|
|
|
|
- (void) postNotification: (NSNotification*)notification;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
- (void) postNotificationName: (NSString*)name
|
1999-06-17 13:17:28 +00:00
|
|
|
|
object: (id)object;
|
1996-03-03 01:41:55 +00:00
|
|
|
|
- (void) postNotificationName: (NSString*)name
|
1999-06-17 13:17:28 +00:00
|
|
|
|
object: (id)object
|
|
|
|
|
userInfo: (NSDictionary*)info;
|
|
|
|
|
|
1996-02-13 16:09:50 +00:00
|
|
|
|
@end
|
|
|
|
|
|
1999-06-24 19:30:29 +00:00
|
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
|
/**
|
2004-11-22 11:48:50 +00:00
|
|
|
|
* Defines an extension for maximising posting performance - this option
|
|
|
|
|
* is NOT adjustable for the default notification center.
|
2004-06-22 22:27:39 +00:00
|
|
|
|
*/
|
|
|
|
|
@interface NSNotificationCenter (GNUstep)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* You can disable locking in a multi-threaded program if you KNOW that only
|
|
|
|
|
* one thread will ever use the notification center.
|
|
|
|
|
*/
|
1999-06-24 19:30:29 +00:00
|
|
|
|
- (BOOL) setLockingDisabled: (BOOL)flag;
|
|
|
|
|
@end
|
|
|
|
|
#endif
|
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
|
#endif /*__NSNotification_h_GNUSTEP_BASE_INCLUDE */
|