~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to libFoundation/Foundation/NSDistributedNotificationCenter.m

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
   NSDistributedNotification.m
 
3
 
 
4
   Copyright (C) 1999 MDlink online service center, Helge Hess
 
5
   All rights reserved.
 
6
   
 
7
   Author: Helge Hess <helge.hess@mdlink.de>
 
8
 
 
9
   This file is part of libFoundation.
 
10
 
 
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
 
15
   documentation.
 
16
 
 
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.
 
23
*/
 
24
 
 
25
#include "NSDistributedNotificationCenter.h"
 
26
 
 
27
NSString *NSLocalNotificationCenterType = @"NSLocalNotificationCenter";
 
28
 
 
29
// MT
 
30
static NSDistributedNotificationCenter *defaultCenter = nil;
 
31
 
 
32
@implementation NSDistributedNotificationCenter
 
33
 
 
34
+ (NSDistributedNotificationCenter *)notificationCenterForType:(NSString *)_type
 
35
{
 
36
    if ([_type isEqualToString:NSLocalNotificationCenterType]) {
 
37
        if (defaultCenter == nil)
 
38
            defaultCenter = [[self alloc] init];
 
39
        return defaultCenter;
 
40
    }
 
41
    else
 
42
        return nil;
 
43
}
 
44
 
 
45
+ (NSNotificationCenter *)defaultCenter
 
46
{
 
47
    return [self notificationCenterForType:NSLocalNotificationCenterType];
 
48
}
 
49
 
 
50
/* observers */
 
51
 
 
52
- (void)addObserver:(id)_observer selector:(SEL)_selector
 
53
  name:(NSString *)_notificationName object:(NSString *)_object
 
54
  suspensionBehavior:(NSNotificationSuspensionBehavior)_suspbehave
 
55
{
 
56
    [self notImplemented:_cmd];
 
57
}
 
58
 
 
59
- (void)addObserver:(id)_observer selector:(SEL)_selector
 
60
  name:(NSString *)_notificationName object:(id)_object
 
61
{
 
62
    [self addObserver:_object selector:_selector
 
63
          name:_notificationName object:_object
 
64
          suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce];
 
65
}
 
66
 
 
67
- (void)removeObserver:(id)observer 
 
68
  name:(NSString*)notificationName object:(id)object
 
69
{
 
70
    [self notImplemented:_cmd];
 
71
}
 
72
 
 
73
/* posting */
 
74
 
 
75
- (void)postNotificationName:(NSString *)_name object:(id)_object
 
76
  userInfo:(NSDictionary *)_ui deliverImmediatly:(BOOL)_flag
 
77
{
 
78
    [self notImplemented:_cmd];
 
79
}
 
80
 
 
81
- (void)postNotificationName:(NSString *)_name object:(id)_object
 
82
{
 
83
    [self postNotificationName:_name
 
84
          object:_object
 
85
          userInfo:nil
 
86
          deliverImmediatly:NO];
 
87
}
 
88
 
 
89
- (void)postNotificationName:(NSString *)_name object:(id)_object
 
90
  userInfo:(NSDictionary *)_userInfo
 
91
{
 
92
    [self postNotificationName:_name
 
93
          object:_object
 
94
          userInfo:_userInfo
 
95
          deliverImmediatly:NO];
 
96
}
 
97
 
 
98
- (void)postNotification:(NSNotification *)_notification
 
99
{
 
100
    [self postNotificationName:[_notification name]
 
101
          object:[_notification object]
 
102
          userInfo:[_notification userInfo]
 
103
          deliverImmediatly:NO];
 
104
}
 
105
 
 
106
/* suspension */
 
107
 
 
108
- (void)setSuspended:(BOOL)_flag
 
109
{
 
110
}
 
111
- (BOOL)suspended
 
112
{
 
113
    return NO;
 
114
}
 
115
 
 
116
@end /* NSDistributedNotificationCenter */
 
117
 
 
118
/*
 
119
  Local Variables:
 
120
  c-basic-offset: 4
 
121
  tab-width: 8
 
122
  End:
 
123
*/