Monotone-Parent: 23072776516ad7ec761501356d062052d748d8c7

Monotone-Revision: 0803c3f82523e76024a78031ba0e71fce02404eb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-02-24T20:40:07
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-02-24 20:40:07 +00:00
parent c96ae87f5b
commit 1feee33aa2
18 changed files with 218 additions and 2120 deletions

View File

@@ -25,8 +25,6 @@
#import <EOControl/EOQualifier.h>
#import <Appointments/SOGoAppointmentObject.h>
#import <NGCards/iCalEvent.h>
#import "MAPIStoreTypes.h"
@@ -39,125 +37,6 @@
@implementation MAPIStoreCalendarMessageTable
- (EOQualifier *) componentQualifier
{
static EOQualifier *componentQualifier = nil;
if (!componentQualifier)
componentQualifier
= [[EOKeyValueQualifier alloc] initWithKey: @"c_component"
operatorSelector: EOQualifierOperatorEqual
value: @"vevent"];
return componentQualifier;
}
- (enum MAPISTATUS) getChildProperty: (void **) data
forKey: (NSString *) childKey
withTag: (enum MAPITAGS) propTag
{
NSTimeInterval timeValue;
id event;
int rc;
rc = MAPI_E_SUCCESS;
switch (propTag)
{
case PR_ICON_INDEX: // TODO
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
// *longValue = 0x00000401 for recurring event
// *longValue = 0x00000402 for meeting
// *longValue = 0x00000403 for recurring meeting
// *longValue = 0x00000404 for invitation
*data = MAPILongValue (memCtx, 0x00000400);
break;
case PR_MESSAGE_CLASS_UNICODE:
*data = talloc_strdup(memCtx, "IPM.Appointment");
break;
case PidLidAppointmentStartWhole: // DTSTART
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event startDate] asFileTimeInMemCtx: memCtx];
break;
case PidLidAppointmentEndWhole: // DTEND
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event endDate] asFileTimeInMemCtx: memCtx];
break;
case PidLidAppointmentDuration:
event = [[self lookupChild: childKey] component: NO secure: NO];
timeValue = [[event endDate] timeIntervalSinceDate: [event startDate]];
*data = MAPILongValue (memCtx, (uint32_t) (timeValue / 60));
break;
case PidLidAppointmentSubType:
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = MAPIBoolValue (memCtx, [event isAllDay]);
break;
case PidLidBusyStatus: // TODO
*data = MAPILongValue (memCtx, 0x02);
break;
case PidLidRecurring: // TODO
*data = MAPIBoolValue (memCtx, NO);
break;
// case 0x82410003: // TODO
// *data = MAPILongValue (memCtx, 0);
// break;
case PR_SUBJECT_UNICODE: // SUMMARY
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event summary] asUnicodeInMemCtx: memCtx];
break;
case PidLidLocation: // LOCATION
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event location] asUnicodeInMemCtx: memCtx];
break;
case PidLidPrivate: // private (bool), should depend on CLASS and permissions
*data = MAPIBoolValue (memCtx, NO);
break;
case PR_SENSITIVITY: // not implemented, depends on CLASS
// normal = 0, personal?? = 1, private = 2, confidential = 3
*data = MAPILongValue (memCtx, 0);
break;
case PR_CREATION_TIME:
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event created] asFileTimeInMemCtx: memCtx];
break;
case PR_IMPORTANCE:
{
unsigned int v;
event = [[self lookupChild: childKey] component: NO secure: NO];
if ([[event priority] isEqualToString: @"9"])
v = 0x0;
else if ([[event priority] isEqualToString: @"1"])
v = 0x2;
else
v = 0x1;
*data = MAPILongValue (memCtx, v);
}
break;
// case PidLidTimeZoneStruct:
// case PR_VD_NAME_UNICODE:
// *data = talloc_strdup(memCtx, "PR_VD_NAME_UNICODE");
// break;
// case PR_EMS_AB_DXA_REMOTE_CLIENT_UNICODE: "Home:" ???
// *data = talloc_strdup(memCtx, "PR_EMS...");
// break;
default:
rc = [super getChildProperty: data
forKey: childKey
withTag: propTag];
}
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
// #define PR_INTERNET_MESSAGE_ID_UNICODE PROP_TAG(PT_UNICODE , 0x1035) /* 0x1035001f */
// #define PR_FLAG_STATUS PROP_TAG(PT_LONG , 0x1090) /* 0x10900003 */
return rc;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{