2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OGo
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
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.
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
23 #include <NGObjWeb/NGObjWeb.h>
25 @interface UIxCalInlineAptView : WOComponent
40 #include <SOGoUI/SOGoAptFormatter.h>
41 #include <SOGo/SOGoUser.h>
42 #include <NGObjWeb/WOContext+SoObjects.h>
44 @implementation UIxCalInlineAptView
47 [self->appointment release];
48 [self->formatter release];
49 [self->tooltipFormatter release];
51 [self->style release];
52 [self->queryDictionary release];
53 [self->referenceDate release];
57 - (void)setAppointment:(id)_appointment {
58 ASSIGN(self->appointment, _appointment);
61 return self->appointment;
64 - (void)setFormatter:(id)_formatter {
65 ASSIGN(self->formatter, _formatter);
68 return self->formatter;
71 - (void)setTooltipFormatter:(id)_tooltipFormatter {
72 ASSIGN(self->tooltipFormatter, _tooltipFormatter);
74 - (id)tooltipFormatter {
75 return self->tooltipFormatter;
78 - (void)setUrl:(id)_url {
79 ASSIGN(self->url, _url);
85 - (void)setStyle:(id)_style {
92 ms = [NSMutableString stringWithString:_style];
95 ms = (NSMutableString *)[NSMutableString string];
97 if ((prio = [self->appointment valueForKey:@"priority"])) {
98 [ms appendFormat:@" apt_prio%@", prio];
100 email = [[[self context] activeUser] email];
101 if ((s = [self->appointment valueForKey:@"orgmail"])) {
102 if ([s rangeOfString:email].length > 0) {
103 [ms appendString:@" apt_organizer"];
106 [ms appendString:@" apt_other"];
109 if ((s = [self->appointment valueForKey:@"partmails"])) {
110 if ([s rangeOfString:email].length > 0) {
111 [ms appendString:@" apt_participant"];
114 [ms appendString:@" apt_nonparticipant"];
117 ASSIGNCOPY(self->style, ms);
123 - (void)setQueryDictionary:(id)_queryDictionary {
124 ASSIGN(self->queryDictionary, _queryDictionary);
126 - (id)queryDictionary {
127 return self->queryDictionary;
130 - (void)setReferenceDate:(id)_referenceDate {
131 ASSIGN(self->referenceDate, _referenceDate);
133 - (id)referenceDate {
134 return self->referenceDate;
137 - (void)setCanAccess:(BOOL)_canAccess {
138 self->canAccess = _canAccess;
141 return self->canAccess;
146 - (NSString *)title {
147 return [self->formatter stringForObjectValue:self->appointment
148 referenceDate:[self referenceDate]];
151 - (NSString *)tooltip {
152 return [self->tooltipFormatter stringForObjectValue:self->appointment
153 referenceDate:[self referenceDate]];