2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
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
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.
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
22 #import <Foundation/NSString.h>
24 #import "iCalAttachment.h"
25 #import "iCalRecurrenceRule.h"
26 #import "iCalTrigger.h"
30 @implementation iCalAlarm
32 - (Class) classForTag: (NSString *) classTag
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];
46 tagClass = [super classForTag: classTag];
53 - (void) setTrigger: (iCalTrigger *) _value
55 [self setUniqueChild: _value];
58 - (iCalTrigger *) trigger
60 return (iCalTrigger *) [self uniqueChildWithTag: @"trigger"];
63 - (void) setAttach: (iCalAttachment *) _value
65 [self setUniqueChild: _value];
68 - (iCalAttachment *) attach
70 return (iCalAttachment *) [self uniqueChildWithTag: @"attach"];
73 - (void) setComment: (NSString *) _value
75 [[self uniqueChildWithTag: @"comment"] setValue: 0
79 - (NSString *) comment
81 return [[self uniqueChildWithTag: @"comment"] value: 0];
84 - (void) setAction: (NSString *) _value
86 [[self uniqueChildWithTag: @"action"] setValue: 0
92 return [[self uniqueChildWithTag: @"action"] value: 0];
95 - (void) setRecurrenceRule: (NSString *) _recurrenceRule
97 [[self uniqueChildWithTag: @"rrule"] setValue: 0
101 - (NSString *) recurrenceRule
103 return [[self uniqueChildWithTag: @"rrule"] value: 0];