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>
|
|
|
|
|
|
|
|
#import <SOGo/SOGoProductLoader.h>
|
|
|
|
#import <SOGo/SOGoSystemDefaults.h>
|
|
|
|
|
|
|
|
#import <Appointments/iCalEntityObject+SOGo.h>
|
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
#import "MAPIStoreUserContext.h"
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
#import "MAPIApplication.h"
|
|
|
|
|
|
|
|
MAPIApplication *MAPIApp = nil;
|
|
|
|
|
|
|
|
@interface UnixSignalHandler : NSObject
|
|
|
|
|
2010-10-01 22:35:29 +02:00
|
|
|
+ (id) sharedHandler;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-01 22:35:29 +02:00
|
|
|
- (void) removeObserver: (id) observer;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MAPIApplication
|
|
|
|
|
2011-08-04 16:11:45 +02:00
|
|
|
+ (BOOL) isCachingEnabled;
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
- (id) init
|
|
|
|
{
|
2010-10-01 22:35:29 +02:00
|
|
|
if (!MAPIApp)
|
|
|
|
{
|
|
|
|
// TODO publish
|
|
|
|
[iCalEntityObject initializeSOGoExtensions];
|
|
|
|
|
|
|
|
MAPIApp = [super init];
|
|
|
|
[MAPIApp retain];
|
|
|
|
|
|
|
|
/* This is a hack to revert what is done in [WOCoreApplication
|
|
|
|
init] */
|
2010-11-18 23:26:40 +01:00
|
|
|
[[NSClassFromString (@"UnixSignalHandler") sharedHandler]
|
2010-10-01 20:54:30 +02:00
|
|
|
removeObserver: self];
|
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-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
|
|
|
}
|
|
|
|
|
|
|
|
@end
|