2
NSDistributedNotification.m
4
Copyright (C) 1999 MDlink online service center, Helge Hess
7
Author: Helge Hess <helge.hess@mdlink.de>
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
#include "NSDistributedNotificationCenter.h"
27
NSString *NSLocalNotificationCenterType = @"NSLocalNotificationCenter";
30
static NSDistributedNotificationCenter *defaultCenter = nil;
32
@implementation NSDistributedNotificationCenter
34
+ (NSDistributedNotificationCenter *)notificationCenterForType:(NSString *)_type
36
if ([_type isEqualToString:NSLocalNotificationCenterType]) {
37
if (defaultCenter == nil)
38
defaultCenter = [[self alloc] init];
45
+ (NSNotificationCenter *)defaultCenter
47
return [self notificationCenterForType:NSLocalNotificationCenterType];
52
- (void)addObserver:(id)_observer selector:(SEL)_selector
53
name:(NSString *)_notificationName object:(NSString *)_object
54
suspensionBehavior:(NSNotificationSuspensionBehavior)_suspbehave
56
[self notImplemented:_cmd];
59
- (void)addObserver:(id)_observer selector:(SEL)_selector
60
name:(NSString *)_notificationName object:(id)_object
62
[self addObserver:_object selector:_selector
63
name:_notificationName object:_object
64
suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce];
67
- (void)removeObserver:(id)observer
68
name:(NSString*)notificationName object:(id)object
70
[self notImplemented:_cmd];
75
- (void)postNotificationName:(NSString *)_name object:(id)_object
76
userInfo:(NSDictionary *)_ui deliverImmediatly:(BOOL)_flag
78
[self notImplemented:_cmd];
81
- (void)postNotificationName:(NSString *)_name object:(id)_object
83
[self postNotificationName:_name
86
deliverImmediatly:NO];
89
- (void)postNotificationName:(NSString *)_name object:(id)_object
90
userInfo:(NSDictionary *)_userInfo
92
[self postNotificationName:_name
95
deliverImmediatly:NO];
98
- (void)postNotification:(NSNotification *)_notification
100
[self postNotificationName:[_notification name]
101
object:[_notification object]
102
userInfo:[_notification userInfo]
103
deliverImmediatly:NO];
108
- (void)setSuspended:(BOOL)_flag
116
@end /* NSDistributedNotificationCenter */