2008-01-14 14:57:28 +01:00
|
|
|
/* UIxRecurrenceEditor.m - this file is part of SOGo
|
|
|
|
*
|
2008-09-27 03:13:41 +02:00
|
|
|
* Copyright (C) 2008 Inverse inc.
|
2008-01-14 14:57:28 +01:00
|
|
|
*
|
|
|
|
* Author: Ludovic Marcotte <ludovic@inverse.ca>
|
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/NSArray.h>
|
|
|
|
#import <Foundation/NSString.h>
|
|
|
|
|
|
|
|
#import <Common/UIxPageFrame.h>
|
|
|
|
|
|
|
|
#import "UIxRecurrenceEditor.h"
|
|
|
|
|
|
|
|
@implementation UIxRecurrenceEditor
|
|
|
|
|
|
|
|
- (id) defaultAction
|
|
|
|
{
|
|
|
|
[[self parent] setToolbar: @""];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) monthlyRepeatList
|
|
|
|
{
|
|
|
|
static NSArray *monthlyRepeatList = nil;
|
|
|
|
|
|
|
|
if (!monthlyRepeatList)
|
|
|
|
{
|
2008-01-15 22:45:48 +01:00
|
|
|
monthlyRepeatList = [NSArray arrayWithObjects: @"First", @"Second", @"Third",
|
|
|
|
@"Fourth", @"Fift", @"Last", nil];
|
2008-01-14 14:57:28 +01:00
|
|
|
[monthlyRepeatList retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return monthlyRepeatList;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) monthlyDayList
|
|
|
|
{
|
|
|
|
static NSArray *monthlyDayList = nil;
|
|
|
|
|
|
|
|
if (!monthlyDayList)
|
|
|
|
{
|
2008-01-15 22:45:48 +01:00
|
|
|
monthlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday",
|
|
|
|
@"Wednesday", @"Thursday", @"Friday",
|
|
|
|
@"Saturday", @"DayOfTheMonth", nil];
|
2008-01-14 14:57:28 +01:00
|
|
|
[monthlyDayList retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return monthlyDayList;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) yearlyMonthList
|
|
|
|
{
|
|
|
|
static NSArray *yearlyMonthList = nil;
|
|
|
|
|
|
|
|
if (!yearlyMonthList)
|
|
|
|
{
|
2008-01-15 22:45:48 +01:00
|
|
|
yearlyMonthList = [NSArray arrayWithObjects: @"January", @"February", @"March",
|
|
|
|
@"April", @"May", @"June", @"July", @"August",
|
|
|
|
@"September", @"October", @"November", @"December", nil];
|
2008-01-14 14:57:28 +01:00
|
|
|
[yearlyMonthList retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return yearlyMonthList;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) yearlyDayList
|
|
|
|
{
|
|
|
|
static NSArray *yearlyDayList = nil;
|
|
|
|
|
|
|
|
if (!yearlyDayList)
|
|
|
|
{
|
2008-01-15 22:45:48 +01:00
|
|
|
yearlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday",
|
|
|
|
@"Wednesday", @"Thursday", @"Friday",
|
|
|
|
@"Saturday", nil];
|
2008-01-14 14:57:28 +01:00
|
|
|
[yearlyDayList retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return yearlyDayList;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Items used to specify what kind of recurrence we want
|
|
|
|
//
|
|
|
|
- (NSArray *) repeatList
|
|
|
|
{
|
|
|
|
static NSArray *repeatList = nil;
|
|
|
|
|
|
|
|
if (!repeatList)
|
|
|
|
{
|
2008-01-15 22:45:48 +01:00
|
|
|
repeatList = [NSArray arrayWithObjects: @"Daily", @"Weekly",
|
|
|
|
@"Monthly", @"Yearly", nil];
|
2008-01-14 14:57:28 +01:00
|
|
|
[repeatList retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return repeatList;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Accessors
|
|
|
|
//
|
|
|
|
- (void) setItem: (NSString *) theItem
|
|
|
|
{
|
|
|
|
item = theItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) item
|
|
|
|
{
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
2008-01-15 22:45:48 +01:00
|
|
|
- (NSString *) itemText
|
2008-01-14 14:57:28 +01:00
|
|
|
{
|
|
|
|
NSString *text;
|
|
|
|
|
2008-01-15 22:45:48 +01:00
|
|
|
text = [self labelForKey: item];
|
2008-01-14 14:57:28 +01:00
|
|
|
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|