2009-11-29 05:19:32 +01:00
|
|
|
/* SOGoUserDefaults.m - this file is part of SOGo
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Inverse inc.
|
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@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/NSDictionary.h>
|
|
|
|
#import <Foundation/NSString.h>
|
|
|
|
#import <Foundation/NSTimeZone.h>
|
|
|
|
|
2009-11-19 18:08:47 +01:00
|
|
|
#import "NSString+Utilities.h"
|
2009-11-29 05:19:32 +01:00
|
|
|
#import "SOGoDomainDefaults.h"
|
|
|
|
#import "SOGoSystemDefaults.h"
|
|
|
|
#import "SOGoUserProfile.h"
|
2007-06-19 19:59:09 +02:00
|
|
|
|
2008-07-25 19:52:49 +02:00
|
|
|
#import "SOGoUserDefaults.h"
|
2009-11-29 05:19:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
NSString *SOGoWeekStartJanuary1 = @"January1";
|
|
|
|
NSString *SOGoWeekStartFirst4DayWeek = @"First4DayWeek";
|
|
|
|
NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2008-07-25 19:52:49 +02:00
|
|
|
@implementation SOGoUserDefaults
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
+ (NSString *) userProfileClassName
|
|
|
|
{
|
|
|
|
return @"SOGoSQLUserProfile";
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
+ (SOGoUserDefaults *) defaultsForUser: (NSString *) userId
|
|
|
|
inDomain: (NSString *) domainId
|
|
|
|
{
|
|
|
|
SOGoUserProfile *up;
|
|
|
|
SOGoUserDefaults *ud;
|
2010-04-20 23:30:17 +02:00
|
|
|
SOGoDefaultsSource *parent;
|
2009-12-02 22:18:22 +01:00
|
|
|
static Class SOGoUserProfileKlass = Nil;
|
|
|
|
|
|
|
|
if (!SOGoUserProfileKlass)
|
|
|
|
SOGoUserProfileKlass = NSClassFromString ([self userProfileClassName]);
|
2009-11-29 05:19:32 +01:00
|
|
|
|
|
|
|
up = [SOGoUserProfileKlass userProfileWithType: SOGoUserProfileTypeDefaults
|
|
|
|
forUID: userId];
|
|
|
|
[up fetchProfile];
|
|
|
|
// if ([_defaults values])
|
|
|
|
// {
|
|
|
|
// BOOL b;
|
|
|
|
// b = NO;
|
|
|
|
|
|
|
|
// if (![[_defaults stringForKey: @"MessageCheck"] length])
|
|
|
|
// {
|
|
|
|
// [_defaults setObject: defaultMessageCheck forKey: @"MessageCheck"];
|
|
|
|
// b = YES;
|
|
|
|
// }
|
|
|
|
// if (![[_defaults stringForKey: @"TimeZone"] length])
|
|
|
|
// {
|
|
|
|
// [_defaults setObject: [serverTimeZone name] forKey: @"TimeZone"];
|
|
|
|
// b = YES;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (b)
|
|
|
|
// [_defaults synchronize];
|
|
|
|
|
|
|
|
|
|
|
|
// See explanation in -language
|
|
|
|
// [self invalidateLanguage];
|
|
|
|
// }
|
|
|
|
|
2010-04-20 23:30:17 +02:00
|
|
|
parent = [SOGoDomainDefaults defaultsForDomain: domainId];
|
|
|
|
if (!parent)
|
|
|
|
parent = [SOGoSystemDefaults sharedSystemDefaults];
|
2009-11-29 05:19:32 +01:00
|
|
|
|
2010-04-20 23:30:17 +02:00
|
|
|
ud = [self defaultsSourceWithSource: up andParentSource: parent];
|
2009-11-29 05:19:32 +01:00
|
|
|
|
|
|
|
return ud;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) _migrateLastModule
|
|
|
|
{
|
|
|
|
BOOL rc;
|
|
|
|
NSString *loginModule;
|
|
|
|
|
|
|
|
loginModule = [source objectForKey: @"SOGoUIxLastModule"];
|
|
|
|
if ([loginModule length])
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
rc = YES;
|
|
|
|
/* we need to use the old key, otherwise the migration will be blocked */
|
|
|
|
[self setObject: loginModule forKey: @"SOGoUIxDefaultModule"];
|
|
|
|
[self setRememberLastModule: YES];
|
|
|
|
[self removeObjectForKey: @"SOGoUIxLastModule"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
2009-11-29 05:19:32 +01:00
|
|
|
else
|
|
|
|
rc = NO;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
return rc;
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) _migrateSignature
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
BOOL rc;
|
|
|
|
NSString *signature;
|
|
|
|
NSArray *mailAccounts, *identities;
|
|
|
|
NSDictionary *identity;
|
|
|
|
|
|
|
|
mailAccounts = [self arrayForKey: @"MailAccounts"];
|
|
|
|
if (mailAccounts)
|
|
|
|
{
|
|
|
|
rc = YES;
|
|
|
|
if ([mailAccounts count] > 0)
|
|
|
|
{
|
|
|
|
identities = [[mailAccounts objectAtIndex: 0]
|
|
|
|
objectForKey: @"identifies"];
|
|
|
|
if ([identities count] > 0)
|
|
|
|
{
|
|
|
|
identity = [identities objectAtIndex: 0];
|
|
|
|
signature = [identity objectForKey: @"signature"];
|
|
|
|
if ([signature length])
|
|
|
|
[self setObject: signature forKey: @"MailSignature"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[self removeObjectForKey: @"MailAccounts"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rc = NO;
|
|
|
|
|
|
|
|
return rc;
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-12-01 17:53:15 +01:00
|
|
|
- (BOOL) _migrateCalendarCategories
|
|
|
|
{
|
|
|
|
NSArray *categories, *colors;
|
|
|
|
NSDictionary *newColors;
|
|
|
|
BOOL rc;
|
|
|
|
|
|
|
|
colors = [source objectForKey: @"SOGoCalendarCategoriesColors"];
|
|
|
|
if ([colors isKindOfClass: [NSArray class]])
|
|
|
|
{
|
|
|
|
categories = [source objectForKey: @"SOGoCalendarCategories"];
|
|
|
|
if ([categories count] == [colors count])
|
|
|
|
{
|
|
|
|
newColors = [NSDictionary dictionaryWithObjects: colors
|
|
|
|
forKeys: categories];
|
|
|
|
[source setObject: newColors
|
|
|
|
forKey: @"SOGoCalendarCategoriesColors"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
[source removeObjectForKey: @"SOGoCalendarCategoriesColors"];
|
|
|
|
rc = YES;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rc = NO;
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) migrate
|
|
|
|
{
|
|
|
|
static NSDictionary *migratedKeys = nil;
|
|
|
|
|
|
|
|
if (!migratedKeys)
|
|
|
|
{
|
|
|
|
migratedKeys
|
|
|
|
= [NSDictionary dictionaryWithObjectsAndKeys:
|
|
|
|
@"SOGoLoginModule", @"SOGoUIxDefaultModule",
|
2009-12-02 21:51:31 +01:00
|
|
|
@"SOGoLoginModule", @"SOGoDefaultModule",
|
2009-11-29 05:19:32 +01:00
|
|
|
@"SOGoTimeFormat", @"TimeFormat",
|
|
|
|
@"SOGoShortDateFormat", @"ShortDateFormat",
|
|
|
|
@"SOGoLongDateFormat", @"LongDateFormat",
|
|
|
|
@"SOGoDayStartTime", @"DayStartTime",
|
|
|
|
@"SOGoDayEndTime", @"DayEndTime",
|
|
|
|
@"SOGoFirstDayOfWeek", @"WeekStartDay",
|
|
|
|
@"SOGoFirstWeekOfYear", @"FirstWeek",
|
|
|
|
@"SOGoLanguage", @"SOGoDefaultLanguage",
|
|
|
|
@"SOGoLanguage", @"Language",
|
|
|
|
@"SOGoMailComposeMessageType", @"ComposeMessagesType",
|
|
|
|
@"SOGoMailMessageCheck", @"MessageCheck",
|
|
|
|
@"SOGoMailMessageForwarding", @"MessageForwarding",
|
|
|
|
@"SOGoMailSignature", @"MailSignature",
|
|
|
|
@"SOGoMailSignaturePlacement", @"SignaturePlacement",
|
|
|
|
@"SOGoMailReplyPlacement", @"ReplyPlacement",
|
|
|
|
@"SOGoTimeZone", @"TimeZone",
|
|
|
|
@"SOGoCalendarShouldDisplayWeekend", @"SOGoShouldDisplayWeekend",
|
|
|
|
@"SOGoMailShowSubscribedFoldersOnly", @"showSubscribedFoldersOnly",
|
|
|
|
@"SOGoReminderEnabled", @"ReminderEnabled",
|
|
|
|
@"SOGoReminderTime", @"ReminderTime",
|
|
|
|
@"SOGoRemindWithASound", @"RemindWithASound",
|
|
|
|
nil];
|
|
|
|
[migratedKeys retain];
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
/* we must not use a boolean operation, otherwise subsequent migrations will
|
|
|
|
not be invoked in the case where rc = YES. */
|
|
|
|
return ([self _migrateLastModule]
|
|
|
|
| [self _migrateSignature]
|
2009-12-01 17:53:15 +01:00
|
|
|
| [self _migrateCalendarCategories]
|
2009-11-29 05:19:32 +01:00
|
|
|
| [self migrateOldDefaultsWithDictionary: migratedKeys]
|
|
|
|
| [super migrate]);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setLoginModule: (NSString *) newLoginModule
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newLoginModule forKey: @"SOGoLoginModule"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) loginModule
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoLoginModule"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setRememberLastModule: (BOOL) rememberLastModule
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setBool: rememberLastModule forKey: @"SOGoRememberLastModule"];
|
2007-03-27 20:12:02 +02:00
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) rememberLastModule
|
|
|
|
{
|
|
|
|
return [self boolForKey: @"SOGoRememberLastModule"];
|
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setAppointmentSendEMailReceipts: (BOOL) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setBool: newValue forKey: @"SOGoAppointmentSendEMailReceipts"];
|
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) appointmentSendEMailReceipts
|
|
|
|
{
|
|
|
|
return [self boolForKey: @"SOGoAppointmentSendEMailReceipts"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setDayStartTime: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoDayStartTime"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) dayStartTime
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoDayStartTime"];
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (unsigned int) dayStartHour
|
|
|
|
{
|
|
|
|
return [[self dayStartTime] timeValue];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setDayEndTime: (NSString *) newValue
|
2009-11-19 21:21:48 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"SOGoDayEndTime"];
|
|
|
|
}
|
2009-11-19 21:21:48 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) dayEndTime
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoDayEndTime"];
|
|
|
|
}
|
2009-11-19 21:21:48 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (unsigned int) dayEndHour
|
|
|
|
{
|
|
|
|
return [[self dayEndTime] timeValue];
|
|
|
|
}
|
2009-11-19 21:21:48 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setTimeZoneName: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoTimeZone"];
|
2009-11-19 21:21:48 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) timeZoneName
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoTimeZone"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setTimeZone: (NSTimeZone *) newValue
|
|
|
|
{
|
|
|
|
[self setTimeZoneName: [newValue name]];
|
|
|
|
}
|
2007-11-01 13:25:21 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSTimeZone *) timeZone
|
|
|
|
{
|
|
|
|
return [NSTimeZone timeZoneWithName: [self timeZoneName]];
|
2009-11-19 18:08:47 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setLongDateFormat: (NSString *) newFormat
|
2009-11-19 18:08:47 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newFormat forKey: @"SOGoLongDateFormat"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) unsetLongDateFormat
|
|
|
|
{
|
|
|
|
[self removeObjectForKey: @"SOGoLongDateFormat"];
|
2009-11-19 18:08:47 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) longDateFormat
|
2009-11-19 18:08:47 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoLongDateFormat"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setShortDateFormat: (NSString *) newFormat;
|
|
|
|
{
|
|
|
|
[self setObject: newFormat forKey: @"SOGoShortDateFormat"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) unsetShortDateFormat
|
|
|
|
{
|
|
|
|
[self removeObjectForKey: @"SOGoShortDateFormat"];
|
2009-11-19 18:08:47 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) shortDateFormat;
|
2009-11-19 18:08:47 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoShortDateFormat"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setTimeFormat: (NSString *) newFormat
|
|
|
|
{
|
|
|
|
[self setObject: newFormat forKey: @"SOGoTimeFormat"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) unsetTimeFormat
|
|
|
|
{
|
|
|
|
[self removeObjectForKey: @"SOGoTimeFormat"];
|
2007-11-01 13:25:21 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) timeFormat
|
2007-11-01 13:25:21 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoTimeFormat"];
|
|
|
|
}
|
2007-11-01 13:25:21 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setLanguage: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoLanguage"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) language
|
|
|
|
{
|
|
|
|
NSString *language;
|
2010-06-23 20:13:48 +02:00
|
|
|
NSArray *supportedLanguages;
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
/* see SOGoDomainDefaults for the meaning of this */
|
|
|
|
language = [source objectForKey: @"SOGoLanguage"];
|
|
|
|
if (!(language && [language isKindOfClass: [NSString class]]))
|
|
|
|
language = [(SOGoDomainDefaults *) parentSource language];
|
2010-06-23 20:13:48 +02:00
|
|
|
|
|
|
|
/* make sure the language is part of the supported languages */
|
|
|
|
supportedLanguages = [[SOGoSystemDefaults sharedSystemDefaults]
|
|
|
|
supportedLanguages];
|
|
|
|
if (![supportedLanguages containsObject: language])
|
|
|
|
language = [parentSource stringForKey: @"SOGoLanguage"];
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
return language;
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailShowSubscribedFoldersOnly: (BOOL) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setBool: newValue forKey: @"SOGoMailShowSubscribedFoldersOnly"];
|
|
|
|
}
|
2007-11-01 13:25:21 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) mailShowSubscribedFoldersOnly
|
|
|
|
{
|
|
|
|
return [self boolForKey: @"SOGoMailShowSubscribedFoldersOnly"];
|
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setDraftsFolderName: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoDraftsFolderName"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) draftsFolderName
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoDraftsFolderName"];
|
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setSentFolderName: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoSentFolderName"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) sentFolderName
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoSentFolderName"];
|
|
|
|
}
|
2009-11-19 20:57:26 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setTrashFolderName: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoTrashFolderName"];
|
2009-11-19 20:57:26 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) trashFolderName
|
2009-11-19 20:57:26 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoTrashFolderName"];
|
|
|
|
}
|
2009-11-19 20:57:26 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setFirstDayOfWeek: (int) newValue
|
|
|
|
{
|
|
|
|
[self setInteger: newValue forKey: @"SOGoFirstDayOfWeek"];
|
|
|
|
}
|
2008-12-02 02:36:53 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (int) firstDayOfWeek
|
|
|
|
{
|
|
|
|
return [self integerForKey: @"SOGoFirstDayOfWeek"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setFirstWeekOfYear: (NSString *) newValue
|
2007-06-19 19:59:09 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"SOGoFirstWeekOfYear"];
|
2007-06-19 19:59:09 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) firstWeekOfYear
|
2008-11-05 22:04:16 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoFirstWeekOfYear"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setMailListViewColumnsOrder: (NSArray *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoMailListViewColumnsOrder"];
|
2009-02-24 02:54:59 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSArray *) mailListViewColumnsOrder
|
2009-02-24 02:54:59 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringArrayForKey: @"SOGoMailListViewColumnsOrder"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailMessageCheck: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoMailMessageCheck"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailMessageCheck
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoMailMessageCheck"];
|
2008-11-05 22:04:16 +01:00
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailComposeMessageType: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoMailComposeMessageType"];
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailComposeMessageType
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoMailComposeMessageType"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailMessageForwarding: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoMailMessageForwarding"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailMessageForwarding
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoMailMessageForwarding"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailReplyPlacement: (NSString *) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"SOGoMailReplyPlacement"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailReplyPlacement
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoMailReplyPlacement"];
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailSignature: (NSString *) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"SOGoMailSignature"];
|
|
|
|
}
|
2009-11-19 18:08:47 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailSignature
|
|
|
|
{
|
|
|
|
return [self stringForKey: @"SOGoMailSignature"];
|
|
|
|
}
|
2009-11-26 20:34:56 +01:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setMailSignaturePlacement: (NSString *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoMailSignaturePlacement"];
|
|
|
|
}
|
2007-03-27 20:12:02 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) mailSignaturePlacement
|
|
|
|
{
|
|
|
|
NSString *signaturePlacement;
|
|
|
|
|
|
|
|
if ([[self mailReplyPlacement] isEqualToString: @"below"])
|
|
|
|
// When replying to an email, if the reply is below the quoted text,
|
|
|
|
// the signature must also be below the quoted text.
|
|
|
|
signaturePlacement = @"below";
|
|
|
|
else
|
|
|
|
signaturePlacement = [self stringForKey: @"SOGoMailSignaturePlacement"];
|
|
|
|
|
|
|
|
return signaturePlacement;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setMailUseOutlookStyleReplies: (BOOL) newValue
|
|
|
|
{
|
|
|
|
[self setBool: newValue forKey: @"SOGoMailUseOutlookStyleReplies"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) mailUseOutlookStyleReplies
|
|
|
|
{
|
|
|
|
return [self boolForKey: @"SOGoMailUseOutlookStyleReplies"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setCalendarCategories: (NSArray *) newValues
|
|
|
|
{
|
|
|
|
[self setObject: newValues forKey: @"SOGoCalendarCategories"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) calendarCategories
|
|
|
|
{
|
|
|
|
return [self stringArrayForKey: @"SOGoCalendarCategories"];
|
|
|
|
}
|
|
|
|
|
2009-12-01 17:53:15 +01:00
|
|
|
- (void) setCalendarCategoriesColors: (NSDictionary *) newValues
|
2009-11-29 05:19:32 +01:00
|
|
|
{
|
|
|
|
[self setObject: newValues forKey: @"SOGoCalendarCategoriesColors"];
|
|
|
|
}
|
|
|
|
|
2009-12-01 17:53:15 +01:00
|
|
|
- (NSDictionary *) calendarCategoriesColors
|
2009-11-29 05:19:32 +01:00
|
|
|
{
|
2009-12-01 17:53:15 +01:00
|
|
|
return [self dictionaryForKey: @"SOGoCalendarCategoriesColors"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setCalendarShouldDisplayWeekend: (BOOL) newValue
|
|
|
|
{
|
|
|
|
[self setBool: newValue forKey: @"SOGoCalendarShouldDisplayWeekend"];
|
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) calendarShouldDisplayWeekend
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self boolForKey: @"SOGoCalendarShouldDisplayWeekend"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setReminderEnabled: (BOOL) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setBool: newValue forKey: @"SOGoReminderEnabled"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) reminderEnabled
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self boolForKey: @"SOGoReminderEnabled"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setReminderTime: (NSString *) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"SOGoReminderTime"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (NSString *) reminderTime
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self stringForKey: @"SOGoReminderTime"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (void) setRemindWithASound: (BOOL) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setBool: newValue forKey: @"SOGoRemindWithASound"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (BOOL) remindWithASound
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self boolForKey: @"SOGoRemindWithASound"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2010-03-02 20:57:30 +01:00
|
|
|
- (void) setSieveFilters: (NSArray *) newValue
|
|
|
|
{
|
|
|
|
[self setObject: newValue forKey: @"SOGoSieveFilters"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) sieveFilters
|
|
|
|
{
|
|
|
|
return [self arrayForKey: @"SOGoSieveFilters"];
|
|
|
|
}
|
|
|
|
|
2009-12-01 15:29:56 +01:00
|
|
|
- (void) setVacationOptions: (NSDictionary *) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"Vacation"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-12-01 15:29:56 +01:00
|
|
|
- (NSDictionary *) vacationOptions
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self dictionaryForKey: @"Vacation"];
|
2007-03-27 20:12:02 +02:00
|
|
|
}
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2009-12-01 15:29:56 +01:00
|
|
|
- (void) setForwardOptions: (NSDictionary *) newValue
|
2007-03-27 20:12:02 +02:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
[self setObject: newValue forKey: @"Forward"];
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
2009-12-01 15:29:56 +01:00
|
|
|
- (NSDictionary *) forwardOptions
|
2009-03-03 20:08:02 +01:00
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
return [self dictionaryForKey: @"Forward"];
|
2009-03-03 20:08:02 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
@end
|