2010-10-01 20:54:30 +02:00
|
|
|
/* MAPIStoreContext.h - this file is part of $PROJECT_NAME_HERE$
|
|
|
|
*
|
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
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
|
|
|
#define SENSITIVITY_NONE 0
|
|
|
|
#define SENSITIVITY_PERSONAL 1
|
|
|
|
#define SENSITIVITY_PRIVATE 2
|
|
|
|
#define SENSITIVITY_COMPANY_CONFIDENTIAL 3
|
|
|
|
|
2010-10-06 15:59:49 +02:00
|
|
|
#define TBL_LEAF_ROW 0x00000001
|
|
|
|
#define TBL_EMPTY_CATEGORY 0x00000002
|
|
|
|
#define TBL_EXPANDED_CATEGORY 0x00000003
|
|
|
|
#define TBL_COLLAPSED_CATEGORY 0x00000004
|
|
|
|
|
2010-10-01 23:24:15 +02:00
|
|
|
@class NSArray;
|
2010-11-26 22:48:52 +01:00
|
|
|
@class NSFileHandle;
|
2010-10-01 20:54:30 +02:00
|
|
|
@class NSMutableDictionary;
|
|
|
|
@class NSString;
|
|
|
|
|
|
|
|
@class WOContext;
|
|
|
|
|
|
|
|
@class SOGoFolder;
|
|
|
|
@class SOGoObject;
|
|
|
|
|
|
|
|
@class MAPIStoreAuthenticator;
|
2010-11-22 17:12:41 +01:00
|
|
|
@class MAPIStoreMapping;
|
2010-10-06 16:27:09 +02:00
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
@interface MAPIStoreContext : NSObject
|
|
|
|
{
|
2010-10-12 23:40:54 +02:00
|
|
|
struct mapistore_context *memCtx;
|
|
|
|
void *ldbCtx;
|
|
|
|
|
2010-10-13 23:40:50 +02:00
|
|
|
BOOL baseContextSet;
|
|
|
|
|
|
|
|
NSString *uri;
|
|
|
|
|
2010-12-01 17:34:41 +01:00
|
|
|
NSMutableArray *parentFoldersBag;
|
|
|
|
|
2010-10-01 22:35:29 +02:00
|
|
|
NSMutableDictionary *objectCache;
|
2010-11-06 00:27:08 +01:00
|
|
|
NSMutableDictionary *messages;
|
2010-10-01 22:35:29 +02:00
|
|
|
MAPIStoreAuthenticator *authenticator;
|
|
|
|
WOContext *woContext;
|
|
|
|
NSMutableDictionary *messageCache;
|
|
|
|
NSMutableDictionary *subfolderCache;
|
2010-11-24 20:28:45 +01:00
|
|
|
id moduleFolder;
|
2010-10-01 20:54:30 +02:00
|
|
|
}
|
|
|
|
|
2010-10-13 23:40:50 +02:00
|
|
|
+ (id) contextFromURI: (const char *) newUri
|
|
|
|
inMemCtx: (struct mapistore_context *) newMemCtx;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-13 23:40:50 +02:00
|
|
|
- (void) setURI: (NSString *) newUri
|
|
|
|
andMemCtx: (struct mapistore_context *) newMemCtx;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-13 23:40:50 +02:00
|
|
|
- (void) setupModuleFolder;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
- (void) setAuthenticator: (MAPIStoreAuthenticator *) newAuthenticator;
|
|
|
|
- (MAPIStoreAuthenticator *) authenticator;
|
|
|
|
|
|
|
|
- (void) setupRequest;
|
|
|
|
- (void) tearDownRequest;
|
|
|
|
|
|
|
|
- (id) lookupObject: (NSString *) objectURLString;
|
|
|
|
|
|
|
|
/* backend methods */
|
2010-10-13 23:40:50 +02:00
|
|
|
- (int) getPath: (char **) path
|
|
|
|
ofFMID: (uint64_t) fmid
|
|
|
|
withTableType: (uint8_t) tableType;
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
- (int) getFID: (uint64_t *) fid
|
|
|
|
byName: (const char *) foldername
|
|
|
|
inParentFID: (uint64_t) parent_fid;
|
|
|
|
|
2010-11-30 17:17:50 +01:00
|
|
|
- (enum MAPISTATUS) getTableProperty: (void **) data
|
|
|
|
withTag: (enum MAPITAGS) proptag
|
|
|
|
atPosition: (uint32_t) pos
|
|
|
|
withTableType: (uint8_t) tableType
|
|
|
|
inFID: (uint64_t) fid;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
|
|
|
- (int) mkDir: (struct SRow *) aRow
|
|
|
|
withFID: (uint64_t) fid
|
|
|
|
inParentFID: (uint64_t) parentFID;
|
|
|
|
- (int) rmDirWithFID: (uint64_t) fid
|
|
|
|
inParentFID: (uint64_t) parentFid;
|
|
|
|
- (int) openDir: (uint64_t) fid
|
|
|
|
inParentFID: (uint64_t) parentFID;
|
|
|
|
- (int) closeDir;
|
|
|
|
- (int) readCount: (uint32_t *) rowCount
|
|
|
|
ofTableType: (uint8_t) tableType
|
|
|
|
inFID: (uint64_t) fid;
|
|
|
|
- (int) openMessage: (struct mapistore_message *) msg
|
|
|
|
withMID: (uint64_t) mid
|
|
|
|
inFID: (uint64_t) fid;
|
2010-11-18 23:34:48 +01:00
|
|
|
- (int) createMessagePropertiesWithMID: (uint64_t) mid
|
|
|
|
inFID: (uint64_t) fid;
|
2010-10-01 20:54:30 +02:00
|
|
|
- (int) saveChangesInMessageWithMID: (uint64_t) mid
|
|
|
|
andFlags: (uint8_t) flags;
|
|
|
|
- (int) submitMessageWithMID: (uint64_t) mid
|
|
|
|
andFlags: (uint8_t) flags;
|
|
|
|
- (int) getProperties: (struct SPropTagArray *) SPropTagArray
|
2010-11-19 22:18:58 +01:00
|
|
|
ofTableType: (uint8_t) tableType
|
2010-10-01 20:54:30 +02:00
|
|
|
inRow: (struct SRow *) aRow
|
2010-11-19 22:18:58 +01:00
|
|
|
withMID: (uint64_t) fmid;
|
2010-11-17 15:12:54 +01:00
|
|
|
- (int) setPropertiesWithFMID: (uint64_t) fmid
|
2010-11-19 22:18:58 +01:00
|
|
|
ofTableType: (uint8_t) tableType
|
2010-11-17 15:12:54 +01:00
|
|
|
inRow: (struct SRow *) aRow;
|
2010-11-26 22:48:52 +01:00
|
|
|
- (int) setProperty: (enum MAPITAGS) property
|
|
|
|
withFMID: (uint64_t) fmid
|
|
|
|
ofTableType: (uint8_t) tableType
|
|
|
|
fromFile: (NSFileHandle *) aFile;
|
2010-11-30 22:04:05 +01:00
|
|
|
- (int) getProperty: (enum MAPITAGS) property
|
|
|
|
withFMID: (uint64_t) fmid
|
|
|
|
ofTableType: (uint8_t) tableType
|
|
|
|
intoFile: (NSFileHandle *) aFile;
|
2010-11-24 20:28:45 +01:00
|
|
|
- (int) modifyRecipientsWithMID: (uint64_t) mid
|
|
|
|
inRows: (struct ModifyRecipientRow *) rows
|
|
|
|
withCount: (NSUInteger) max;
|
2010-10-01 20:54:30 +02:00
|
|
|
- (int) deleteMessageWithMID: (uint64_t) mid
|
|
|
|
withFlags: (uint8_t) flags;
|
|
|
|
|
2010-11-30 22:04:05 +01:00
|
|
|
|
|
|
|
/* util methods */
|
|
|
|
- (void) registerValue: (id) value
|
|
|
|
asProperty: (enum MAPITAGS) property
|
|
|
|
forURL: (NSString *) url;
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
/* subclass methods */
|
2010-11-22 22:32:11 +01:00
|
|
|
+ (NSString *) MAPIModuleName;
|
2010-11-22 17:03:30 +01:00
|
|
|
+ (void) registerFixedMappings: (MAPIStoreMapping *) storeMapping;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-01 23:24:15 +02:00
|
|
|
- (NSArray *) getFolderMessageKeys: (SOGoFolder *) folder;
|
|
|
|
|
2010-11-30 17:17:50 +01:00
|
|
|
- (enum MAPISTATUS) getCommonTableChildproperty: (void **) data
|
|
|
|
atURL: (NSString *) childURL
|
|
|
|
withTag: (enum MAPITAGS) proptag
|
|
|
|
inFolder: (SOGoFolder *) folder
|
|
|
|
withFID: (uint64_t) fid;
|
|
|
|
|
|
|
|
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
|
|
|
|
atURL: (NSString *) childURL
|
|
|
|
withTag: (enum MAPITAGS) proptag
|
|
|
|
inFolder: (SOGoFolder *) folder
|
|
|
|
withFID: (uint64_t) fid;
|
|
|
|
|
|
|
|
- (enum MAPISTATUS) getFolderTableChildproperty: (void **) data
|
|
|
|
atURL: (NSString *) childURL
|
|
|
|
withTag: (enum MAPITAGS) proptag
|
|
|
|
inFolder: (SOGoFolder *) folder
|
|
|
|
withFID: (uint64_t) fid;
|
2010-10-01 20:54:30 +02:00
|
|
|
|
2010-10-13 23:40:50 +02:00
|
|
|
- (int) getFoldersList: (struct indexing_folders_list **) folders_list
|
|
|
|
withFMID: (uint64_t) fmid;
|
|
|
|
|
2010-10-14 15:22:46 +02:00
|
|
|
- (int) openMessage: (struct mapistore_message *) msg
|
|
|
|
atURL: (NSString *) childURL;
|
|
|
|
|
2010-10-14 18:38:15 +02:00
|
|
|
- (int) getMessageProperties: (struct SPropTagArray *) sPropTagArray
|
|
|
|
inRow: (struct SRow *) aRow
|
|
|
|
atURL: (NSString *) childURL;
|
|
|
|
|
2010-10-01 20:54:30 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* MAPISTORECONTEXT_H */
|