~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSNotification.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** Interface for NSNotification and NSNotificationCenter for GNUstep
 
2
   Copyright (C) 1996,1999 Free Software Foundation, Inc.
 
3
 
 
4
   Written by:  Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
 
5
   Rewrite by:  Richard Frith-Macdonald <rfm@gnu.org>
 
6
   Created: March 1996
 
7
 
 
8
   This file is part of the GNUstep Base Library.
 
9
 
 
10
   This library is free software; you can redistribute it and/or
 
11
   modify it under the terms of the GNU Library General Public
 
12
   License as published by the Free Software Foundation; either
 
13
   version 2 of the License, or (at your option) any later version.
 
14
   
 
15
   This library is distributed in the hope that it will be useful,
 
16
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
   Library General Public License for more details.
 
19
 
 
20
   You should have received a copy of the GNU Library General Public
 
21
   License along with this library; if not, write to the Free
 
22
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
23
 
 
24
  AutogsdocSource: NSNotification.m
 
25
  AutogsdocSource: NSNotificationCenter.m
 
26
*/
 
27
 
 
28
#ifndef __NSNotification_h_GNUSTEP_BASE_INCLUDE
 
29
#define __NSNotification_h_GNUSTEP_BASE_INCLUDE
 
30
 
 
31
#include <Foundation/NSObject.h>
 
32
#include <Foundation/NSMapTable.h>
 
33
 
 
34
@class NSString;
 
35
@class NSDictionary;
 
36
@class NSLock;
 
37
 
 
38
@interface NSNotification : NSObject <NSCopying, NSCoding>
 
39
{
 
40
}
 
41
 
 
42
/* Creating a Notification Object */
 
43
+ (NSNotification*) notificationWithName: (NSString*)name
 
44
                                  object: (id)object;
 
45
 
 
46
+ (NSNotification*) notificationWithName: (NSString*)name
 
47
                                  object: (id)object
 
48
                                userInfo: (NSDictionary*)info;
 
49
 
 
50
/* Querying a Notification Object */
 
51
 
 
52
- (NSString*) name;
 
53
- (id) object;
 
54
- (NSDictionary*) userInfo;
 
55
 
 
56
@end
 
57
 
 
58
 
 
59
 
 
60
@interface NSNotificationCenter : NSObject <GCFinalization>
 
61
{
 
62
  void  *_table;
 
63
}
 
64
 
 
65
+ (NSNotificationCenter*) defaultCenter;
 
66
 
 
67
- (void) addObserver: (id)observer
 
68
            selector: (SEL)selector
 
69
                name: (NSString*)name
 
70
              object: (id)object;
 
71
 
 
72
- (void) removeObserver: (id)observer;
 
73
- (void) removeObserver: (id)observer
 
74
                   name: (NSString*)name
 
75
                 object: (id)object;
 
76
 
 
77
- (void) postNotification: (NSNotification*)notification;
 
78
- (void) postNotificationName: (NSString*)name
 
79
                       object: (id)object;
 
80
- (void) postNotificationName: (NSString*)name
 
81
                       object: (id)object
 
82
                     userInfo: (NSDictionary*)info;
 
83
 
 
84
@end
 
85
 
 
86
#ifndef NO_GNUSTEP
 
87
 
 
88
/**
 
89
 * Defines an extension for maximising posting performance - this option
 
90
 * is NOT adjustable for the default notification center.
 
91
 */
 
92
@interface NSNotificationCenter (GNUstep)
 
93
 
 
94
/**
 
95
 * You can disable locking in a multi-threaded program if you KNOW that only
 
96
 * one thread will ever use the notification center.
 
97
 */
 
98
- (BOOL) setLockingDisabled: (BOOL)flag;
 
99
@end
 
100
#endif
 
101
 
 
102
#endif /*__NSNotification_h_GNUSTEP_BASE_INCLUDE */