]> err.no Git - sope/blob - sope-ical/NGiCal/iCalAlarm.m
b7a20dd6877becaf0ae5d51dc3a312cf95a84669
[sope] / sope-ical / NGiCal / 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 #include "iCalAlarm.h"
23 #include "common.h"
24
25 @implementation iCalAlarm
26
27 - (void)dealloc {
28   [self->trigger        release];
29   [self->comment        release];
30   [self->action         release];
31   [self->attach         release];
32   [self->recurrenceRule release];
33   [super dealloc];
34 }
35
36 /* NSCopying */
37
38 - (id)copyWithZone:(NSZone *)_zone {
39   iCalAlarm *new;
40   
41   new = [super copyWithZone:_zone];
42   
43   ASSIGNCOPY(new->trigger,        self->trigger);
44   ASSIGNCOPY(new->comment,        self->comment);
45   ASSIGNCOPY(new->action,         self->action);
46   ASSIGNCOPY(new->attach,         self->attach);
47   ASSIGNCOPY(new->recurrenceRule, self->recurrenceRule);
48   
49   return new;
50 }
51
52 /* accessors */
53
54 - (void)setTrigger:(id)_value {
55   ASSIGN(self->trigger, _value);
56 }
57 - (id)trigger {
58   return self->trigger;
59 }
60
61 - (void)setAttach:(id)_value {
62   ASSIGN(self->attach, _value);
63 }
64 - (id)attach {
65   return self->attach;
66 }
67
68 - (void)setComment:(NSString *)_value {
69   ASSIGNCOPY(self->comment, _value);
70 }
71 - (NSString *)comment {
72   return self->comment;
73 }
74
75 - (void)setAction:(NSString *)_value {
76   ASSIGNCOPY(self->action, _value);
77 }
78 - (NSString *)action {
79   return self->action;
80 }
81
82 - (void)setRecurrenceRule:(NSString *)_recurrenceRule {
83   ASSIGN(self->recurrenceRule, _recurrenceRule);
84 }
85 - (NSString *)recurrenceRule {
86   return self->recurrenceRule;
87 }
88
89 /* descriptions */
90
91 - (NSString *)description {
92   NSMutableString *ms;
93
94   ms = [NSMutableString stringWithCapacity:128];
95   [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
96
97   if (self->action)
98     [ms appendFormat:@" action=%@", self->action];
99   if (self->comment)
100     [ms appendFormat:@" comment=%@", self->comment];
101   if (self->trigger)
102     [ms appendFormat:@" trigger=%@", self->trigger];
103   if (self->recurrenceRule)
104     [ms appendFormat:@" recurrenceRule=%@", self->recurrenceRule];
105   
106   [ms appendString:@">"];
107   return ms;
108 }
109
110 @end /* iCalAlarm */