]> err.no Git - scalable-opengroupware.org/blob - SOPE/NGCards/iCalAlarm.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1021 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 "iCalAttachment.h"
23 #import "iCalRecurrenceRule.h"
24 #import "iCalTrigger.h"
25
26 #import "iCalAlarm.h"
27 #import "common.h"
28
29 @implementation iCalAlarm
30
31 - (Class) classForTag: (NSString *) classTag
32 {
33   Class tagClass;
34
35   if ([classTag isEqualToString: @"TRIGGER"])
36     tagClass = [iCalTrigger class];
37   else if ([classTag isEqualToString: @"ATTACH"])
38     tagClass = [iCalAttachment class];
39   else if ([classTag isEqualToString: @"RRULE"])
40     tagClass = [iCalRecurrenceRule class];
41   else if ([classTag isEqualToString: @"ACTION"]
42            || [classTag isEqualToString: @"COMMENT"])
43     tagClass = [CardElement class];
44   else
45     tagClass = [super classForTag: classTag];
46
47   return tagClass;
48 }
49
50 /* accessors */
51
52 - (void) setTrigger: (iCalTrigger *) _value
53 {
54   [self setUniqueChild: _value];
55 }
56
57 - (iCalTrigger *) trigger
58 {
59   return (iCalTrigger *) [self uniqueChildWithTag: @"trigger"];
60 }
61
62 - (void) setAttach: (iCalAttachment *) _value
63 {
64   [self setUniqueChild: _value];
65 }
66
67 - (iCalAttachment *) attach
68 {
69   return (iCalAttachment *) [self uniqueChildWithTag: @"attach"];
70 }
71
72 - (void) setComment: (NSString *) _value
73 {
74   [[self uniqueChildWithTag: @"comment"] setValue: 0
75                                          to: _value];
76 }
77
78 - (NSString *) comment
79 {
80   return [[self uniqueChildWithTag: @"comment"] value: 0];
81 }
82
83 - (void) setAction: (NSString *) _value
84 {
85   [[self uniqueChildWithTag: @"action"] setValue: 0
86                                         to: _value];
87 }
88
89 - (NSString *) action
90 {
91   return [[self uniqueChildWithTag: @"action"] value: 0];
92 }
93
94 - (void) setRecurrenceRule: (NSString *) _recurrenceRule
95 {
96   [[self uniqueChildWithTag: @"rrule"] setValue: 0
97                                        to: _recurrenceRule];
98 }
99
100 - (NSString *) recurrenceRule
101 {
102   return [[self uniqueChildWithTag: @"rrule"] value: 0];
103 }
104
105 @end /* iCalAlarm */