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
|
2007-09-14 11:36:11 +00:00
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1996-02-13 16:09:50 +00:00
|
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1996-02-13 16:09:50 +00:00
|
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
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
|
2006-10-31 07:05:46 +00:00
|
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
#import <Foundation/NSMapTable.h>
|
1996-02-13 16:09:50 +00:00
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
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>
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-12 18:36:37 +00:00
|
|
|
|
@interface NSNotificationCenter : NSObject
|
1999-06-17 13:17:28 +00:00
|
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
|
#if GS_EXPOSE(NSNotificationCenter)
|
|
|
|
|
@private
|
1999-09-16 07:21:34 +00:00
|
|
|
|
void *_table;
|
2010-02-14 10:48:10 +00:00
|
|
|
|
#endif
|
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
|
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
}
|
1999-06-24 19:30:29 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
|
#endif /*__NSNotification_h_GNUSTEP_BASE_INCLUDE */
|