From e3ae2f0b8a83e939f37dff0b32f33b5c7b7e2d8e Mon Sep 17 00:00:00 2001 From: CodaFi Date: Thu, 20 Jun 2013 16:31:54 -0600 Subject: Redo commits --- src/objc/imap/MCOIMAPFolder.h | 2 +- src/objc/imap/MCOIMAPFolder.mm | 18 ++++++++++++++++++ src/objc/imap/MCOIMAPMessage.h | 2 +- src/objc/imap/MCOIMAPMessage.mm | 24 ++++++++++++++++++++++++ src/objc/imap/MCOIMAPMessagePart.h | 2 +- src/objc/imap/MCOIMAPMessagePart.mm | 14 ++++++++++++++ src/objc/imap/MCOIMAPMultipart.h | 2 +- src/objc/imap/MCOIMAPMultipart.mm | 14 ++++++++++++++ src/objc/imap/MCOIMAPPart.h | 2 +- src/objc/imap/MCOIMAPPart.mm | 18 ++++++++++++++++++ 10 files changed, 93 insertions(+), 5 deletions(-) (limited to 'src/objc/imap') diff --git a/src/objc/imap/MCOIMAPFolder.h b/src/objc/imap/MCOIMAPFolder.h index 8688ef5b..bf643b54 100644 --- a/src/objc/imap/MCOIMAPFolder.h +++ b/src/objc/imap/MCOIMAPFolder.h @@ -15,7 +15,7 @@ #import #import -@interface MCOIMAPFolder : NSObject +@interface MCOIMAPFolder : NSObject /** The folder's path, like for example INBOX.Archive */ @property (nonatomic, copy) NSString * path; diff --git a/src/objc/imap/MCOIMAPFolder.mm b/src/objc/imap/MCOIMAPFolder.mm index 66e36beb..666bb78c 100644 --- a/src/objc/imap/MCOIMAPFolder.mm +++ b/src/objc/imap/MCOIMAPFolder.mm @@ -56,6 +56,24 @@ return self; } +- (id) initWithCoder:(NSCoder *)aDecoder +{ + self = [self init]; + + [self setPath:[aDecoder decodeObjectForKey:@"path"]]; + [self setDelimiter:[aDecoder decodeIntForKey:@"delimiter"]]; + [self setFlags:(MCOIMAPFolderFlag)[aDecoder decodeInt32ForKey:@"flags"]]; + + return self; +} + +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [aCoder encodeObject:[self path] forKey:@"path"]; + [aCoder encodeInt:[self delimiter] forKey:@"delimiter"]; + [aCoder encodeInt32:[self flags] forKey:@"flags"]; +} + - (void) dealloc { MC_SAFE_RELEASE(_nativeFolder); diff --git a/src/objc/imap/MCOIMAPMessage.h b/src/objc/imap/MCOIMAPMessage.h index 81dfa9f7..d9b54abe 100644 --- a/src/objc/imap/MCOIMAPMessage.h +++ b/src/objc/imap/MCOIMAPMessage.h @@ -29,7 +29,7 @@ @protocol MCOHTMLRendererIMAPDelegate; -@interface MCOIMAPMessage : MCOAbstractMessage +@interface MCOIMAPMessage : MCOAbstractMessage /** IMAP UID of the message. */ @property (nonatomic, assign) uint32_t uid; diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index 9984443e..2f6be457 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -27,6 +27,30 @@ MCORegisterClass(self, &typeid(nativeType)); } +- (id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + + [self setUid:[aDecoder decodeInt32ForKey:@"uid"]]; + [self setFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"flags"]]; + [self setOriginalFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"originalFlags"]]; + [self setModSeqValue:[aDecoder decodeInt64ForKey:@"modSeqValue"]]; + [self setMainPart:[aDecoder decodeObjectForKey:@"mainPart"]]; + [self setGmailLabels:[aDecoder decodeObjectForKey:@"gmailLabels"]]; + + return self; +} + +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [super encodeWithCoder:aCoder]; + [aCoder encodeInt32:[self uid] forKey:@"uid"]; + [aCoder encodeInt:[self flags] forKey:@"flags"]; + [aCoder encodeInt:[self originalFlags] forKey:@"originalFlags"]; + [aCoder encodeInt64:[self modSeqValue] forKey:@"modSeqValue"]; + [aCoder encodeObject:[self mainPart] forKey:@"mainPart"]; + [aCoder encodeObject:[self gmailLabels] forKey:@"gmailLabels"]; +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); diff --git a/src/objc/imap/MCOIMAPMessagePart.h b/src/objc/imap/MCOIMAPMessagePart.h index b602d93a..c40c2673 100644 --- a/src/objc/imap/MCOIMAPMessagePart.h +++ b/src/objc/imap/MCOIMAPMessagePart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMessagePart : MCOAbstractMessagePart +@interface MCOIMAPMessagePart : MCOAbstractMessagePart /** A part identifier is of the form 1.2.1*/ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMessagePart.mm b/src/objc/imap/MCOIMAPMessagePart.mm index 827636b3..35c13162 100644 --- a/src/objc/imap/MCOIMAPMessagePart.mm +++ b/src/objc/imap/MCOIMAPMessagePart.mm @@ -22,6 +22,14 @@ MCORegisterClass(self, &typeid(nativeType)); } +- (id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + + [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; + + return self; +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); @@ -30,6 +38,12 @@ return [result retain]; } +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [super encodeWithCoder:aCoder]; + [aCoder encodeObject:[self partID] forKey:@"partID"]; +} + + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPMessagePart * part = (mailcore::IMAPMessagePart *) object; diff --git a/src/objc/imap/MCOIMAPMultipart.h b/src/objc/imap/MCOIMAPMultipart.h index 0e0bb0eb..d6eb55cb 100644 --- a/src/objc/imap/MCOIMAPMultipart.h +++ b/src/objc/imap/MCOIMAPMultipart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMultipart : MCOAbstractMultipart +@interface MCOIMAPMultipart : MCOAbstractMultipart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMultipart.mm b/src/objc/imap/MCOIMAPMultipart.mm index fdfe4e7a..1cc60e05 100644 --- a/src/objc/imap/MCOIMAPMultipart.mm +++ b/src/objc/imap/MCOIMAPMultipart.mm @@ -22,6 +22,20 @@ MCORegisterClass(self, &typeid(nativeType)); } +- (id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + + [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; + + return self; +} + +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [super encodeWithCoder:aCoder]; + [aCoder encodeObject:[self partID] forKey:@"partID"]; +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); diff --git a/src/objc/imap/MCOIMAPPart.h b/src/objc/imap/MCOIMAPPart.h index 029135bf..bf897f2f 100644 --- a/src/objc/imap/MCOIMAPPart.h +++ b/src/objc/imap/MCOIMAPPart.h @@ -16,7 +16,7 @@ /** Represents a single IMAP message part */ -@interface MCOIMAPPart : MCOAbstractPart +@interface MCOIMAPPart : MCOAbstractPart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPPart.mm b/src/objc/imap/MCOIMAPPart.mm index 80b86d23..78361c51 100644 --- a/src/objc/imap/MCOIMAPPart.mm +++ b/src/objc/imap/MCOIMAPPart.mm @@ -22,6 +22,24 @@ MCORegisterClass(self, &typeid(nativeType)); } +- (id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + + [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; + [self setSize:(unsigned int) [aDecoder decodeInt64ForKey:@"size"]]; + [self setEncoding:(MCOEncoding) [aDecoder decodeIntForKey:@"encoding"]]; + + return self; +} + +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [super encodeWithCoder:aCoder]; + [aCoder encodeObject:[self partID] forKey:@"partID"]; + [aCoder encodeInt64:[self size] forKey:@"size"]; + [aCoder encodeInt:[self encoding] forKey:@"encoding"]; +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); -- cgit v1.2.3