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"
26 #import "iCalDateTime.h"
29 @implementation iCalToDo
31 - (Class) classForTag: (NSString *) classTag
35 if ([classTag isEqualToString: @"DUE"]
36 || [classTag isEqualToString: @"COMPLETED"])
37 tagClass = [iCalDateTime class];
38 else if ([classTag isEqualToString: @"PERCENT-COMPLETE"])
39 tagClass = [CardElement class];
41 tagClass = [super classForTag: classTag];
48 - (void) setPercentComplete: (NSString *) _value
50 [[self uniqueChildWithTag: @"percent-complete"] setValue: 0
54 - (NSString *) percentComplete
56 return [[self uniqueChildWithTag: @"percent-complete"] value: 0];
59 - (void) setDue: (NSCalendarDate *) newDueDate
61 [(iCalDateTime *) [self uniqueChildWithTag: @"due"]
62 setDateTime: newDueDate];
65 - (NSCalendarDate *) due
67 return [(iCalDateTime *) [self uniqueChildWithTag: @"due"]
71 - (void) setCompleted: (NSCalendarDate *) newCompletedDate
73 [(iCalDateTime *) [self uniqueChildWithTag: @"completed"]
74 setDate: newCompletedDate];
75 [self setStatus: @"COMPLETED"];
78 - (NSCalendarDate *) completed
80 return [(iCalDateTime *) [self uniqueChildWithTag: @"completed"]
86 - (NSString *) entityName
93 // - (NSString *)description {
94 // NSMutableString *ms;
96 // ms = [NSMutableString stringWithCapacity:128];
97 // [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
99 // if (uid) [ms appendFormat:@" uid=%@", uid];
100 // if (startDate) [ms appendFormat:@" start=%@", startDate];
101 // if (due) [ms appendFormat:@" due=%@", due];
102 // if (priority) [ms appendFormat:@" pri=%@", priority];
105 // [ms appendFormat:@" completed=%@", completed];
106 // if (percentComplete)
107 // [ms appendFormat:@" complete=%@", percentComplete];
109 // [ms appendFormat:@" class=%@", accessClass];
112 // [ms appendFormat:@" summary=%@", summary];
114 // [ms appendString:@">"];