Monotone-Parent: 3541b0465209c659178d752da6f97c5063fbc108
Monotone-Revision: 779e2b1c502021e5eb405fa6e452d4a40ce77b6e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-19T21:57:52 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
d7df3cfb57
commit
3cbf76eda6
25
ChangeLog
25
ChangeLog
|
@ -1,5 +1,30 @@
|
||||||
2011-04-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2011-04-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* OpenChange/gen-property-selectors.py: added code to generate
|
||||||
|
MAPIStoreSupportedProperties as the array of properties that are
|
||||||
|
handled by OpenChange and MAPIStoreSupportedPropertiesCount as the
|
||||||
|
count of those properties.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreObject.m (+getAvailableProperties): ObjC
|
||||||
|
corollary of the "sogo_pocop_get_available_properties" backend
|
||||||
|
method.
|
||||||
|
(-getAvailableProperties): proxy to the class method of the same
|
||||||
|
name.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreTable.m (+childObjectClass): new mandatory
|
||||||
|
method that returns the Class of the objects represented in the
|
||||||
|
rows of the table.
|
||||||
|
(-getAvailableProperties:): ObjC corollary of the
|
||||||
|
"sogo_pocop_get_available_table_properties" backend method.
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreSOGo.m
|
||||||
|
(sogo_pocop_get_available_table_properties): new backend getter
|
||||||
|
that returns the list of properties that can be queried on the
|
||||||
|
table rows.
|
||||||
|
(sogo_pocop_get_available_properties): new backend getter
|
||||||
|
that returns the list of properties that can be queried on the
|
||||||
|
discrete object passed as parameter.
|
||||||
|
|
||||||
* OpenChange/code-MAPIStorePropertySelectors.m
|
* OpenChange/code-MAPIStorePropertySelectors.m
|
||||||
(MAPIStorePropertyGettersForClass): use the
|
(MAPIStorePropertyGettersForClass): use the
|
||||||
"MAPIStoreProeprtyGetter" type rather than IMP as result type.
|
"MAPIStoreProeprtyGetter" type rather than IMP as result type.
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
|
|
||||||
+ (id) mapiStoreObjectWithSOGoObject: (id) newSOGoObject
|
+ (id) mapiStoreObjectWithSOGoObject: (id) newSOGoObject
|
||||||
inContainer: (MAPIStoreObject *) newContainer;
|
inContainer: (MAPIStoreObject *) newContainer;
|
||||||
|
+ (int) getAvailableProperties: (struct SPropTagArray *) properties;
|
||||||
|
|
||||||
- (id) initWithSOGoObject: (id) newSOGoObject
|
- (id) initWithSOGoObject: (id) newSOGoObject
|
||||||
inContainer: (MAPIStoreObject *) newFolder;
|
inContainer: (MAPIStoreObject *) newFolder;
|
||||||
|
|
||||||
|
@ -76,6 +78,7 @@
|
||||||
- (void) resetNewProperties;
|
- (void) resetNewProperties;
|
||||||
|
|
||||||
/* ops */
|
/* ops */
|
||||||
|
- (int) getAvailableProperties: (struct SPropTagArray *) properties;
|
||||||
- (int) getProperties: (struct mapistore_property_data *) data
|
- (int) getProperties: (struct mapistore_property_data *) data
|
||||||
withTags: (enum MAPITAGS *) tags
|
withTags: (enum MAPITAGS *) tags
|
||||||
andCount: (uint16_t) columnCount;
|
andCount: (uint16_t) columnCount;
|
||||||
|
|
|
@ -61,6 +61,30 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (int) getAvailableProperties: (struct SPropTagArray *) properties
|
||||||
|
{
|
||||||
|
const MAPIStorePropertyGetter *classGetters;
|
||||||
|
NSUInteger count;
|
||||||
|
enum MAPITAGS propTag;
|
||||||
|
uint16_t propValue;
|
||||||
|
|
||||||
|
properties->aulPropTag = talloc_array (properties, enum MAPITAGS,
|
||||||
|
MAPIStoreSupportedPropertiesCount);
|
||||||
|
classGetters = MAPIStorePropertyGettersForClass (self);
|
||||||
|
for (count = 0; count < MAPIStoreSupportedPropertiesCount; count++)
|
||||||
|
{
|
||||||
|
propTag = MAPIStoreSupportedProperties[count];
|
||||||
|
propValue = (propTag & 0xffff0000) >> 16;
|
||||||
|
if (classGetters[propValue])
|
||||||
|
{
|
||||||
|
properties->aulPropTag[properties->cValues] = propTag;
|
||||||
|
properties->cValues++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
|
@ -269,7 +293,11 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||||
return [self getNo: data];
|
return [self getNo: data];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MAPIStoreProperty protocol */
|
- (int) getAvailableProperties: (struct SPropTagArray *) properties
|
||||||
|
{
|
||||||
|
return [isa getAvailableProperties: properties];
|
||||||
|
}
|
||||||
|
|
||||||
- (int) getProperties: (struct mapistore_property_data *) data
|
- (int) getProperties: (struct mapistore_property_data *) data
|
||||||
withTags: (enum MAPITAGS *) tags
|
withTags: (enum MAPITAGS *) tags
|
||||||
andCount: (uint16_t) columnCount
|
andCount: (uint16_t) columnCount
|
||||||
|
|
|
@ -1006,6 +1006,30 @@ sogo_pocop_open_embedded_message (void *attachment_object,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sogo_pocop_get_available_table_properties(void *table_object, struct SPropTagArray *properties)
|
||||||
|
{
|
||||||
|
NSAutoreleasePool *pool;
|
||||||
|
MAPIStoreTable *table;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||||
|
|
||||||
|
table = table_object;
|
||||||
|
if (table)
|
||||||
|
{
|
||||||
|
pool = [NSAutoreleasePool new];
|
||||||
|
rc = [table getAvailableProperties: properties];
|
||||||
|
[pool release];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO DATA");
|
||||||
|
rc = MAPI_E_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sogo_pocop_set_table_columns (void *table_object, uint16_t count, enum MAPITAGS *properties)
|
sogo_pocop_set_table_columns (void *table_object, uint16_t count, enum MAPITAGS *properties)
|
||||||
{
|
{
|
||||||
|
@ -1113,6 +1137,30 @@ sogo_pocop_get_table_row (void *table_object, enum table_query_type query_type,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sogo_pocop_get_available_properties(void *object, struct SPropTagArray *properties)
|
||||||
|
{
|
||||||
|
NSAutoreleasePool *pool;
|
||||||
|
MAPIStoreObject *propObject;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||||
|
|
||||||
|
propObject = object;
|
||||||
|
if (propObject)
|
||||||
|
{
|
||||||
|
pool = [NSAutoreleasePool new];
|
||||||
|
rc = [propObject getAvailableProperties: properties];
|
||||||
|
[pool release];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO DATA");
|
||||||
|
rc = MAPI_E_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sogo_pocop_get_properties (void *object,
|
sogo_pocop_get_properties (void *object,
|
||||||
uint16_t count, enum MAPITAGS *properties,
|
uint16_t count, enum MAPITAGS *properties,
|
||||||
|
@ -1252,10 +1300,12 @@ int mapistore_init_backend(void)
|
||||||
backend.message.get_attachment = sogo_pocop_get_attachment;
|
backend.message.get_attachment = sogo_pocop_get_attachment;
|
||||||
backend.message.create_attachment = sogo_pocop_create_attachment;
|
backend.message.create_attachment = sogo_pocop_create_attachment;
|
||||||
backend.message.open_embedded_message = sogo_pocop_open_embedded_message;
|
backend.message.open_embedded_message = sogo_pocop_open_embedded_message;
|
||||||
|
backend.table.get_available_properties = sogo_pocop_get_available_table_properties;
|
||||||
backend.table.set_restrictions = sogo_pocop_set_table_restrictions;
|
backend.table.set_restrictions = sogo_pocop_set_table_restrictions;
|
||||||
backend.table.set_sort_order = sogo_pocop_set_table_sort_order;
|
backend.table.set_sort_order = sogo_pocop_set_table_sort_order;
|
||||||
backend.table.set_columns = sogo_pocop_set_table_columns;
|
backend.table.set_columns = sogo_pocop_set_table_columns;
|
||||||
backend.table.get_row = sogo_pocop_get_table_row;
|
backend.table.get_row = sogo_pocop_get_table_row;
|
||||||
|
backend.properties.get_available_properties = sogo_pocop_get_available_properties;
|
||||||
backend.properties.get_properties = sogo_pocop_get_properties;
|
backend.properties.get_properties = sogo_pocop_get_properties;
|
||||||
backend.properties.set_properties = sogo_pocop_set_properties;
|
backend.properties.set_properties = sogo_pocop_set_properties;
|
||||||
backend.store.release = sogo_pocop_release;
|
backend.store.release = sogo_pocop_release;
|
||||||
|
|
|
@ -68,6 +68,7 @@ typedef enum {
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) tableForContainer: (MAPIStoreObject *) newContainer;
|
+ (id) tableForContainer: (MAPIStoreObject *) newContainer;
|
||||||
|
+ (Class) childObjectClass;
|
||||||
|
|
||||||
- (id) initForContainer: (MAPIStoreObject *) newContainer;
|
- (id) initForContainer: (MAPIStoreObject *) newContainer;
|
||||||
|
|
||||||
|
@ -81,6 +82,7 @@ typedef enum {
|
||||||
|
|
||||||
- (void) cleanupCaches;
|
- (void) cleanupCaches;
|
||||||
|
|
||||||
|
- (int) getAvailableProperties: (struct SPropTagArray *) properties;
|
||||||
- (void) setRestrictions: (const struct mapi_SRestriction *) res;
|
- (void) setRestrictions: (const struct mapi_SRestriction *) res;
|
||||||
- (int) setColumns: (enum MAPITAGS *) newColumns
|
- (int) setColumns: (enum MAPITAGS *) newColumns
|
||||||
withCount: (uint16_t) newColumCount;
|
withCount: (uint16_t) newColumCount;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#import <EOControl/EOQualifier.h>
|
#import <EOControl/EOQualifier.h>
|
||||||
|
|
||||||
#import "EOBitmaskQualifier.h"
|
#import "EOBitmaskQualifier.h"
|
||||||
|
#import "MAPIStoreObject.h"
|
||||||
#import "MAPIStoreTypes.h"
|
#import "MAPIStoreTypes.h"
|
||||||
#import "NSData+MAPIStore.h"
|
#import "NSData+MAPIStore.h"
|
||||||
#import "NSString+MAPIStore.h"
|
#import "NSString+MAPIStore.h"
|
||||||
|
@ -259,6 +260,13 @@ static Class NSDataK, NSStringK;
|
||||||
return newTable;
|
return newTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (Class) childObjectClass
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
|
||||||
|
return Nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
|
@ -358,6 +366,11 @@ static Class NSDataK, NSStringK;
|
||||||
currentRow = (uint32_t) -1;
|
currentRow = (uint32_t) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (int) getAvailableProperties: (struct SPropTagArray *) properties
|
||||||
|
{
|
||||||
|
return [[isa childObjectClass] getAvailableProperties: properties];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setRestrictions: (const struct mapi_SRestriction *) res
|
- (void) setRestrictions: (const struct mapi_SRestriction *) res
|
||||||
{
|
{
|
||||||
EOQualifier *oldRestriction;
|
EOQualifier *oldRestriction;
|
||||||
|
|
|
@ -36,6 +36,11 @@ m_template = """/* %(filename)s (auto-generated) - this file is part of SOGo
|
||||||
|
|
||||||
const NSUInteger MAPIStorePropertyGettersCount = %(nbr_getters)d;
|
const NSUInteger MAPIStorePropertyGettersCount = %(nbr_getters)d;
|
||||||
const NSUInteger MAPIStoreLastPropertyIdx = %(last_property)d;
|
const NSUInteger MAPIStoreLastPropertyIdx = %(last_property)d;
|
||||||
|
const NSUInteger MAPIStoreSupportedPropertiesCount = %(nbr_supported_properties)d;
|
||||||
|
|
||||||
|
const enum MAPITAGS MAPIStoreSupportedProperties[] = {
|
||||||
|
%(supported_properties)s
|
||||||
|
};
|
||||||
|
|
||||||
static const uint16_t MAPIStorePropertyGettersIdx[] = {
|
static const uint16_t MAPIStorePropertyGettersIdx[] = {
|
||||||
%(getters_idx)s
|
%(getters_idx)s
|
||||||
|
@ -73,11 +78,19 @@ h_template = """/* %(filename)s (auto-generated) - this file is part of SOGo
|
||||||
#ifndef %(h_exclusion)s
|
#ifndef %(h_exclusion)s
|
||||||
#define %(h_exclusion)s 1
|
#define %(h_exclusion)s 1
|
||||||
|
|
||||||
#import "MAPIStoreObject.h"
|
#import <Foundation/NSObjCRuntime.h>
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <gen_ndr/exchange.h>
|
||||||
|
|
||||||
extern const NSUInteger MAPIStorePropertyGettersCount;
|
extern const NSUInteger MAPIStorePropertyGettersCount;
|
||||||
extern const NSUInteger MAPIStoreLastPropertyIdx;
|
extern const NSUInteger MAPIStoreLastPropertyIdx;
|
||||||
|
|
||||||
|
extern const NSUInteger MAPIStoreSupportedPropertiesCount;
|
||||||
|
extern const enum MAPITAGS MAPIStoreSupportedProperties[];
|
||||||
|
|
||||||
|
#import "MAPIStoreObject.h"
|
||||||
|
|
||||||
@interface MAPIStoreObject (MAPIStorePropertySelectors)
|
@interface MAPIStoreObject (MAPIStorePropertySelectors)
|
||||||
|
|
||||||
%(prototypes)s
|
%(prototypes)s
|
||||||
|
@ -213,11 +226,13 @@ if __name__ == "__main__":
|
||||||
or name.endswith("Unicode")):
|
or name.endswith("Unicode")):
|
||||||
del names[name]
|
del names[name]
|
||||||
|
|
||||||
|
supported_properties = []
|
||||||
all_keys = names.keys()
|
all_keys = names.keys()
|
||||||
current_getter_idx = 0
|
current_getter_idx = 0
|
||||||
highest_prop_idx = 0
|
highest_prop_idx = 0
|
||||||
for name in all_keys:
|
for name in all_keys:
|
||||||
prop_tag = names[name]
|
prop_tag = names[name]
|
||||||
|
supported_properties.append(" 0x%.8x" % prop_tag);
|
||||||
prop_idx = (prop_tag & 0xffff0000) >> 16
|
prop_idx = (prop_tag & 0xffff0000) >> 16
|
||||||
getters_idx[prop_idx] = " %d" % current_getter_idx
|
getters_idx[prop_idx] = " %d" % current_getter_idx
|
||||||
if prop_idx > highest_prop_idx:
|
if prop_idx > highest_prop_idx:
|
||||||
|
@ -237,6 +252,8 @@ if __name__ == "__main__":
|
||||||
"getters": ",\n".join(getters),
|
"getters": ",\n".join(getters),
|
||||||
"nbr_getters": len(getters),
|
"nbr_getters": len(getters),
|
||||||
"last_property": highest_prop_idx,
|
"last_property": highest_prop_idx,
|
||||||
|
"nbr_supported_properties": len(supported_properties),
|
||||||
|
"supported_properties": ",\n".join(supported_properties),
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
"h_filename": h_filename })
|
"h_filename": h_filename })
|
||||||
outf.close()
|
outf.close()
|
||||||
|
|
Loading…
Reference in a new issue