Monotone-Parent: b65572c3789024ccb44bac952fa19cc6708071a0

Monotone-Revision: fc87b2e35370aef34db8f91a54bc71a27c2ea297

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-07-19T20:26:33
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2012-07-19 20:26:33 +00:00
parent b4f8a596f5
commit 0b2f4e5c44
4 changed files with 49 additions and 313 deletions

View file

@ -1,5 +1,12 @@
2012-07-19 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2012-07-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreAppointmentWrapper.m: now a subclass of
MAPIStoreObjectProxy.
* OpenChange/MAPIStoreCalendarMessage.m
(-initWithSOGoObject:inContainer:): we now register our
appointment wrapper as a proxy.
* OpenChange/MAPIStoreObject.m (-addProxy:): new method that keeps * OpenChange/MAPIStoreObject.m (-addProxy:): new method that keeps
proxy objects in the new "proxies" ivar. proxy objects in the new "proxies" ivar.
(-getProperty:withTag:inMemCtx:): added code that pass the request (-getProperty:withTag:inMemCtx:): added code that pass the request

View file

@ -23,10 +23,11 @@
#ifndef MAPISTORECALENDARWRAPPER_H #ifndef MAPISTORECALENDARWRAPPER_H
#define MAPISTORECALENDARWRAPPER_H #define MAPISTORECALENDARWRAPPER_H
#import <Foundation/NSObject.h>
#import <NGCards/iCalPerson.h> #import <NGCards/iCalPerson.h>
#import <Appointments/iCalEntityObject+SOGo.h> #import <Appointments/iCalEntityObject+SOGo.h>
#import "MAPIStoreObjectProxy.h"
@class NSTimeZone; @class NSTimeZone;
@class iCalAlarm; @class iCalAlarm;
@ -35,7 +36,7 @@
@class SOGoUser; @class SOGoUser;
@interface MAPIStoreAppointmentWrapper : NSObject @interface MAPIStoreAppointmentWrapper : MAPIStoreObjectProxy
{ {
struct mapistore_connection_info *connInfo; struct mapistore_connection_info *connInfo;
iCalCalendar *calendar; iCalCalendar *calendar;

View file

@ -28,9 +28,6 @@
@class MAPIStoreAppointmentWrapper; @class MAPIStoreAppointmentWrapper;
@interface MAPIStoreCalendarMessage : MAPIStoreGCSMessage @interface MAPIStoreCalendarMessage : MAPIStoreGCSMessage
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
}
@end @end

View file

@ -87,51 +87,33 @@
@implementation MAPIStoreCalendarMessage @implementation MAPIStoreCalendarMessage
- (id) init - (id) initWithSOGoObject: (id) newSOGoObject
inContainer: (MAPIStoreObject *) newFolder
{ {
if ((self = [super init])) iCalEvent *event;
MAPIStoreContext *context;
MAPIStoreUserContext *userContext;
MAPIStoreAppointmentWrapper *appointmentWrapper;
if ((self = [super initWithSOGoObject: newSOGoObject
inContainer: newFolder]))
{ {
appointmentWrapper = nil; event = [sogoObject component: NO secure: YES];
context = [self context];
userContext = [self userContext];
appointmentWrapper
= [MAPIStoreAppointmentWrapper wrapperWithICalEvent: event
andUser: [userContext sogoUser]
andSenderEmail: nil
inTimeZone: [userContext timeZone]
withConnectionInfo: [context connectionInfo]];
[self addProxy: appointmentWrapper];
} }
return self; return self;
} }
- (void) dealloc
{
[appointmentWrapper release];
[super dealloc];
}
- (MAPIStoreAppointmentWrapper *) appointmentWrapper
{
iCalEvent *event;
MAPIStoreContext *context;
MAPIStoreUserContext *userContext;
if (!appointmentWrapper)
{
event = [sogoObject component: NO secure: YES];
context = [self context];
userContext = [self userContext];
ASSIGN (appointmentWrapper,
[MAPIStoreAppointmentWrapper wrapperWithICalEvent: event
andUser: [userContext sogoUser]
andSenderEmail: nil
inTimeZone: [userContext timeZone]
withConnectionInfo: [context connectionInfo]]);
}
return appointmentWrapper;
}
/* getters */ /* getters */
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagIconIndex: data inMemCtx: memCtx];
}
- (int) getPidLidFInvited: (void **) data - (int) getPidLidFInvited: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx inMemCtx: (TALLOC_CTX *) memCtx
{ {
@ -154,93 +136,6 @@
return MAPISTORE_SUCCESS; return MAPISTORE_SUCCESS;
} }
- (int) getPidTagOwnerAppointmentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagOwnerAppointmentId: data inMemCtx: memCtx];
}
- (int) getPidTagStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagStartDate: data inMemCtx: memCtx];
}
- (int) getPidLidAppointmentSequence: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentSequence: data
inMemCtx: memCtx];
}
- (int) getPidLidAppointmentStateFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentStateFlags: data inMemCtx: memCtx];
}
- (int) getPidLidResponseStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidResponseStatus: data
inMemCtx: memCtx];
}
- (int) getPidLidAppointmentStartWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentStartWhole: data inMemCtx: memCtx];
}
- (int) getPidLidCommonStart: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidCommonStart: data inMemCtx: memCtx];
}
- (int) getPidTagEndDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagEndDate: data inMemCtx: memCtx];
}
- (int) getPidLidAppointmentEndWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentEndWhole: data inMemCtx: memCtx];
}
- (int) getPidLidCommonEnd: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidCommonEnd: data inMemCtx: memCtx];
}
- (int) getPidLidAppointmentDuration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentDuration: data inMemCtx: memCtx];
}
- (int) getPidLidAppointmentSubType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentSubType: data
inMemCtx: memCtx];
}
- (int) getPidLidBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidBusyStatus: data inMemCtx: memCtx];
}
- (int) getPidTagSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSubject: data inMemCtx: memCtx];
}
- (int) getPidLidSideEffects: (void **) data // TODO - (int) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx inMemCtx: (TALLOC_CTX *) memCtx
{ {
@ -251,155 +146,48 @@
return MAPISTORE_SUCCESS; return MAPISTORE_SUCCESS;
} }
- (int) getPidLidLocation: (void **) data // LOCATION
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidLocation: data inMemCtx: memCtx];
}
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidPrivate: data inMemCtx: memCtx];
}
- (int) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSensitivity: data inMemCtx: memCtx];
}
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagImportance: data inMemCtx: memCtx];
}
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagBody: data inMemCtx: memCtx];
}
- (int) getPidLidIsRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidIsRecurring: data inMemCtx: memCtx];
}
- (int) getPidLidRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidRecurring: data inMemCtx: memCtx];
}
- (int) getPidLidAppointmentRecur: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentRecur: data
inMemCtx: memCtx];
}
- (int) getPidLidGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidGlobalObjectId: data
inMemCtx: memCtx];
}
- (int) getPidLidCleanGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidCleanGlobalObjectId: data
inMemCtx: memCtx];
}
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx - (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{ {
return [self getYes: data inMemCtx: memCtx]; return [self getYes: data inMemCtx: memCtx];
} }
- (int) getPidLidServerProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidServerProcessed: data
inMemCtx: memCtx];
}
- (int) getPidLidServerProcessingActions: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidServerProcessingActions: data
inMemCtx: memCtx];
}
- (int) getPidLidAppointmentReplyTime: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidAppointmentReplyTime: data
inMemCtx: memCtx];
}
- (void) getMessageData: (struct mapistore_message **) dataPtr - (void) getMessageData: (struct mapistore_message **) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx inMemCtx: (TALLOC_CTX *) memCtx
{ {
struct mapistore_message *msgData; struct mapistore_message *msgData;
[super getMessageData: &msgData inMemCtx: memCtx]; [super getMessageData: &msgData inMemCtx: memCtx];
[[self appointmentWrapper] fillMessageData: msgData /* HACK: we know the first (and only) proxy is our appointment wrapper
inMemCtx: memCtx]; instance, but this might not always be true */
[[proxies objectAtIndex: 0] fillMessageData: msgData
inMemCtx: memCtx];
*dataPtr = msgData; *dataPtr = msgData;
} }
/* sender */
- (int) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSenderEmailAddress: data
inMemCtx: memCtx];
}
- (int) getPidTagSenderAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSenderAddressType: data
inMemCtx: memCtx];
}
- (int) getPidTagSenderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSenderName: data
inMemCtx: memCtx];
}
- (int) getPidTagSenderEntryId: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidTagSenderEntryId: data
inMemCtx: memCtx];
}
/* sender representing */ /* sender representing */
- (int) getPidTagSentRepresentingEmailAddress: (void **) data // - (int) getPidTagSentRepresentingEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx // inMemCtx: (TALLOC_CTX *) memCtx
{ // {
return [self getPidTagSenderEmailAddress: data inMemCtx: memCtx]; // return [self getPidTagSenderEmailAddress: data inMemCtx: memCtx];
} // }
- (int) getPidTagSentRepresentingAddressType: (void **) data // - (int) getPidTagSentRepresentingAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx // inMemCtx: (TALLOC_CTX *) memCtx
{ // {
return [self getSMTPAddrType: data inMemCtx: memCtx]; // return [self getSMTPAddrType: data inMemCtx: memCtx];
} // }
- (int) getPidTagSentRepresentingName: (void **) data // - (int) getPidTagSentRepresentingName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx // inMemCtx: (TALLOC_CTX *) memCtx
{ // {
return [self getPidTagSenderName: data inMemCtx: memCtx]; // return [self getPidTagSenderName: data inMemCtx: memCtx];
} // }
- (int) getPidTagSentRepresentingEntryId: (void **) data // - (int) getPidTagSentRepresentingEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx // inMemCtx: (TALLOC_CTX *) memCtx
{ // {
return [self getPidTagSenderEntryId: data inMemCtx: memCtx]; // return [self getPidTagSenderEntryId: data inMemCtx: memCtx];
} // }
/* attendee */ /* attendee */
// - (int) getPidTagReceivedByAddressType: (void **) data // - (int) getPidTagReceivedByAddressType: (void **) data
@ -461,63 +249,6 @@
return [self getYes: data inMemCtx: memCtx]; return [self getYes: data inMemCtx: memCtx];
} }
/* alarms */
- (int) getPidLidReminderSet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderSet: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderDelta: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderDelta: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderTime: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderSignalTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderSignalTime: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderOverride: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderOverride: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderType: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderPlaySound: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderPlaySound: data
inMemCtx: memCtx];
}
- (int) getPidLidReminderFileParameter: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self appointmentWrapper] getPidLidReminderFileParameter: data
inMemCtx: memCtx];
}
/* attendee */ /* attendee */
- (void) _setupRecurrenceInCalendar: (iCalCalendar *) calendar - (void) _setupRecurrenceInCalendar: (iCalCalendar *) calendar
withEvent: (iCalEvent *) event withEvent: (iCalEvent *) event