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 "NSCalendarDate+NGCards.h"
25 #import "CardGroup+iCal.h"
27 #import "iCalDateTime.h"
30 @implementation iCalToDo
32 - (Class) classForTag: (NSString *) classTag
36 if ([classTag isEqualToString: @"DUE"]
37 || [classTag isEqualToString: @"COMPLETED"])
38 tagClass = [iCalDateTime class];
39 else if ([classTag isEqualToString: @"PERCENT-COMPLETE"])
40 tagClass = [CardElement class];
42 tagClass = [super classForTag: classTag];
49 - (void) setPercentComplete: (NSString *) _value
51 [[self uniqueChildWithTag: @"percent-complete"] setValue: 0
55 - (NSString *) percentComplete
57 return [[self uniqueChildWithTag: @"percent-complete"] value: 0];
60 - (void) setDue: (NSCalendarDate *) _date
63 forDateTimeValue: @"due"];
66 - (NSCalendarDate *) due
68 return [self dateForDateTimeValue: @"due"];
69 // return [[self uniqueChildWithTag: @"percent-complete"] asCalendarDate];
72 - (void) setCompleted: (NSCalendarDate *) _date
74 [self setStatus: @"COMPLETED"];
75 [self setDate: _date forDateTimeValue: @"completed"];
78 - (NSCalendarDate *) completed
80 return [self dateForDateTimeValue: @"completed"];
85 - (NSString *) entityName
92 // - (NSString *)description {
93 // NSMutableString *ms;
95 // ms = [NSMutableString stringWithCapacity:128];
96 // [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
98 // if (uid) [ms appendFormat:@" uid=%@", uid];
99 // if (startDate) [ms appendFormat:@" start=%@", startDate];
100 // if (due) [ms appendFormat:@" due=%@", due];
101 // if (priority) [ms appendFormat:@" pri=%@", priority];
104 // [ms appendFormat:@" completed=%@", completed];
105 // if (percentComplete)
106 // [ms appendFormat:@" complete=%@", percentComplete];
108 // [ms appendFormat:@" class=%@", accessClass];
111 // [ms appendFormat:@" summary=%@", summary];
113 // [ms appendString:@">"];