]> err.no Git - scalable-opengroupware.org/blob - SOPE/NGCards/iCalAlarm.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1178 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / SOPE / NGCards / iCalAlarm.m
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #import <Foundation/NSString.h>
23
24 #import "iCalAttachment.h"
25 #import "iCalRecurrenceRule.h"
26 #import "iCalTrigger.h"
27
28 #import "iCalAlarm.h"
29
30 @implementation iCalAlarm
31
32 - (Class) classForTag: (NSString *) classTag
33 {
34   Class tagClass;
35
36   if ([classTag isEqualToString: @"TRIGGER"])
37     tagClass = [iCalTrigger class];
38   else if ([classTag isEqualToString: @"ATTACH"])
39     tagClass = [iCalAttachment class];
40   else if ([classTag isEqualToString: @"RRULE"])
41     tagClass = [iCalRecurrenceRule class];
42   else if ([classTag isEqualToString: @"ACTION"]
43            || [classTag isEqualToString: @"COMMENT"])
44     tagClass = [CardElement class];
45   else
46     tagClass = [super classForTag: classTag];
47
48   return tagClass;
49 }
50
51 /* accessors */
52
53 - (void) setTrigger: (iCalTrigger *) _value
54 {
55   [self setUniqueChild: _value];
56 }
57
58 - (iCalTrigger *) trigger
59 {
60   return (iCalTrigger *) [self uniqueChildWithTag: @"trigger"];
61 }
62
63 - (void) setAttach: (iCalAttachment *) _value
64 {
65   [self setUniqueChild: _value];
66 }
67
68 - (iCalAttachment *) attach
69 {
70   return (iCalAttachment *) [self uniqueChildWithTag: @"attach"];
71 }
72
73 - (void) setComment: (NSString *) _value
74 {
75   [[self uniqueChildWithTag: @"comment"] setValue: 0
76                                          to: _value];
77 }
78
79 - (NSString *) comment
80 {
81   return [[self uniqueChildWithTag: @"comment"] value: 0];
82 }
83
84 - (void) setAction: (NSString *) _value
85 {
86   [[self uniqueChildWithTag: @"action"] setValue: 0
87                                         to: _value];
88 }
89
90 - (NSString *) action
91 {
92   return [[self uniqueChildWithTag: @"action"] value: 0];
93 }
94
95 - (void) setRecurrenceRule: (NSString *) _recurrenceRule
96 {
97   [[self uniqueChildWithTag: @"rrule"] setValue: 0
98                                        to: _recurrenceRule];
99 }
100
101 - (NSString *) recurrenceRule
102 {
103   return [[self uniqueChildWithTag: @"rrule"] value: 0];
104 }
105
106 @end /* iCalAlarm */