Monotone-Parent: 8ab9d905be81b1d017b03c8d69c362e0ec19bcf4
Monotone-Revision: c7c119b8830f974eae43854ab61fdff9fc0c72d3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T17:37:38 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
f70b250729
commit
aa8a110edf
|
@ -1,3 +1,8 @@
|
|||
2010-08-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalAlarm.m (-setComment, -setSummary, -setAction)
|
||||
(-setAttendees): new accessors.
|
||||
|
||||
2010-08-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalAlarm.m (-nextAlarmDate): new utility method split from the
|
||||
|
|
|
@ -41,6 +41,15 @@
|
|||
- (void) setRecurrenceRule: (NSString *) _recurrenceRule;
|
||||
- (NSString *) recurrenceRule;
|
||||
|
||||
- (void) setSummary: (NSString *) summary;
|
||||
- (NSString *) summary;
|
||||
- (void) setComment: (NSString *) comment;
|
||||
- (NSString *) comment;
|
||||
|
||||
- (void) setAttendees: (NSArray *) attendees;
|
||||
- (NSArray *) attendees;
|
||||
- (void) removeAllAttendees;
|
||||
|
||||
- (NSCalendarDate *) nextAlarmDate;
|
||||
|
||||
@end
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
@ -44,8 +45,12 @@
|
|||
tagClass = [iCalAttachment class];
|
||||
else if ([classTag isEqualToString: @"RRULE"])
|
||||
tagClass = [iCalRecurrenceRule class];
|
||||
else if ([classTag isEqualToString: @"ATTENDEE"])
|
||||
tagClass = [iCalPerson class];
|
||||
else if ([classTag isEqualToString: @"ACTION"]
|
||||
|| [classTag isEqualToString: @"COMMENT"])
|
||||
|| [classTag isEqualToString: @"COMMENT"]
|
||||
|| [classTag isEqualToString: @"DESCRIPTION"]
|
||||
|| [classTag isEqualToString: @"SUMMARY"])
|
||||
tagClass = [CardElement class];
|
||||
else
|
||||
tagClass = [super classForTag: classTag];
|
||||
|
@ -75,17 +80,6 @@
|
|||
return (iCalAttachment *) [self uniqueChildWithTag: @"attach"];
|
||||
}
|
||||
|
||||
- (void) setComment: (NSString *) _value
|
||||
{
|
||||
[[self uniqueChildWithTag: @"comment"] setValue: 0
|
||||
to: _value];
|
||||
}
|
||||
|
||||
- (NSString *) comment
|
||||
{
|
||||
return [[self uniqueChildWithTag: @"comment"] value: 0];
|
||||
}
|
||||
|
||||
- (void) setAction: (NSString *) _value
|
||||
{
|
||||
[[self uniqueChildWithTag: @"action"] setValue: 0
|
||||
|
@ -97,12 +91,50 @@
|
|||
return [[self uniqueChildWithTag: @"action"] value: 0];
|
||||
}
|
||||
|
||||
- (void) setSummary: (NSString *) _value
|
||||
{
|
||||
[[self uniqueChildWithTag: @"summary"] setValue: 0
|
||||
to: _value];
|
||||
}
|
||||
|
||||
- (NSString *) summary
|
||||
{
|
||||
return [[self uniqueChildWithTag: @"summary"] value: 0];
|
||||
}
|
||||
|
||||
- (void) setComment: (NSString *) _value
|
||||
{
|
||||
[[self uniqueChildWithTag: @"description"] setValue: 0
|
||||
to: _value];
|
||||
}
|
||||
|
||||
- (NSString *) comment
|
||||
{
|
||||
return [[self uniqueChildWithTag: @"description"] value: 0];
|
||||
}
|
||||
|
||||
- (void) setRecurrenceRule: (NSString *) _recurrenceRule
|
||||
{
|
||||
[[self uniqueChildWithTag: @"rrule"] setValue: 0
|
||||
to: _recurrenceRule];
|
||||
}
|
||||
|
||||
- (void) setAttendees: (NSArray *) attendees
|
||||
{
|
||||
[self removeAllAttendees];
|
||||
[self addChildren: attendees];
|
||||
}
|
||||
|
||||
- (NSArray *) attendees
|
||||
{
|
||||
return [self childrenWithTag: @"attendee"];
|
||||
}
|
||||
|
||||
- (void) removeAllAttendees
|
||||
{
|
||||
[children removeObjectsInArray: [self attendees]];
|
||||
}
|
||||
|
||||
- (NSString *) recurrenceRule
|
||||
{
|
||||
return [[self uniqueChildWithTag: @"rrule"] value: 0];
|
||||
|
@ -110,7 +142,6 @@
|
|||
|
||||
- (NSCalendarDate *) nextAlarmDate
|
||||
{
|
||||
Class parentClass;
|
||||
iCalTrigger *aTrigger;
|
||||
NSCalendarDate *relationDate, *nextAlarmDate;
|
||||
NSString *relation;
|
||||
|
@ -121,19 +152,19 @@
|
|||
|
||||
nextAlarmDate = nil;
|
||||
|
||||
parentClass = [parent class];
|
||||
if ([parentClass isKindOfClass: [iCalEvent class]]
|
||||
|| [parentClass isKindOfClass: [iCalToDo class]])
|
||||
if ([parent isKindOfClass: [iCalEvent class]]
|
||||
|| [parent isKindOfClass: [iCalToDo class]])
|
||||
{
|
||||
aTrigger = [self trigger];
|
||||
|
||||
if ([[aTrigger valueType] caseInsensitiveCompare: @"DURATION"])
|
||||
if ([[aTrigger valueType] caseInsensitiveCompare: @"DURATION"]
|
||||
== NSOrderedSame)
|
||||
{
|
||||
relation = [aTrigger relationType];
|
||||
anInterval = [[aTrigger value] durationAsTimeInterval];
|
||||
if ([relation caseInsensitiveCompare: @"END"] == NSOrderedSame)
|
||||
{
|
||||
if ([parentClass isKindOfClass: [iCalEvent class]])
|
||||
if ([parent isKindOfClass: [iCalEvent class]])
|
||||
relationDate = [(iCalEvent *) parent endDate];
|
||||
else
|
||||
relationDate = [(iCalToDo *) parent due];
|
||||
|
@ -148,7 +179,7 @@
|
|||
}
|
||||
else
|
||||
[self warnWithFormat: @"alarms not handled for elements of class '%@'",
|
||||
NSStringFromClass (parentClass)];
|
||||
NSStringFromClass ([parent class])];
|
||||
|
||||
return nextAlarmDate;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue