NSCalendarDate *endDate;
NSArray *participants; /* array of iCalPerson's */
NSArray *resources; /* array of iCalPerson's */
+ id duration;
}
@end
@implementation UIxAppointmentProposal
- (void)dealloc {
+ [self->duration release];
[self->startDate release];
[self->endDate release];
[self->participants release];
return self->endDate;
}
+- (void)setDuration:(id)_duration {
+ ASSIGN(self->duration, _duration);
+}
+- (id)duration {
+ return self->duration;
+}
+- (int)durationInMinutes {
+ return [[self duration] intValue];
+}
+- (NSTimeInterval)durationAsTimeInterval {
+ return [self durationInMinutes] * 60;
+}
+
+- (NSString *)itemDurationText {
+ // TODO: use a formatter
+ switch ([[self item] intValue]) {
+ case 30: return @"30 minutes";
+ case 60: return @"1 hour";
+ case 120: return @"2 hours";
+ default:
+ return [NSString stringWithFormat:@"%@ minutes", [self item]];
+ }
+}
+
- (void)setParticipants:(NSArray *)_parts {
ASSIGN(self->participants, _parts);
}
return [NSArray arrayWithObjects:@"2004-08-15", nil];
}
+- (NSArray *)durationSteps {
+ // TODO: make configurable
+ return [NSArray arrayWithObjects:@"30", @"60", @"120", nil];
+}
+
/* slots */
- (BOOL)isFirstHalfGreen {
<var:string label:value="Duration" />:
</td>
<td align="left" bgcolor="#FFFFF0" class="aptview_text" >
- duration popup here
+ <var:popup list="durationSteps" item="item"
+ string="itemDurationText"
+ selection="duration" />
</td>
</tr>
<tr><td colspan="2"> </td></tr>