2010-10-01 22:35:29 +02:00
|
|
|
/* MAPIApplication.m - this file is part of SOGo
|
2010-10-01 20:54:30 +02:00
|
|
|
*
|
2010-10-01 22:35:29 +02:00
|
|
|
* Copyright (C) 2010 Inverse inc.
|
2010-10-01 20:54:30 +02:00
|
|
|
*
|
|
|
|
* 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
|
2010-10-18 14:57:31 +02:00
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
2010-10-01 20:54:30 +02:00
|
|
|
* 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/NSUserDefaults.h>
|
2012-03-30 21:51:37 +02:00
|
|
|
#import <Foundation/NSTimeZone.h>
|
2012-07-19 03:26:45 +02:00
|
|
|
#import <WEExtensions/WEResourceManager.h>
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
#import <SOGo/SOGoProductLoader.h>
|
|
|
|
#import <SOGo/SOGoSystemDefaults.h>
|
|
|
|
|
|
|
|
#import <Appointments/iCalEntityObject+SOGo.h>
|
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
#import "MAPIStoreUserContext.h"
|
2012-03-30 21:51:37 +02:00
|
|
|
#import "MAPIStoreTypes.h"
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
#import "MAPIApplication.h"
|
|
|
|
|
|
|
|
MAPIApplication *MAPIApp = nil;
|
|
|
|
|
|
|
|
@implementation MAPIApplication
|
|
|
|
|
2011-08-04 16:11:45 +02:00
|
|
|
+ (BOOL) isCachingEnabled;
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2012-09-13 17:49:22 +02:00
|
|
|
- (NSString *) name
|
|
|
|
{
|
|
|
|
return @"SOGo";
|
|
|
|
}
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
- (id) init
|
|
|
|
{
|
2010-10-01 22:35:29 +02:00
|
|
|
if (!MAPIApp)
|
|
|
|
{
|
2012-07-19 03:26:45 +02:00
|
|
|
WEResourceManager *rm;
|
|
|
|
|
2010-10-01 22:35:29 +02:00
|
|
|
// TODO publish
|
|
|
|
[iCalEntityObject initializeSOGoExtensions];
|
|
|
|
|
|
|
|
MAPIApp = [super init];
|
|
|
|
[MAPIApp retain];
|
2012-03-30 21:51:37 +02:00
|
|
|
|
2012-07-19 03:26:45 +02:00
|
|
|
rm = [[WEResourceManager alloc] init];
|
|
|
|
[self setResourceManager:rm];
|
|
|
|
[rm release];
|
|
|
|
|
2012-03-30 21:51:37 +02:00
|
|
|
utcTZ = [NSTimeZone timeZoneWithName: @"UTC"];
|
|
|
|
[utcTZ retain];
|
2010-10-01 22:35:29 +02:00
|
|
|
}
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-01 22:35:29 +02:00
|
|
|
return MAPIApp;
|
2010-10-01 20:54:30 +02:00
|
|
|
}
|
|
|
|
|
2012-08-08 19:39:18 +02:00
|
|
|
- (BOOL) shouldSetupSignalHandlers
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2015-07-14 16:30:51 +02:00
|
|
|
- (MAPIStoreUserContext *) userContext
|
|
|
|
{
|
|
|
|
return userContext;
|
|
|
|
}
|
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
- (void) setUserContext: (MAPIStoreUserContext *) newContext
|
2010-10-01 20:54:30 +02:00
|
|
|
{
|
2012-02-02 02:38:50 +01:00
|
|
|
/* user contexts must not be retained here ad their holder (mapistore)
|
|
|
|
contexts must be active when any operation occurs. */
|
|
|
|
userContext = newContext;
|
2010-10-01 20:54:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id) authenticatorInContext: (id) context
|
|
|
|
{
|
2012-01-29 20:55:21 +01:00
|
|
|
return [userContext authenticator];
|
2010-10-01 20:54:30 +02:00
|
|
|
}
|
|
|
|
|
2015-07-14 16:30:51 +02:00
|
|
|
- (void) cleanup
|
|
|
|
{
|
|
|
|
[userContext deactivate];
|
|
|
|
}
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
@end
|