]> err.no Git - scalable-opengroupware.org/commitdiff
forwarding methods to event
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 28 Jun 2004 18:46:32 +0000 (18:46 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 28 Jun 2004 18:46:32 +0000 (18:46 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@68 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGoLogic/SOGoAppointment.h
SOGoLogic/SOGoAppointment.m

index a85331bcb8b2ca0584fdb93f6033fa75eb2f0e97..c0a3d335e38ce61236dfa5680db2f13462bf9bcc 100644 (file)
 
 #import <Foundation/Foundation.h>
 
+@class iCalPerson;
+
 
 @interface SOGoAppointment : NSObject
 {
+    id calendar;
     id event;
 }
 
-- (id)initWithiCalString:(NSString *)_iCal;
+- (id)initWithICalString:(NSString *)_iCal;
+
+- (void)setUid:(NSString *)_value;
+- (NSString *)uid;
+
+- (void)setSummary:(NSString *)_value;
+- (NSString *)summary;
+
+- (void)setLocation:(NSString *)_value;
+- (NSString *)location;
+
+- (void)setStartDate:(NSCalendarDate *)_date;
+- (NSCalendarDate *)startDate;
+
+- (void)setEndDate:(NSCalendarDate *)_date;
+- (NSCalendarDate *)endDate;
+- (BOOL)hasEndDate;
+
+- (BOOL)hasDuration;
+- (void)setDuration:(NSTimeInterval)_duration;
+- (NSTimeInterval)duration;
+
+- (void)setOrganizer:(iCalPerson *)_organizer;
+- (iCalPerson *)organizer;
+
+- (void)addToAttendees:(iCalPerson *)_person;
+- (NSArray *)attendees;
+
+
+/* do we really need these? */
 
+- (id)calendar;
 - (id)event;
 
 @end
index ede2088ecad642e39cd67cc4a50680b491bcc66c..3fc09d9fafb3467c1596aca50b8099a0bb342339 100644 (file)
 
 #include "SOGoAppointment.h"
 #include <SaxObjC/SaxObjC.h>
+#include <NGiCal/NGiCal.h>
 
 
 @implementation SOGoAppointment
 
-- (id)initWithiCalString:(NSString *)_iCal {
+- (id)initWithICalString:(NSString *)_iCal {
     if ((self = [self init])) {
         id<NSObject,SaxXMLReader> parser;
         SaxObjectDecoder *sax;
@@ -53,7 +54,9 @@
         [parser setErrorHandler:sax];
         
         [parser parseFromSource:_iCal];
-        self->event = [[sax rootObject] retain];
+        self->calendar = [[sax rootObject] retain];
+        self->event = [[[self->calendar events] lastObject] retain];
+
         [parser release];
         [sax release];
     }
 }
 
 - (void)dealloc {
+    [self->calendar release];
     [self->event release];
     [super dealloc];
 }
 
+
+/* accessors */
+
+
+- (id)calendar {
+    return self->calendar;
+}
+
 - (id)event {
     return self->event;
 }
 
+
+/* forwarded methods */
+
+
+- (void)setUid:(NSString *)_value {
+    [self->event setUid:_value];
+}
+- (NSString *)uid {
+    return [self->event uid];
+}
+
+- (void)setSummary:(NSString *)_value {
+    [self->event setSummary:_value];
+}
+- (NSString *)summary {
+    return [self->event summary];
+}
+
+- (void)setLocation:(NSString *)_value {
+    [self->event setLocation:_value];
+}
+- (NSString *)location {
+    return [self->event location];
+}
+
+- (void)setStartDate:(NSCalendarDate *)_date {
+    [self->event setStartDate:_date];
+}
+
+- (NSCalendarDate *)startDate {
+    return [self->event startDate];
+}
+
+- (void)setEndDate:(NSCalendarDate *)_date {
+    [self->event setEndDate:_date];
+}
+- (NSCalendarDate *)endDate {
+    return [self->event endDate];
+}
+- (BOOL)hasEndDate {
+    return [self->event hasEndDate];
+}
+
+- (BOOL)hasDuration {
+    return [self->event hasDuration];
+}
+- (void)setDuration:(NSTimeInterval)_duration {
+}
+- (NSTimeInterval)duration {
+    return [self->event durationAsTimeInterval];
+}
+
+- (void)setOrganizer:(iCalPerson *)_organizer {
+    [self->event setOrganizer:_organizer];
+}
+- (iCalPerson *)organizer {
+    return [self->event organizer];
+}
+
+- (void)addToAttendees:(iCalPerson *)_person {
+    [self->event addToAttendees:_person];
+}
+- (NSArray *)attendees {
+    return [self->event attendees];
+}
+
 @end