]> err.no Git - sope/blob - sope-ical/NGiCal/iCalFreeBusy.m
import of overhauled version of versitSaxDriver
[sope] / sope-ical / NGiCal / iCalFreeBusy.m
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo 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
9   later version.
10
11   OGo 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.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include "iCalFreeBusy.h"
24 #include "iCalPerson.h"
25 #include "common.h"
26
27 @implementation iCalFreeBusy
28
29 - (void)dealloc {
30   [self->entries   release];
31   [self->organizer release];
32   [self->startDate release];
33   [self->endDate   release];
34   [self->url       release];
35   [super dealloc];
36 }
37
38 /* accessors */
39
40 - (void)setUrl:(NSString *)_url {
41   ASSIGN(self->url, _url);
42 }
43 - (NSString *)url {
44   return self->url;
45 }
46
47 - (void)setStartDate:(NSCalendarDate *)_date {
48   ASSIGN(self->startDate, _date);
49 }
50 - (NSCalendarDate *)startDate {
51   return self->startDate;
52 }
53
54 - (void)setEndDate:(NSCalendarDate *)_date {
55   ASSIGN(self->endDate, _date);
56 }
57 - (NSCalendarDate *)endDate {
58   return self->endDate;
59 }
60
61 - (void)setOrganizer:(iCalPerson *)_organizer {
62   ASSIGN(self->organizer, _organizer);
63 }
64 - (iCalPerson *)organizer {
65   return self->organizer;
66 }
67
68 - (void)addToEntries:(id)_obj {
69   if (_obj == nil) return;
70   if (self->entries == nil)
71     self->entries = [[NSMutableArray alloc] initWithCapacity:1];
72   [self->entries addObject:_obj];
73 }
74
75 /* ical typing */
76
77 - (NSString *)entityName {
78   return @"vfreebusy";
79 }
80
81 /* descriptions */
82
83 - (NSString *)description {
84   NSMutableString *ms;
85
86   ms = [NSMutableString stringWithCapacity:128];
87   [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
88
89   if (self->startDate) [ms appendFormat:@" from=%@", self->startDate];
90   if (self->endDate)   [ms appendFormat:@" to=%@", self->endDate];
91   
92   if (self->organizer)
93     [ms appendFormat:@" organizer=%@", self->organizer];
94   
95   if ([self->entries count] > 0)
96     [ms appendFormat:@" %@", self->entries];
97   
98   [ms appendString:@">"];
99   return ms;
100 }
101
102 @end /* iCalFreeBusy */