2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
21 // $Id: OGoCalWeekOverview.m,v 1.3 2004/06/03 21:56:44 helge Exp $
23 #include "OGoCalWeekView.h"
25 @interface OGoCalWeekOverview : OGoCalWeekView
28 NSCalendarDate *currentDay;
34 #include <Backend/SxAptManager.h>
35 #include "OGoAppointmentFormatter.h"
38 @implementation OGoCalWeekOverview
40 - (NSArray *)appointments {
41 return [self fetchCoreInfos];
44 - (void)setCurrentDay:(NSCalendarDate *)_day {
45 ASSIGN(self->currentDay, _day);
48 - (NSCalendarDate *)currentDay {
49 return self->currentDay;
52 - (NSString *)currentDayName {
53 return [self->currentDay descriptionWithCalendarFormat:@"%A"];
56 - (void)setDayIndex:(char)_idx {
59 if ((self->dayIndex == _idx) && (self->currentDay != nil))
62 self->dayIndex = _idx;
66 dateByAddingYears:0 months:0 days:_idx
67 hours:0 minutes:0 seconds:0];
72 [self setCurrentDay:d];
76 return self->dayIndex;
79 - (NSDictionary *)currentDayQueryParameters {
80 return [self queryParametersBySettingSelectedDate:self->currentDay];
85 - (NSString *)titleStyle {
86 if([self->currentDay isToday])
87 return @"weekoverview_title_hilite";
88 return @"weekoverview_title";
91 - (NSString *)contentStyle {
92 if([self->currentDay isToday])
93 return @"weekoverview_content_hilite";
94 return @"weekoverview_content";
97 - (NSDictionary *)aptTypeDict {
101 - (NSString *)aptTypeLabel {
105 - (NSString *)aptTypeIcon {
109 - (NSString *)shortTextForApt {
110 OGoAppointmentFormatter *f;
112 f = [OGoAppointmentFormatter formatterWithFormat:
113 @"%S - %E;\n%T;\n%L;\n%5P;\n%50R"];
114 [f setRelationDate:[self referenceDateForFormatter]];
115 [f setShowFullNames:[self showFullNames]];
116 if([self showAMPMDates])
117 [f switchToAMPMTimes:YES];
119 return [NSString stringWithFormat:@"%@:\n%@",
121 [f stringForObjectValue:self->appointment]];
128 - (BOOL)hasHoldidayInfo {
131 - (NSArray *)allDayApts {
134 @end /* OGoCalWeekOverview */