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