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 #include "iCalFreeBusy.h"
23 #include "iCalPerson.h"
26 @implementation iCalFreeBusy
29 return [super version] + 0 /* v0 */;
32 NSAssert2([super version] == 0,
33 @"invalid superclass (%@) version %i !",
34 NSStringFromClass([self superclass]), [super version]);
38 [self->entries release];
39 [self->organizer release];
40 [self->startDate release];
41 [self->endDate release];
48 - (id)copyWithZone:(NSZone *)_zone {
51 new = [super copyWithZone:_zone];
53 new->entries = [self->entries copyWithZone:_zone];
54 new->organizer = [self->organizer copyWithZone:_zone];
55 new->startDate = [self->startDate copyWithZone:_zone];
56 new->endDate = [self->endDate copyWithZone:_zone];
57 new->url = [self->url copyWithZone:_zone];
64 - (void)setUrl:(NSString *)_url {
65 ASSIGN(self->url, _url);
71 - (void)setStartDate:(NSCalendarDate *)_date {
72 ASSIGN(self->startDate, _date);
74 - (NSCalendarDate *)startDate {
75 return self->startDate;
78 - (void)setEndDate:(NSCalendarDate *)_date {
79 ASSIGN(self->endDate, _date);
81 - (NSCalendarDate *)endDate {
85 - (void)setOrganizer:(iCalPerson *)_organizer {
86 ASSIGN(self->organizer, _organizer);
88 - (iCalPerson *)organizer {
89 return self->organizer;
92 - (void)addToEntries:(id)_obj {
93 if (_obj == nil) return;
94 if (self->entries == nil)
95 self->entries = [[NSMutableArray alloc] initWithCapacity:1];
96 [self->entries addObject:_obj];
101 - (NSString *)entityName {
107 - (NSString *)description {
110 ms = [NSMutableString stringWithCapacity:128];
111 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
113 if (self->startDate) [ms appendFormat:@" from=%@", self->startDate];
114 if (self->endDate) [ms appendFormat:@" to=%@", self->endDate];
117 [ms appendFormat:@" organizer=%@", self->organizer];
119 if ([self->entries count] > 0)
120 [ms appendFormat:@" %@", self->entries];
122 [ms appendString:@">"];
126 @end /* iCalFreeBusy */