2010-12-13 18:03:25 +01:00
|
|
|
/* MAPIStoreContext.h - this file is part of SOGo
|
2010-10-01 20:54:30 +02:00
|
|
|
*
|
2010-10-08 20:38:12 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAPISTORECONTEXT_H
|
|
|
|
#define MAPISTORECONTEXT_H
|
|
|
|
|
2011-07-11 23:40:47 +02:00
|
|
|
#include <talloc.h>
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
2010-10-01 23:24:15 +02:00
|
|
|
@class NSArray;
|
2010-11-26 22:48:52 +01:00
|
|
|
@class NSFileHandle;
|
2010-12-03 23:31:56 +01:00
|
|
|
@class NSMutableArray;
|
2010-10-01 20:54:30 +02:00
|
|
|
@class NSMutableDictionary;
|
|
|
|
@class NSString;
|
2011-02-24 21:32:27 +01:00
|
|
|
@class NSURL;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-12-03 23:31:56 +01:00
|
|
|
@class EOQualifier;
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
@class WOContext;
|
|
|
|
|
|
|
|
@class SOGoFolder;
|
2010-12-30 15:18:42 +01:00
|
|
|
@class SOGoMAPIFSFolder;
|
2010-10-01 20:54:30 +02:00
|
|
|
@class SOGoObject;
|
2011-08-08 20:54:02 +02:00
|
|
|
@class SOGoUser;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
@class MAPIStoreAuthenticator;
|
2011-07-11 23:40:47 +02:00
|
|
|
@class MAPIStoreAttachment;
|
|
|
|
@class MAPIStoreAttachmentTable;
|
2011-02-24 21:32:27 +01:00
|
|
|
@class MAPIStoreFolder;
|
2011-07-13 23:41:58 +02:00
|
|
|
@class MAPIStoreMessage;
|
2010-12-30 15:18:42 +01:00
|
|
|
@class MAPIStoreTable;
|
2012-01-29 20:55:21 +01:00
|
|
|
@class MAPIStoreUserContext;
|
2010-12-03 23:31:56 +01:00
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
@interface MAPIStoreContext : NSObject
|
|
|
|
{
|
2011-05-31 07:01:43 +02:00
|
|
|
struct mapistore_connection_info *connInfo;
|
2010-10-13 23:40:50 +02:00
|
|
|
|
2011-11-29 02:39:07 +01:00
|
|
|
SOGoUser *activeUser;
|
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
MAPIStoreUserContext *userContext;
|
2011-06-04 01:53:30 +02:00
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
NSURL *contextUrl;
|
2010-10-01 20:54:30 +02:00
|
|
|
}
|
|
|
|
|
2012-01-26 20:54:36 +01:00
|
|
|
+ (struct mapistore_contexts_list *) listAllContextsForUser: (NSString *) userName
|
2012-01-29 20:55:21 +01:00
|
|
|
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
2012-01-26 20:54:36 +01:00
|
|
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
|
|
|
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
2012-01-29 20:55:21 +01:00
|
|
|
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
2012-01-26 20:54:36 +01:00
|
|
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
2012-02-03 16:05:55 +01:00
|
|
|
+ (enum mapistore_error) createRootFolder: (NSString **) mapistoreUriP
|
|
|
|
withFID: (uint64_t ) fid
|
|
|
|
andName: (NSString *) folderName
|
|
|
|
forUser: (NSString *) username
|
2012-02-14 15:47:06 +01:00
|
|
|
withRole: (enum mapistore_context_role) role;
|
2012-01-26 20:54:36 +01:00
|
|
|
|
2011-07-14 23:35:54 +02:00
|
|
|
+ (int) openContext: (MAPIStoreContext **) contextPtr
|
|
|
|
withURI: (const char *) newUri
|
2011-08-04 16:09:59 +02:00
|
|
|
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
|
|
|
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2011-05-31 07:01:43 +02:00
|
|
|
- (id) initFromURL: (NSURL *) newUri
|
2011-08-04 16:09:59 +02:00
|
|
|
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
|
|
|
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2011-04-13 21:55:17 +02:00
|
|
|
- (NSURL *) url;
|
2011-05-31 07:01:43 +02:00
|
|
|
- (struct mapistore_connection_info *) connectionInfo;
|
2011-04-13 21:55:17 +02:00
|
|
|
|
2012-01-29 20:55:21 +01:00
|
|
|
- (MAPIStoreUserContext *) userContext;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2011-08-08 20:54:02 +02:00
|
|
|
- (SOGoUser *) activeUser;
|
|
|
|
|
2011-02-24 21:32:27 +01:00
|
|
|
// - (id) lookupObject: (NSString *) objectURLString;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
/* backend methods */
|
2010-10-13 23:40:50 +02:00
|
|
|
- (int) getPath: (char **) path
|
|
|
|
ofFMID: (uint64_t) fmid
|
2011-07-11 23:40:47 +02:00
|
|
|
inMemCtx: (TALLOC_CTX *) memCtx;
|
2011-07-14 23:35:54 +02:00
|
|
|
- (int) getRootFolder: (MAPIStoreFolder **) folderPtr
|
|
|
|
withFID: (uint64_t) fmid;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-11-30 22:04:05 +01:00
|
|
|
/* util methods */
|
2010-12-30 15:18:42 +01:00
|
|
|
- (NSString *) extractChildNameFromURL: (NSString *) childURL
|
|
|
|
andFolderURLAt: (NSString **) folderURL;
|
|
|
|
|
2011-02-24 21:32:27 +01:00
|
|
|
- (uint64_t) idForObjectWithKey: (NSString *) key
|
|
|
|
inFolderURL: (NSString *) folderURL;
|
2011-07-27 23:55:49 +02:00
|
|
|
- (uint64_t) getNewChangeNumber;
|
2010-11-30 22:04:05 +01:00
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
/* subclass methods */
|
2010-11-22 22:32:11 +01:00
|
|
|
+ (NSString *) MAPIModuleName;
|
2012-02-03 16:05:55 +01:00
|
|
|
+ (enum mapistore_context_role) MAPIContextRole;
|
|
|
|
+ (NSString *)
|
|
|
|
createRootSecondaryFolderWithFID: (uint64_t) fid
|
|
|
|
andName: (NSString *) folderName
|
2012-02-14 15:47:06 +01:00
|
|
|
forUser: (NSString *) userName;
|
2012-01-29 20:55:21 +01:00
|
|
|
- (Class) MAPIStoreFolderClass;
|
|
|
|
|
|
|
|
/* the top-most parent of the context folder: SOGoMailAccount,
|
|
|
|
SOGoCalendarFolders, ... */
|
|
|
|
- (id) rootSOGoFolder;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* MAPISTORECONTEXT_H */
|