diff --git a/MailCore.framework/Headers/Headers b/MailCore.framework/Headers/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/MailCore.framework/Headers/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/MailCore.framework/Headers/MCAbstract.h b/MailCore.framework/Headers/MCAbstract.h new file mode 100644 index 000000000..03299ec4a --- /dev/null +++ b/MailCore.framework/Headers/MCAbstract.h @@ -0,0 +1,13 @@ +#ifndef MAILCORE_MCABSTRACT_H + +#define MAILCORE_MCABSTRACT_H + +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAbstractMessage.h b/MailCore.framework/Headers/MCAbstractMessage.h new file mode 100644 index 000000000..1f567a52e --- /dev/null +++ b/MailCore.framework/Headers/MCAbstractMessage.h @@ -0,0 +1,53 @@ +#ifndef MAILCORE_MCABSTRACTMESSAGE_H + +#define MAILCORE_MCABSTRACTMESSAGE_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class AbstractPart; + class MessageHeader; + + class MAILCORE_EXPORT AbstractMessage : public Object { + public: + AbstractMessage(); + virtual ~AbstractMessage(); + + /** Header of the message. */ + virtual MessageHeader * header(); + /** Set a header of the message. */ + virtual void setHeader(MessageHeader * header); + + /** Returns a part matching the given contentID. */ + virtual AbstractPart * partForContentID(String * contentID); + /** Returns a part matching the given uniqueID */ + virtual AbstractPart * partForUniqueID(String * uniqueID); + + /** Returns the list of attachments, not part of the content of the message. */ + virtual Array * /* AbstractPart */ attachments(); + /** Returns the list of attachments that are shown inline in the content of the message. */ + virtual Array * /* AbstractPart */ htmlInlineAttachments(); + /** Returns the list of the text parts required to render the message properly. */ + virtual Array * /* AbstractPart */ requiredPartsForRendering(); + + public: //subclass behavior + AbstractMessage(AbstractMessage * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * hashmap); + + private: + MessageHeader * mHeader; + void init(); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAbstractMessagePart.h b/MailCore.framework/Headers/MCAbstractMessagePart.h new file mode 100644 index 000000000..74be75797 --- /dev/null +++ b/MailCore.framework/Headers/MCAbstractMessagePart.h @@ -0,0 +1,45 @@ +#ifndef MAILCORE_MCABSTRACTMESSAGEPART_H + +#define MAILCORE_MCABSTRACTMESSAGEPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessageHeader; + + class MAILCORE_EXPORT AbstractMessagePart : public AbstractPart { + public: + AbstractMessagePart(); + virtual ~AbstractMessagePart(); + + virtual MessageHeader * header(); + virtual void setHeader(MessageHeader * header); + + virtual AbstractPart * mainPart(); + virtual void setMainPart(AbstractPart * mainPart); + + public: //subclass behavior + AbstractMessagePart(AbstractMessagePart * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + virtual AbstractPart * partForContentID(String * contentID); + virtual AbstractPart * partForUniqueID(String * uniqueID); + + private: + AbstractPart * mMainPart; + MessageHeader * mHeader; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAbstractMultipart.h b/MailCore.framework/Headers/MCAbstractMultipart.h new file mode 100644 index 000000000..814ee6dfa --- /dev/null +++ b/MailCore.framework/Headers/MCAbstractMultipart.h @@ -0,0 +1,39 @@ +#ifndef MAILCORE_MCABSTRACTMULTIPART_H + +#define MAILCORE_MCABSTRACTMULTIPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT AbstractMultipart : public AbstractPart { + public: + AbstractMultipart(); + virtual ~AbstractMultipart(); + + virtual Array * parts(); + virtual void setParts(Array * parts); + + public: //subclass behavior + AbstractMultipart(AbstractMultipart * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + virtual AbstractPart * partForContentID(String * contentID); + virtual AbstractPart * partForUniqueID(String * uniqueID); + + private: + Array * mParts; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAbstractPart.h b/MailCore.framework/Headers/MCAbstractPart.h new file mode 100644 index 000000000..88b5b331c --- /dev/null +++ b/MailCore.framework/Headers/MCAbstractPart.h @@ -0,0 +1,91 @@ +#ifndef MAILCORE_MCABSTRACTPART_H + +#define MAILCORE_MCABSTRACTPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class AbstractMessage; + + class MAILCORE_EXPORT AbstractPart : public Object { + public: + AbstractPart(); + virtual ~AbstractPart(); + + virtual PartType partType(); + virtual void setPartType(PartType type); + + virtual String * filename(); + virtual void setFilename(String * filename); + + virtual String * mimeType(); + virtual void setMimeType(String * mimeType); + + virtual String * charset(); + virtual void setCharset(String * charset); + + virtual String * uniqueID(); + virtual void setUniqueID(String * uniqueID); + + virtual String * contentID(); + virtual void setContentID(String * contentID); + + virtual String * contentLocation(); + virtual void setContentLocation(String * contentLocation); + + virtual String * contentDescription(); + virtual void setContentDescription(String * contentDescription); + + virtual bool isInlineAttachment(); + virtual void setInlineAttachment(bool inlineAttachment); + + virtual bool isAttachment(); + virtual void setAttachment(bool attachment); + + virtual AbstractPart * partForContentID(String * contentID); + virtual AbstractPart * partForUniqueID(String * uniqueID); + + virtual String * decodedStringForData(Data * data); + + void setContentTypeParameters(HashMap * parameters); + Array * allContentTypeParametersNames(); + void setContentTypeParameter(String * name, String * object); + void removeContentTypeParameter(String * name); + String * contentTypeParameterValueForName(String * name); + + public: // subclass behavior + AbstractPart(AbstractPart * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + public: // private + virtual void importIMAPFields(struct mailimap_body_fields * fields, + struct mailimap_body_ext_1part * extension); + virtual void applyUniquePartID(); + + private: + String * mUniqueID; + String * mFilename; + String * mMimeType; + String * mCharset; + String * mContentID; + String * mContentLocation; + String * mContentDescription; + bool mInlineAttachment; + bool mAttachment; + PartType mPartType; + HashMap * mContentTypeParameters; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAccountValidator.h b/MailCore.framework/Headers/MCAccountValidator.h new file mode 100644 index 000000000..436317cf4 --- /dev/null +++ b/MailCore.framework/Headers/MCAccountValidator.h @@ -0,0 +1,119 @@ +// +// MCAccountValidator.h +// mailcore2 +// +// Created by Christopher Hockley on 22/01/15. +// Copyright (c) 2015 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCACCOUNTVALIDATOR_H + +#define MAILCORE_MCACCOUNTVALIDATOR_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NetService; + class MailProvider; + class MXRecordResolverOperation; + class IMAPAsyncSession; + class POPAsyncSession; + class SMTPAsyncSession; + + class MAILCORE_EXPORT AccountValidator : public Operation, public OperationCallback { + public: + AccountValidator(); + virtual ~AccountValidator(); + + virtual void setEmail(String * email); + virtual String * email(); /* for SMTP */ + virtual void setUsername(String * username); + virtual String * username(); + virtual void setPassword(String * password); + virtual String * password(); + virtual void setOAuth2Token(String * OAuth2Token); + virtual String * OAuth2Token(); + + virtual void setImapEnabled(bool enabled); + virtual bool isImapEnabled(); + + virtual void setPopEnabled(bool enabled); + virtual bool isPopEnabled(); + + virtual void setSmtpEnabled(bool enabled); + virtual bool isSmtpEnabled(); + + virtual void setImapServices(Array * imapServices); + virtual Array * /* NetService */ imapServices(); + virtual void setSmtpServices(Array * smtpServices); + virtual Array * /* NetService */ smtpServices(); + virtual void setPopServices(Array * popServices); + virtual Array * /* NetService */ popServices(); + + // result + virtual String * identifier(); + virtual NetService * imapServer(); + virtual NetService * popServer(); + virtual NetService * smtpServer(); + virtual ErrorCode imapError(); + virtual ErrorCode popError(); + virtual ErrorCode smtpError(); + + virtual void start(); + virtual void cancel(); + + private: + String * mEmail; /* for SMTP */ + String * mUsername; + String * mPassword; + String * mOAuth2Token; + + Array * /* NetService */ mImapServices; + Array * /* NetService */ mSmtpServices; + Array * /* NetService */ mPopServices; + + // result + String * mIdentifier; + NetService * mImapServer; + NetService * mPopServer; + NetService * mSmtpServer; + ErrorCode mImapError; + ErrorCode mPopError; + ErrorCode mSmtpError; + + MailProvider * mProvider; + + //indexs for services being tested + int mCurrentServiceIndex; + int mCurrentServiceTested; + + Operation * mOperation; + virtual void operationFinished(Operation * op); + + OperationQueue * mQueue; + MXRecordResolverOperation * mResolveMX; + + IMAPAsyncSession * mImapSession; + POPAsyncSession * mPopSession; + SMTPAsyncSession * mSmtpSession; + + bool mImapEnabled; + bool mPopEnabled; + bool mSmtpEnabled; + + void init(); + void setupServices(); + void resolveMX(); + void resolveMXDone(); + void startCheckingHosts(); + void checkNextHost(); + void checkNextHostDone(); + }; +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAddress.h b/MailCore.framework/Headers/MCAddress.h new file mode 100644 index 000000000..e6644576e --- /dev/null +++ b/MailCore.framework/Headers/MCAddress.h @@ -0,0 +1,65 @@ +#ifndef MAILCORE_MCADDRESS_H + +#define MAILCORE_MCADDRESS_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT Address : public Object { + public: + Address(); + virtual ~Address(); + + static Address * addressWithDisplayName(String * displayName, String * mailbox); + static Address * addressWithMailbox(String * mailbox); + static Address * addressWithRFC822String(String * RFC822String); + static Address * addressWithNonEncodedRFC822String(String * nonEncodedRFC822String); + + static Array * addressesWithRFC822String(String * string); + static Array * addressesWithNonEncodedRFC822String(String * string); + + static String * RFC822StringForAddresses(Array * addresses); + static String * nonEncodedRFC822StringForAddresses(Array * addresses); + + virtual void setDisplayName(String * displayName); + virtual String * displayName(); + + virtual void setMailbox(String * address); + virtual String * mailbox(); + + virtual String * RFC822String(); + virtual String * nonEncodedRFC822String(); + + public: // subclass behavior. + Address(Address * other); + virtual String * description(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + public: // private + // Must be released + virtual struct mailimf_address * createIMFAddress(); + virtual struct mailimf_mailbox * createIMFMailbox(); + + // Additions + static Address * addressWithIMFMailbox(struct mailimf_mailbox * mb); + static Address * addressWithNonEncodedIMFMailbox(struct mailimf_mailbox * mb); + static Address * addressWithIMAPAddress(struct mailimap_address * imap_addr); + + private: + String * mDisplayName; + String * mMailbox; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAddressDisplay.h b/MailCore.framework/Headers/MCAddressDisplay.h new file mode 100644 index 000000000..6dd1faf86 --- /dev/null +++ b/MailCore.framework/Headers/MCAddressDisplay.h @@ -0,0 +1,34 @@ +// +// MCAddressDisplay.h +// testUI +// +// Created by DINH Viêt Hoà on 1/27/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCADDRESSDISPLAY_H + +#define MAILCORE_MCADDRESSDISPLAY_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT AddressDisplay { + public: + static String * displayStringForAddress(Address * address); + static String * shortDisplayStringForAddress(Address * address); + static String * veryShortDisplayStringForAddress(Address * address); + + static String * displayStringForAddresses(Array * /* Address */ addresses); + static String * shortDisplayStringForAddresses(Array * /* Address */ addresses); + static String * veryShortDisplayStringForAddresses(Array * /* Address */ addresses); + }; + +}; + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCArray.h b/MailCore.framework/Headers/MCArray.h new file mode 100644 index 000000000..bed43fe52 --- /dev/null +++ b/MailCore.framework/Headers/MCArray.h @@ -0,0 +1,59 @@ +#ifndef MAILCORE_MCARRAY_H + +#define MAILCORE_MCARRAY_H + +#include + +#ifdef __cplusplus + +typedef struct carray_s carray; + +namespace mailcore { + + class String; + + class MAILCORE_EXPORT Array : public Object { + public: + Array(); + virtual ~Array(); + + static Array * array(); + static Array * arrayWithObject(Object * obj); + + virtual unsigned int count(); + virtual void addObject(Object * obj); + virtual void removeObjectAtIndex(unsigned int idx); + virtual void removeObject(Object * obj); + virtual int indexOfObject(Object * obj); + virtual Object * objectAtIndex(unsigned int idx) ATTRIBUTE_RETURNS_NONNULL; + virtual void replaceObject(unsigned int idx, Object * obj); + virtual void insertObject(unsigned int idx, Object * obj); + virtual void removeAllObjects(); + + virtual void addObjectsFromArray(Array * array); + virtual Object * lastObject(); + virtual void removeLastObject(); + virtual bool containsObject(Object * obj); + + virtual Array * sortedArray(int (* compare)(void * a, void * b, void * context), void * context); + virtual void sortArray(int (* compare)(void * a, void * b, void * context), void * context); + virtual String * componentsJoinedByString(String * delimiter); + + public: // subclass behavior + Array(Array * o); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + virtual bool isEqual(Object * otherObject); + + private: + carray * mArray; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAssert.h b/MailCore.framework/Headers/MCAssert.h new file mode 100644 index 000000000..7858693f8 --- /dev/null +++ b/MailCore.framework/Headers/MCAssert.h @@ -0,0 +1,18 @@ +#ifndef MAILCORE_MCASSERT_H + +#define MAILCORE_MCASSERT_H + +#include + +#define MCAssert(cond) MCAssertInternal(__FILE__, __LINE__, cond, #cond) + +#ifdef __cplusplus +extern "C" { +#endif + MAILCORE_EXPORT + void MCAssertInternal(const char * filename, unsigned int line, int cond, const char * condString) CLANG_ANALYZER_NORETURN; +#ifdef __cplusplus +} +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAsync.h b/MailCore.framework/Headers/MCAsync.h new file mode 100644 index 000000000..90b3e2633 --- /dev/null +++ b/MailCore.framework/Headers/MCAsync.h @@ -0,0 +1,18 @@ +// +// MCAsync.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCASYNC_H + +#define MAILCORE_MCASYNC_H + +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAsyncIMAP.h b/MailCore.framework/Headers/MCAsyncIMAP.h new file mode 100755 index 000000000..8a490aa84 --- /dev/null +++ b/MailCore.framework/Headers/MCAsyncIMAP.h @@ -0,0 +1,37 @@ +// +// MCAsyncIMAP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCASYNCIMAP_H + +#define MAILCORE_MCASYNCIMAP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAsyncNNTP.h b/MailCore.framework/Headers/MCAsyncNNTP.h new file mode 100644 index 000000000..914cc754a --- /dev/null +++ b/MailCore.framework/Headers/MCAsyncNNTP.h @@ -0,0 +1,23 @@ +// +// MCAsyncNNTP.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCASYNCNNTP_H + +#define MAILCORE_MCASYNCNNTP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAsyncPOP.h b/MailCore.framework/Headers/MCAsyncPOP.h new file mode 100644 index 000000000..797403102 --- /dev/null +++ b/MailCore.framework/Headers/MCAsyncPOP.h @@ -0,0 +1,20 @@ +// +// MCAsyncPOP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCASYNCPOP_H + +#define MAILCORE_MCASYNCPOP_H + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAsyncSMTP.h b/MailCore.framework/Headers/MCAsyncSMTP.h new file mode 100644 index 000000000..d7bac9db6 --- /dev/null +++ b/MailCore.framework/Headers/MCAsyncSMTP.h @@ -0,0 +1,17 @@ +// +// MCAsyncSMTP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCASYNCSMTP_H + +#define MAILCORE_MCASYNCSMTP_H + +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCAttachment.h b/MailCore.framework/Headers/MCAttachment.h new file mode 100644 index 000000000..deacf75e4 --- /dev/null +++ b/MailCore.framework/Headers/MCAttachment.h @@ -0,0 +1,56 @@ +#ifndef MAILCORE_MCATTACHMENT_H + +#define MAILCORE_MCATTACHMENT_H + +#include +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessagePart; + + class MAILCORE_EXPORT Attachment : public AbstractPart { + public: + static String * mimeTypeForFilename(String * filename); + static Attachment * attachmentWithContentsOfFile(String * filename); + static Attachment * attachmentWithData(String * filename, Data * data); + static Attachment * attachmentWithHTMLString(String * htmlString); + static Attachment * attachmentWithRFC822Message(Data * messageData); + static Attachment * attachmentWithText(String * text); + + Attachment(); + virtual ~Attachment(); + + virtual void setData(Data * data); + virtual Data * data(); + virtual String * decodedString(); + + public: // subclass behavior + Attachment(Attachment * other); + virtual String * description(); + virtual Object * copy(); + + public: // private + static AbstractPart * attachmentsWithMIME(struct mailmime * mime); + + private: + Data * mData; + void init(); + static void fillMultipartSubAttachments(AbstractMultipart * multipart, struct mailmime * mime); + static AbstractPart * attachmentsWithMIMEWithMain(struct mailmime * mime, bool isMain); + static Attachment * attachmentWithSingleMIME(struct mailmime * mime); + static MessagePart * attachmentWithMessageMIME(struct mailmime * mime); + static Encoding encodingForMIMEEncoding(struct mailmime_mechanism * mechanism, int defaultMimeEncoding); + static HashMap * readMimeTypesFile(String * filename); + void setContentTypeParameters(HashMap * parameters); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCAutoreleasePool.h b/MailCore.framework/Headers/MCAutoreleasePool.h new file mode 100644 index 000000000..c3abf4779 --- /dev/null +++ b/MailCore.framework/Headers/MCAutoreleasePool.h @@ -0,0 +1,44 @@ +#ifndef MAILCORE_MCAUTORELEASEPOOL_H + +#define MAILCORE_MCAUTORELEASEPOOL_H + +#include +#include + +#ifdef __cplusplus + +typedef struct carray_s carray; + +namespace mailcore { + + class MAILCORE_EXPORT AutoreleasePool : public Object { + public: + AutoreleasePool(); + virtual ~AutoreleasePool(); + + static void autorelease(Object * obj); + + public: // subclass behavior + virtual String * description(); + + private: + static void init(); + static pthread_key_t autoreleasePoolStackKey; + carray * mPoolObjects; + static carray * createAutoreleasePoolStackIfNeeded(); + static void destroyAutoreleasePoolStack(void *); + static void initAutoreleasePoolStackKey(); + static AutoreleasePool * currentAutoreleasePool(); + virtual void add(Object * obj); +#ifdef __APPLE__ + void * mAppleAutoreleasePool; + static void * createAppleAutoreleasePool(); + static void releaseAppleAutoreleasePool(void * appleAutoreleasePool); +#endif + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCBaseTypes.h b/MailCore.framework/Headers/MCBaseTypes.h new file mode 100644 index 000000000..3088d4c21 --- /dev/null +++ b/MailCore.framework/Headers/MCBaseTypes.h @@ -0,0 +1,31 @@ +#ifndef MAILCORE_MCBASETYPES_H + +#define MAILCORE_MCBASETYPES_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCConnectionLogger.h b/MailCore.framework/Headers/MCConnectionLogger.h new file mode 100644 index 000000000..d5282db46 --- /dev/null +++ b/MailCore.framework/Headers/MCConnectionLogger.h @@ -0,0 +1,47 @@ +// +// MCConnectionLogger.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 6/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_CONNECTION_LOGGER_H + +#define MAILCORE_CONNECTION_LOGGER_H + +#include + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Data; + + enum ConnectionLogType { + // Received data + ConnectionLogTypeReceived, + // Sent data + ConnectionLogTypeSent, + // Sent private data + ConnectionLogTypeSentPrivate, + // Parse error + ConnectionLogTypeErrorParse, + // Error while receiving data - log() is called with a NULL buffer. + ConnectionLogTypeErrorReceived, + // Error while sending data - log() is called with a NULL buffer. + ConnectionLogTypeErrorSent, + }; + + class MAILCORE_EXPORT ConnectionLogger { + public: + virtual void log(void * sender, ConnectionLogType logType, Data * buffer) {} + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCCore.h b/MailCore.framework/Headers/MCCore.h new file mode 100644 index 000000000..323bb606c --- /dev/null +++ b/MailCore.framework/Headers/MCCore.h @@ -0,0 +1,23 @@ +// +// Core.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCCORE_H + +#define MAILCORE_MCCORE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCData.h b/MailCore.framework/Headers/MCData.h new file mode 100644 index 000000000..0bb1bc078 --- /dev/null +++ b/MailCore.framework/Headers/MCData.h @@ -0,0 +1,80 @@ +#ifndef MAILCORE_MCDATA_H + +#define MAILCORE_MCDATA_H + +#include + +#include +#include + +#ifdef __APPLE__ +#import +#endif + +#ifdef __cplusplus + +namespace mailcore { + + class String; + + class MAILCORE_EXPORT Data : public Object { + public: + Data(); + Data(int capacity); + Data(const char * bytes, unsigned int length); + virtual ~Data(); + + static Data * data(); + static Data * dataWithCapacity(int capacity); + static Data * dataWithContentsOfFile(String * filename); + static Data * dataWithBytes(const char * bytes, unsigned int length); + + virtual char * bytes(); + virtual unsigned int length(); + + virtual void appendData(Data * otherData); + virtual void appendBytes(const char * bytes, unsigned int length); + virtual void setBytes(const char * bytes, unsigned int length); + virtual void setData(Data * otherData); + + // Helpers + virtual String * stringWithDetectedCharset(); + virtual String * stringWithDetectedCharset(String * charset, bool isHTML); + virtual String * stringWithCharset(const char * charset); + virtual Data * decodedDataUsingEncoding(Encoding encoding); + + virtual String * base64String(); + + virtual ErrorCode writeToFile(String * filename); + + public: // private + virtual String * charsetWithFilteredHTML(bool filterHTML, String * hintCharset = NULL); +#ifdef __APPLE__ + virtual CFDataRef destructiveNSData(); +#endif + + public: // subclass behavior + Data(Data * otherData); + virtual String * description(); + virtual Object * copy(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + char * mBytes; + unsigned int mLength; + unsigned int mAllocated; + void allocate(unsigned int length, bool force = false); + void reset(); + String * charsetWithFilteredHTMLWithoutHint(bool filterHTML); + void takeBytesOwnership(char * bytes, unsigned int length); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCDateFormatter.h b/MailCore.framework/Headers/MCDateFormatter.h new file mode 100644 index 000000000..d2198d04b --- /dev/null +++ b/MailCore.framework/Headers/MCDateFormatter.h @@ -0,0 +1,75 @@ +// +// MCDateFormatter.h +// testUI +// +// Created by DINH Viêt Hoà on 1/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCDATEFORMATTER_H + +#define MAILCORE_MCDATEFORMATTER_H + +#include + +// predeclare UDateFormat +// copied from +typedef void * UDateFormat; + +#ifdef __cplusplus + +namespace mailcore { + + class String; + + // Uses same values as UDateFormatStyle + enum DateFormatStyle { + DateFormatStyleFull = 0 /* UDAT_FULL*/, + DateFormatStyleLong = 1 /* UDAT_LONG */, + DateFormatStyleMedium = 2 /* UDAT_MEDIUM */, + DateFormatStyleShort = 3 /* UDAT_SHORT */, + DateFormatStyleNone = -1 /* UDAT_NONE */, + }; + + class MAILCORE_EXPORT DateFormatter : public Object { + public: + DateFormatter(); + virtual ~DateFormatter(); + + static DateFormatter * dateFormatter(); + + virtual void setDateStyle(DateFormatStyle style); + virtual DateFormatStyle dateStyle(); + + virtual void setTimeStyle(DateFormatStyle style); + virtual DateFormatStyle timeStyle(); + + virtual void setLocale(String * locale); + virtual String * locale(); + + virtual void setTimezone(String * timezone); + virtual String * timezone(); + + virtual void setDateFormat(String * dateFormat); + virtual String * dateFormat(); + + virtual String * stringFromDate(time_t date); + virtual time_t dateFromString(String * dateString); + + private: + UDateFormat * mDateFormatter; + DateFormatStyle mDateStyle; + DateFormatStyle mTimeStyle; + String * mDateFormat; + String * mTimezone; + String * mLocale; + void * mAppleDateFormatter; + + void prepare(); + }; + +} + +#endif + +#endif /* defined(__testUI__MCDateFormatter__) */ diff --git a/MailCore.framework/Headers/MCHTMLCleaner.h b/MailCore.framework/Headers/MCHTMLCleaner.h new file mode 100644 index 000000000..eccf88c92 --- /dev/null +++ b/MailCore.framework/Headers/MCHTMLCleaner.h @@ -0,0 +1,29 @@ +// +// HTMLCleaner.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 2/3/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_HTMLCLEANER_H + +#define MAILCORE_HTMLCLEANER_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT HTMLCleaner { + public: + static String * cleanHTML(String * input); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCHTMLRendererCallback.h b/MailCore.framework/Headers/MCHTMLRendererCallback.h new file mode 100644 index 000000000..4a4fc40f9 --- /dev/null +++ b/MailCore.framework/Headers/MCHTMLRendererCallback.h @@ -0,0 +1,67 @@ +// +// MCHTMLRendererCallback.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 2/2/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCHTMLRENDERERCALLBACK_H + +#define MAILCORE_MCHTMLRENDERERCALLBACK_H + +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessageParser; + + class MAILCORE_EXPORT HTMLRendererIMAPCallback { + public: + HTMLRendererIMAPCallback() {} + virtual ~HTMLRendererIMAPCallback() {} + + virtual Data * dataForIMAPPart(String * folder, IMAPPart * part) { return NULL; } + virtual void prefetchAttachmentIMAPPart(String * folder, IMAPPart * part) {} + virtual void prefetchImageIMAPPart(String * folder, IMAPPart * part) {} + }; + + class MAILCORE_EXPORT HTMLRendererTemplateCallback { + public: + HTMLRendererTemplateCallback(); + virtual ~HTMLRendererTemplateCallback(); + + virtual void setMixedTextAndAttachmentsModeEnabled(bool enabled); + + virtual bool canPreviewPart(AbstractPart * part); + virtual bool shouldShowPart(AbstractPart * part); + + virtual HashMap * templateValuesForHeader(MessageHeader * header); + virtual HashMap * templateValuesForPart(AbstractPart * part); + + virtual String * templateForMainHeader(MessageHeader * header); + virtual String * templateForImage(AbstractPart * part); + virtual String * templateForAttachment(AbstractPart * part); + virtual String * templateForMessage(AbstractMessage * message); + virtual String * templateForEmbeddedMessage(AbstractMessagePart * part); + virtual String * templateForEmbeddedMessageHeader(MessageHeader * header); + virtual String * templateForAttachmentSeparator(); + + virtual String * cleanHTMLForPart(String * html); + + // Can be used to filter some HTML tags. + virtual String * filterHTMLForPart(String * html); + + // Can be used to hide quoted text. + virtual String * filterHTMLForMessage(String * html); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCHash.h b/MailCore.framework/Headers/MCHash.h new file mode 100644 index 000000000..5ef0c2919 --- /dev/null +++ b/MailCore.framework/Headers/MCHash.h @@ -0,0 +1,15 @@ +#ifndef MAILCORE_MCHASH_H + +#define MAILCORE_MCHASH_H + +#ifdef __cplusplus + +namespace mailcore { + + unsigned int hashCompute(const char * key, unsigned int len); + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCHashMap.h b/MailCore.framework/Headers/MCHashMap.h new file mode 100644 index 000000000..b6ac6d2f8 --- /dev/null +++ b/MailCore.framework/Headers/MCHashMap.h @@ -0,0 +1,53 @@ +#ifndef MAILCORE_MCHASHMAP_H + +#define MAILCORE_MCHASHMAP_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class String; + class Array; + struct HashMapCell; + typedef HashMapCell HashMapIter; + + class MAILCORE_EXPORT HashMap : public Object { + public: + HashMap(); + virtual ~HashMap(); + + static HashMap * hashMap(); + + virtual unsigned int count(); + virtual void setObjectForKey(Object * key, Object * value); + virtual void removeObjectForKey(Object * key); + virtual Object * objectForKey(Object * key); + virtual Array * allKeys(); + virtual Array * allValues(); + virtual void removeAllObjects(); + + public: // subclass behavior + HashMap(HashMap * o); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + virtual bool isEqual(Object * otherObject); + + private: + unsigned int mAllocated; + unsigned int mCount; + void ** mCells; + HashMapIter * iteratorBegin(); + HashMapIter * iteratorNext(HashMapIter * iter); + void allocate(unsigned int size); + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCICUTypes.h b/MailCore.framework/Headers/MCICUTypes.h new file mode 100644 index 000000000..cf3bfa42c --- /dev/null +++ b/MailCore.framework/Headers/MCICUTypes.h @@ -0,0 +1,21 @@ +// +// MCICUTypes.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 4/18/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCICUTYPES_H + +#define MAILCORE_MCICUTYPES_H + +#ifdef _MSC_VER +typedef wchar_t UChar; +#elif defined(__CHAR16_TYPE__) +typedef __CHAR16_TYPE__ UChar; +#else +typedef uint16_t UChar; +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAP.h b/MailCore.framework/Headers/MCIMAP.h new file mode 100644 index 000000000..6e80995f6 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAP.h @@ -0,0 +1,19 @@ +#ifndef MAILCORE_MCIMAP_H + +#define MAILCORE_MCIMAP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCIMAPAppendMessageOperation.h b/MailCore.framework/Headers/MCIMAPAppendMessageOperation.h new file mode 100644 index 000000000..ca3033a68 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPAppendMessageOperation.h @@ -0,0 +1,55 @@ +// +// MCIMAPAppendMessageOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPAPPENDMESSAGEOPERATION_H + +#define MAILCORE_MCIMAPAPPENDMESSAGEOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPAppendMessageOperation : public IMAPOperation { + public: + IMAPAppendMessageOperation(); + virtual ~IMAPAppendMessageOperation(); + + virtual void setMessageData(Data * messageData); + virtual Data * messageData(); + + virtual void setFlags(MessageFlag flags); + virtual MessageFlag flags(); + + virtual void setCustomFlags(Array * customFlags); + virtual Array * customFlags(); + + virtual void setDate(time_t date); + virtual time_t date(); + + virtual uint32_t createdUID(); + + public: // subclass behavior + virtual void main(); + + private: + Data * mMessageData; + MessageFlag mFlags; + Array * mCustomFlags; + time_t mDate; + uint32_t mCreatedUID; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPAsyncSession.h b/MailCore.framework/Headers/MCIMAPAsyncSession.h new file mode 100755 index 000000000..863789262 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPAsyncSession.h @@ -0,0 +1,216 @@ +// +// MCIMAPAccount.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/17/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPACCOUNT_H + +#define MAILCORE_MCIMAPACCOUNT_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPOperation; + class IMAPFetchFoldersOperation; + class IMAPAppendMessageOperation; + class IMAPCopyMessagesOperation; + class IMAPFetchMessagesOperation; + class IMAPFetchContentOperation; + class IMAPFetchParsedContentOperation; + class IMAPIdleOperation; + class IMAPFolderInfoOperation; + class IMAPFolderStatusOperation; + class IMAPNamespace; + class IMAPSearchOperation; + class IMAPSearchExpression; + class IMAPFetchNamespaceOperation; + class IMAPIdentityOperation; + class IMAPAsyncConnection; + class IMAPCapabilityOperation; + class IMAPQuotaOperation; + class IMAPMessageRenderingOperation; + class IMAPMessage; + class IMAPSession; + class IMAPIdentity; + class OperationQueueCallback; + + class MAILCORE_EXPORT IMAPAsyncSession : public Object { + public: + IMAPAsyncSession(); + virtual ~IMAPAsyncSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + // To authenticate using OAuth2, username and oauth2token should be set. + // auth type to use is AuthTypeOAuth2. + virtual void setOAuth2Token(String * token); + virtual String * OAuth2Token(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setVoIPEnabled(bool enabled); + virtual bool isVoIPEnabled(); + + virtual void setDefaultNamespace(IMAPNamespace * ns); + virtual IMAPNamespace * defaultNamespace(); + + virtual void setAllowsFolderConcurrentAccessEnabled(bool enabled); + virtual bool allowsFolderConcurrentAccessEnabled(); + + virtual void setMaximumConnections(unsigned int maxConnections); + virtual unsigned int maximumConnections(); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + virtual void setOperationQueueCallback(OperationQueueCallback * callback); + virtual OperationQueueCallback * operationQueueCallback(); + virtual bool isOperationQueueRunning(); + virtual void cancelAllOperations(); + + virtual IMAPIdentity * serverIdentity(); + virtual IMAPIdentity * clientIdentity(); + virtual String * gmailUserDisplayName() DEPRECATED_ATTRIBUTE; + + virtual IMAPFolderInfoOperation * folderInfoOperation(String * folder); + virtual IMAPFolderStatusOperation * folderStatusOperation(String * folder); + + virtual IMAPFetchFoldersOperation * fetchSubscribedFoldersOperation(); + virtual IMAPFetchFoldersOperation * fetchAllFoldersOperation(); + + virtual IMAPOperation * renameFolderOperation(String * folder, String * otherName); + virtual IMAPOperation * deleteFolderOperation(String * folder); + virtual IMAPOperation * createFolderOperation(String * folder); + + virtual IMAPOperation * subscribeFolderOperation(String * folder); + virtual IMAPOperation * unsubscribeFolderOperation(String * folder); + + virtual IMAPAppendMessageOperation * appendMessageOperation(String * folder, Data * messageData, MessageFlag flags, Array * customFlags = NULL); + + virtual IMAPCopyMessagesOperation * copyMessagesOperation(String * folder, IndexSet * uids, String * destFolder); + + virtual IMAPOperation * expungeOperation(String * folder); + + virtual IMAPFetchMessagesOperation * fetchMessagesByUIDOperation(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * indexes); + virtual IMAPFetchMessagesOperation * fetchMessagesByNumberOperation(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * indexes); + virtual IMAPFetchMessagesOperation * syncMessagesByUIDOperation(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * indexes, uint64_t modSeq); + + virtual IMAPFetchContentOperation * fetchMessageByUIDOperation(String * folder, uint32_t uid, bool urgent = false); + virtual IMAPFetchContentOperation * fetchMessageAttachmentByUIDOperation(String * folder, uint32_t uid, String * partID, + Encoding encoding, bool urgent = false); + + virtual IMAPFetchContentOperation * fetchMessageByNumberOperation(String * folder, uint32_t number, bool urgent = false); + virtual IMAPFetchContentOperation * fetchMessageAttachmentByNumberOperation(String * folder, uint32_t number, String * partID, + Encoding encoding, bool urgent = false); + + virtual IMAPFetchParsedContentOperation * fetchParsedMessageByUIDOperation(String * folder, uint32_t uid, bool urgent = false); + virtual IMAPFetchParsedContentOperation * fetchParsedMessageByNumberOperation(String * folder, uint32_t number, bool urgent = false); + + virtual IMAPOperation * storeFlagsByUIDOperation(String * folder, IndexSet * uids, IMAPStoreFlagsRequestKind kind, MessageFlag flags, Array * customFlags = NULL); + virtual IMAPOperation * storeFlagsByNumberOperation(String * folder, IndexSet * numbers, IMAPStoreFlagsRequestKind kind, MessageFlag flags, Array * customFlags = NULL); + virtual IMAPOperation * storeLabelsByUIDOperation(String * folder, IndexSet * uids, IMAPStoreFlagsRequestKind kind, Array * labels); + virtual IMAPOperation * storeLabelsByNumberOperation(String * folder, IndexSet * numbers, IMAPStoreFlagsRequestKind kind, Array * labels); + + virtual IMAPSearchOperation * searchOperation(String * folder, IMAPSearchKind kind, String * searchString); + virtual IMAPSearchOperation * searchOperation(String * folder, IMAPSearchExpression * expression); + + virtual IMAPIdleOperation * idleOperation(String * folder, uint32_t lastKnownUID); + + virtual IMAPFetchNamespaceOperation * fetchNamespaceOperation(); + + virtual IMAPIdentityOperation * identityOperation(IMAPIdentity * identity); + + virtual IMAPOperation * connectOperation(); + virtual IMAPOperation * checkAccountOperation(); + virtual IMAPOperation * disconnectOperation(); + + virtual IMAPCapabilityOperation * capabilityOperation(); + virtual IMAPQuotaOperation * quotaOperation(); + + virtual IMAPOperation * noopOperation(); + + virtual IMAPMessageRenderingOperation * htmlRenderingOperation(IMAPMessage * message, String * folder); + virtual IMAPMessageRenderingOperation * htmlBodyRenderingOperation(IMAPMessage * message, String * folder); + virtual IMAPMessageRenderingOperation * plainTextRenderingOperation(IMAPMessage * message, String * folder); + virtual IMAPMessageRenderingOperation * plainTextBodyRenderingOperation(IMAPMessage * message, String * folder, bool stripWhitespace); + + public: // private + virtual void automaticConfigurationDone(IMAPSession * session); + virtual void operationRunningStateChanged(); + virtual IMAPAsyncConnection * sessionForFolder(String * folder, bool urgent = false); + + private: + Array * mSessions; + + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + String * mOAuth2Token; + AuthType mAuthType; + ConnectionType mConnectionType; + bool mCheckCertificateEnabled; + bool mVoIPEnabled; + IMAPNamespace * mDefaultNamespace; + time_t mTimeout; + bool mAllowsFolderConcurrentAccessEnabled; + unsigned int mMaximumConnections; + ConnectionLogger * mConnectionLogger; + bool mAutomaticConfigurationDone; + IMAPIdentity * mServerIdentity; + IMAPIdentity * mClientIdentity; + bool mQueueRunning; + OperationQueueCallback * mOperationQueueCallback; +#if __APPLE__ + dispatch_queue_t mDispatchQueue; +#endif + String * mGmailUserDisplayName; + + virtual IMAPAsyncConnection * session(); + virtual IMAPAsyncConnection * matchingSessionForFolder(String * folder); + virtual IMAPAsyncConnection * availableSession(); + virtual IMAPMessageRenderingOperation * renderingOperation(IMAPMessage * message, + String * folder, + IMAPMessageRenderingType type); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPCapabilityOperation.h b/MailCore.framework/Headers/MCIMAPCapabilityOperation.h new file mode 100644 index 000000000..486d54cf0 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPCapabilityOperation.h @@ -0,0 +1,38 @@ +// +// MCIMAPCapabilityOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/4/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPCAPABILITYOPERATION_H + +#define MAILCORE_MCIMAPCAPABILITYOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPCapabilityOperation : public IMAPOperation { + public: + IMAPCapabilityOperation(); + virtual ~IMAPCapabilityOperation(); + + // Result. + virtual IndexSet * capabilities(); + + public: // subclass behavior + virtual void main(); + + private: + IndexSet * mCapabilities; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPConnectOperation.h b/MailCore.framework/Headers/MCIMAPConnectOperation.h new file mode 100644 index 000000000..7678ccdd4 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPConnectOperation.h @@ -0,0 +1,28 @@ +// +// MCIMAPConnectOperation.h +// mailcore2 +// +// Created by Ryan Walklin on 6/09/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPCONNECTOPERATION_H + +#define MAILCORE_MCIMAPCONNECTOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPConnectOperation : public IMAPOperation { + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif /* defined(__MAILCORE_MCIMAPCONNECTOPERATION_H_) */ diff --git a/MailCore.framework/Headers/MCIMAPCopyMessagesOperation.h b/MailCore.framework/Headers/MCIMAPCopyMessagesOperation.h new file mode 100644 index 000000000..c6d754479 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPCopyMessagesOperation.h @@ -0,0 +1,46 @@ +// +// MCIMAPCopyMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPCOPYMESSAGESOPERATION_H + +#define MAILCORE_MCIMAPCOPYMESSAGESOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPCopyMessagesOperation : public IMAPOperation { + public: + IMAPCopyMessagesOperation(); + virtual ~IMAPCopyMessagesOperation(); + + virtual void setDestFolder(String * destFolder); + virtual String * destFolder(); + + virtual void setUids(IndexSet * uids); + virtual IndexSet * uids(); + + // Result. + virtual HashMap * uidMapping(); + + public: // subclass behavior + virtual void main(); + + private: + IndexSet * mUids; + String * mDestFolder; + HashMap * mUidMapping; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFetchContentOperation.h b/MailCore.framework/Headers/MCIMAPFetchContentOperation.h new file mode 100644 index 000000000..0b5b70f28 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFetchContentOperation.h @@ -0,0 +1,55 @@ +// +// IMAPFetchContentOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_IMAPFETCHCONTENTOPERATION_H + +#define MAILCORE_IMAPFETCHCONTENTOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFetchContentOperation : public IMAPOperation { + public: + IMAPFetchContentOperation(); + virtual ~IMAPFetchContentOperation(); + + virtual void setUid(uint32_t uid); + virtual uint32_t uid(); + + virtual void setNumber(uint32_t value); + virtual uint32_t number(); + + virtual void setPartID(String * partID); + virtual String * partID(); + + virtual void setEncoding(Encoding encoding); + virtual Encoding encoding(); + + // Result. + virtual Data * data(); + + public: // subclass behavior + virtual void main(); + + private: + uint32_t mUid; + uint32_t mNumber; + String * mPartID; + Encoding mEncoding; + Data * mData; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFetchFoldersOperation.h b/MailCore.framework/Headers/MCIMAPFetchFoldersOperation.h new file mode 100644 index 000000000..f6456a367 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFetchFoldersOperation.h @@ -0,0 +1,44 @@ +// +// MCIMAPFetchFoldersOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFETCHFOLDERSOPERATION_H + +#define MAILCORE_MCIMAPFETCHFOLDERSOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFetchFoldersOperation : public IMAPOperation { + public: + IMAPFetchFoldersOperation(); + virtual ~IMAPFetchFoldersOperation(); + + virtual void setFetchSubscribedEnabled(bool enabled); + virtual bool isFetchSubscribedEnabled(); + + // Result. + virtual Array * /* IMAPFolder */ folders(); + + public: // subclass behavior + virtual void main(); + + private: + bool mFetchSubscribedEnabled; + Array * mFolders; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFetchMessagesOperation.h b/MailCore.framework/Headers/MCIMAPFetchMessagesOperation.h new file mode 100644 index 000000000..620aead64 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFetchMessagesOperation.h @@ -0,0 +1,61 @@ +// +// IMAPFetchMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFETCHMESSAGESOPERATION_H + +#define MAILCORE_MCIMAPFETCHMESSAGESOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFetchMessagesOperation : public IMAPOperation { + public: + IMAPFetchMessagesOperation(); + virtual ~IMAPFetchMessagesOperation(); + + virtual void setFetchByUidEnabled(bool enabled); + virtual bool isFetchByUidEnabled(); + + virtual void setIndexes(IndexSet * indexes); + virtual IndexSet * indexes(); + + virtual void setModSequenceValue(uint64_t modseq); + virtual uint64_t modSequenceValue(); + + virtual void setKind(IMAPMessagesRequestKind kind); + virtual IMAPMessagesRequestKind kind(); + + virtual void setExtraHeaders(Array * extraHeaders); + virtual Array * extraHeaders(); + + // Result. + virtual Array * /* IMAPMessage */ messages(); + virtual IndexSet * vanishedMessages(); + + public: // subclass behavior + virtual void main(); + + private: + bool mFetchByUidEnabled; + IndexSet * mIndexes; + IMAPMessagesRequestKind mKind; + Array * /* String */ mExtraHeaders; + Array * /* IMAPMessage */ mMessages; + IndexSet * mVanishedMessages; + uint64_t mModSequenceValue; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFetchNamespaceOperation.h b/MailCore.framework/Headers/MCIMAPFetchNamespaceOperation.h new file mode 100644 index 000000000..35b6ca2b9 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFetchNamespaceOperation.h @@ -0,0 +1,39 @@ +// +// IMAPFetchNamespaceOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFETCHNAMESPACEOPERATION_H + +#define MAILCORE_MCIMAPFETCHNAMESPACEOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFetchNamespaceOperation : public IMAPOperation { + public: + IMAPFetchNamespaceOperation(); + virtual ~IMAPFetchNamespaceOperation(); + + // Result. + virtual HashMap * namespaces(); + + public: // subclass behavior + virtual void main(); + + private: + HashMap * mNamespaces; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFetchParsedContentOperation.h b/MailCore.framework/Headers/MCIMAPFetchParsedContentOperation.h new file mode 100644 index 000000000..ec0485a95 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFetchParsedContentOperation.h @@ -0,0 +1,53 @@ +// +// IMAPFetchParsedContentOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_IMAPFETCHPARSEDCONTENTOPERATION_H + +#define MAILCORE_IMAPFETCHPARSEDCONTENTOPERATION_H + +#include + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFetchParsedContentOperation : public IMAPOperation { + public: + IMAPFetchParsedContentOperation(); + virtual ~IMAPFetchParsedContentOperation(); + + virtual void setUid(uint32_t uid); + virtual uint32_t uid(); + + virtual void setNumber(uint32_t value); + virtual uint32_t number(); + + virtual void setEncoding(Encoding encoding); + virtual Encoding encoding(); + + // Result. + virtual MessageParser * parser(); + + public: // subclass behavior + virtual void main(); + + private: + uint32_t mUid; + uint32_t mNumber; + Encoding mEncoding; + MessageParser * mParser; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFolder.h b/MailCore.framework/Headers/MCIMAPFolder.h new file mode 100644 index 000000000..5d9c111f9 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFolder.h @@ -0,0 +1,42 @@ +#ifndef MAILCORE_MCIMAPFOLDER_H + +#define MAILCORE_MCIMAPFOLDER_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFolder : public Object { + public: + IMAPFolder(); + virtual ~IMAPFolder(); + + virtual void setPath(String * path); + virtual String * path(); + + virtual void setDelimiter(char delimiter); + virtual char delimiter(); + + virtual void setFlags(IMAPFolderFlag flags); + virtual IMAPFolderFlag flags(); + + public: // subclass behavior + IMAPFolder(IMAPFolder * other); + virtual Object * copy(); + virtual String * description(); + + private: + String * mPath; + char mDelimiter; + IMAPFolderFlag mFlags; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFolderInfo.h b/MailCore.framework/Headers/MCIMAPFolderInfo.h new file mode 100644 index 000000000..c0fa7c356 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFolderInfo.h @@ -0,0 +1,63 @@ +// +// MCIMAPFolderInfo.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 12/6/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFolderInfo_H + +#define MAILCORE_MCIMAPFolderInfo_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFolderInfo : public Object { + public: + IMAPFolderInfo(); + virtual ~IMAPFolderInfo(); + + virtual void setUidNext(uint32_t uidNext); + virtual uint32_t uidNext(); + + virtual void setUidValidity(uint32_t uidValidity); + virtual uint32_t uidValidity(); + + virtual void setModSequenceValue(uint64_t modSequenceValue); + virtual uint64_t modSequenceValue(); + + virtual void setMessageCount(int messageCount); + virtual int messageCount(); + + virtual void setFirstUnseenUid(uint32_t firstUnseenUid); + virtual uint32_t firstUnseenUid(); + + virtual void setAllowsNewPermanentFlags(bool allowsNewPermanentFlags); + virtual bool allowsNewPermanentFlags(); + + public: // subclass behavior + IMAPFolderInfo(IMAPFolderInfo * other); + virtual Object * copy(); + + private: + uint32_t mUidNext; + uint32_t mUidValidity; + uint64_t mModSequenceValue; + int mMessageCount; + uint32_t mFirstUnseenUid; + bool mAllowsNewPermanentFlags; + + void init(); + }; + +} + +#endif + +#endif + diff --git a/MailCore.framework/Headers/MCIMAPFolderInfoOperation.h b/MailCore.framework/Headers/MCIMAPFolderInfoOperation.h new file mode 100644 index 000000000..e0b5128c7 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFolderInfoOperation.h @@ -0,0 +1,41 @@ +// +// MCIMAPFolderInfoOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/13/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFOLDERINFOOPERATION_H + +#define MAILCORE_MCIMAPFOLDERINFOOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPFolderInfo; + + class MAILCORE_EXPORT IMAPFolderInfoOperation : public IMAPOperation { + public: + IMAPFolderInfoOperation(); + virtual ~IMAPFolderInfoOperation(); + + IMAPFolderInfo * info(); + + public: // subclass behavior + virtual void main(); + + private: + + IMAPFolderInfo * mInfo; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPFolderStatus.h b/MailCore.framework/Headers/MCIMAPFolderStatus.h new file mode 100644 index 000000000..8bfac59f7 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFolderStatus.h @@ -0,0 +1,64 @@ +// +// MCIMAPFolderStatus.h +// mailcore2 +// +// Created by Sebastian on 6/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPFOLDERSTATUS_H + +#define MAILCORE_MCIMAPFOLDERSTATUS_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPFolderStatus : public Object { + public: + IMAPFolderStatus(); + virtual ~IMAPFolderStatus(); + + virtual void setUnseenCount(uint32_t unseen); + virtual uint32_t unseenCount(); + + virtual void setMessageCount(uint32_t messages); + virtual uint32_t messageCount(); + + virtual void setRecentCount(uint32_t recent); + virtual uint32_t recentCount(); + + virtual void setUidNext(uint32_t uidNext); + virtual uint32_t uidNext(); + + virtual void setUidValidity(uint32_t uidValidity); + virtual uint32_t uidValidity(); + + virtual void setHighestModSeqValue(uint64_t highestModSeqValue); + virtual uint64_t highestModSeqValue(); + + public: // subclass behavior + IMAPFolderStatus(IMAPFolderStatus * other); + virtual Object * copy(); + virtual String * description(); + + private: + uint32_t mUnseenCount; + uint32_t mMessageCount; + uint32_t mRecentCount; + uint32_t mUidNext; + uint32_t mUidValidity; + uint64_t mHighestModSeqValue; + + void init(); + }; + +} + +#endif + +#endif + diff --git a/MailCore.framework/Headers/MCIMAPFolderStatusOperation.h b/MailCore.framework/Headers/MCIMAPFolderStatusOperation.h new file mode 100644 index 000000000..53e3025be --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPFolderStatusOperation.h @@ -0,0 +1,41 @@ +// +// MCIMAPFolderStatusOperation.h +// mailcore2 +// +// Created by Sebastian on 6/5/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + + +#ifndef MAILCORE_MCIMAPFOLDERSTATUSOPERATION_H + +#define MAILCORE_MCIMAPFOLDERSTATUSOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPFolderStatus; + + class MAILCORE_EXPORT IMAPFolderStatusOperation : public IMAPOperation { + public: + IMAPFolderStatusOperation(); + virtual ~IMAPFolderStatusOperation(); + + // Results. + virtual IMAPFolderStatus * status(); + + public: // subclass behavior + virtual void main(); + + private: + IMAPFolderStatus * mStatus; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPIdentity.h b/MailCore.framework/Headers/MCIMAPIdentity.h new file mode 100644 index 000000000..ee6b3c5e6 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPIdentity.h @@ -0,0 +1,56 @@ +// +// MCIMAPIdentity.h +// mailcore2 +// +// Created by Hoa V. DINH on 8/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPIDENTITY_H + +#define MAILCORE_MCIMAPIDENTITY_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPIdentity : public Object { + public: + + IMAPIdentity(); + virtual ~IMAPIdentity(); + + virtual void setVendor(String * vendor); + virtual String * vendor(); + + virtual void setName(String * name); + virtual String * name(); + + virtual void setVersion(String * version); + virtual String * version(); + + virtual void removeAllInfos(); + + virtual Array * allInfoKeys(); + virtual String * infoForKey(String * key); + virtual void setInfoForKey(String * key, String * value); + + public: // subclass behavior + IMAPIdentity(IMAPIdentity * identity); + virtual Object * copy(); + virtual String * description(); + + private: + HashMap * mValues; + + void init(); + }; + +} + +#endif + +#endif + diff --git a/MailCore.framework/Headers/MCIMAPIdentityOperation.h b/MailCore.framework/Headers/MCIMAPIdentityOperation.h new file mode 100644 index 000000000..70cc7d523 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPIdentityOperation.h @@ -0,0 +1,45 @@ +// +// IMAPIdentityOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPIDENTITYOPERATION_H + +#define MAILCORE_MCIMAPIDENTITYOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPIdentity; + + class MAILCORE_EXPORT IMAPIdentityOperation : public IMAPOperation { + public: + IMAPIdentityOperation(); + virtual ~IMAPIdentityOperation(); + + virtual void setClientIdentity(IMAPIdentity * identity); + virtual IMAPIdentity * clientIdentity(); + + // Result. + virtual IMAPIdentity * serverIdentity(); + + public: // subclass behavior + virtual void main(); + + private: + IMAPIdentity * mClientIdentity; + IMAPIdentity * mServerIdentity; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPIdleOperation.h b/MailCore.framework/Headers/MCIMAPIdleOperation.h new file mode 100644 index 000000000..5a383bfd9 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPIdleOperation.h @@ -0,0 +1,46 @@ +// +// IMAPIdleOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPIDLEOPERATION_H + +#define MAILCORE_MCIMAPIDLEOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPIdleOperation : public IMAPOperation { + public: + IMAPIdleOperation(); + virtual ~IMAPIdleOperation(); + + virtual void setLastKnownUID(uint32_t uid); + virtual uint32_t lastKnownUID(); + + virtual void interruptIdle(); + + public: // subclass behavior + virtual void main(); + + private: + uint32_t mLastKnownUid; + bool mSetupSuccess; + bool mInterrupted; + pthread_mutex_t mLock; + void prepare(void * data); + void unprepare(void * data); + bool isInterrupted(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPMessage.h b/MailCore.framework/Headers/MCIMAPMessage.h new file mode 100644 index 000000000..c36a9ad1a --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPMessage.h @@ -0,0 +1,92 @@ +#ifndef MAILCORE_IMAP_MESSAGE_H + +#define MAILCORE_IMAP_MESSAGE_H + +#include +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPPart; + class HTMLRendererIMAPCallback; + class HTMLRendererTemplateCallback; + + class MAILCORE_EXPORT IMAPMessage : public AbstractMessage { + public: + IMAPMessage(); + virtual ~IMAPMessage(); + + virtual uint32_t sequenceNumber(); + virtual void setSequenceNumber(uint32_t sequenceNumber); + + virtual uint32_t uid(); + virtual void setUid(uint32_t uid); + + virtual uint32_t size(); + virtual void setSize(uint32_t size); + + virtual void setFlags(MessageFlag flags); + virtual MessageFlag flags(); + + virtual void setOriginalFlags(MessageFlag flags); + virtual MessageFlag originalFlags(); + + virtual void setCustomFlags(Array * customFlags); + virtual Array * customFlags(); + + virtual uint64_t modSeqValue(); + virtual void setModSeqValue(uint64_t uid); + + virtual void setMainPart(AbstractPart * mainPart); + virtual AbstractPart * mainPart(); + + virtual void setGmailLabels(Array * /* String */ labels); + virtual Array * /* String */ gmailLabels(); + + virtual void setGmailMessageID(uint64_t msgID); + virtual uint64_t gmailMessageID(); + + virtual void setGmailThreadID(uint64_t threadID); + virtual uint64_t gmailThreadID(); + + virtual AbstractPart * partForPartID(String * partID); + + virtual AbstractPart * partForContentID(String * contentID); + virtual AbstractPart * partForUniqueID(String * uniqueID); + + virtual String * htmlRendering(String * folder, + HTMLRendererIMAPCallback * dataCallback, + HTMLRendererTemplateCallback * htmlCallback = NULL); + + public: // subclass behavior + IMAPMessage(IMAPMessage * other); + virtual Object * copy(); + virtual String * description(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + uint64_t mModSeqValue; + uint32_t mUid; + uint32_t mSize; + uint32_t mSequenceNumber; // not serialized. + + MessageFlag mFlags; + MessageFlag mOriginalFlags; + Array * /* String */ mCustomFlags; + AbstractPart * mMainPart; + Array * /* String */ mGmailLabels; + uint64_t mGmailMessageID; + uint64_t mGmailThreadID; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPMessagePart.h b/MailCore.framework/Headers/MCIMAPMessagePart.h new file mode 100644 index 000000000..763172017 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPMessagePart.h @@ -0,0 +1,34 @@ +#ifndef MAILCORE_IMAPMESSAGEPART_H + +#define MAILCORE_IMAPMESSAGEPART_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPMessagePart : public AbstractMessagePart { + public: + IMAPMessagePart(); + virtual ~IMAPMessagePart(); + + virtual void setPartID(String * partID); + virtual String * partID(); + + public: // subclass behavior + IMAPMessagePart(IMAPMessagePart * other); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + String * mPartID; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPMessageRenderingOperation.h b/MailCore.framework/Headers/MCIMAPMessageRenderingOperation.h new file mode 100644 index 000000000..7a02b4ae1 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPMessageRenderingOperation.h @@ -0,0 +1,48 @@ +// +// MCIMAPMessageRenderingOperation.h +// mailcore2 +// +// Created by Paul Young on 27/06/2013. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPMessageRenderingOperation_H + +#define MAILCORE_MCIMAPMessageRenderingOperation_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPMessageRenderingOperation : public IMAPOperation { + public: + IMAPMessageRenderingOperation(); + virtual ~IMAPMessageRenderingOperation(); + + virtual void setRenderingType(IMAPMessageRenderingType type); + virtual IMAPMessageRenderingType renderingType(); + + virtual void setMessage(IMAPMessage * message); + virtual IMAPMessage * message(); + + // Result. + virtual String * result(); + + public: // subclass behavior + virtual void main(); + + private: + IMAPMessageRenderingType mRenderingType; + String * mResult; + IMAPMessage * mMessage; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPMultipart.h b/MailCore.framework/Headers/MCIMAPMultipart.h new file mode 100644 index 000000000..913966245 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPMultipart.h @@ -0,0 +1,34 @@ +#ifndef MAILCORE_MCIMAPMULTIPART_H + +#define MAILCORE_MCIMAPMULTIPART_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPMultipart : public AbstractMultipart { + public: + IMAPMultipart(); + virtual ~IMAPMultipart(); + + virtual void setPartID(String * partID); + virtual String * partID(); + + public: // subclass behavior + IMAPMultipart(IMAPMultipart * other); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + String * mPartID; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPNamespace.h b/MailCore.framework/Headers/MCIMAPNamespace.h new file mode 100644 index 000000000..711fb7e5f --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPNamespace.h @@ -0,0 +1,53 @@ +#ifndef MAILCORE_MCIMAPNAMESPACE_H + +#define MAILCORE_MCIMAPNAMESPACE_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPNamespaceItem; + + class MAILCORE_EXPORT IMAPNamespace : public Object { + public: + IMAPNamespace(); + virtual ~IMAPNamespace(); + + virtual String * mainPrefix(); + virtual char mainDelimiter(); + + virtual Array * /* String */ prefixes(); + + virtual String * pathForComponents(Array * components); + virtual String * pathForComponentsAndPrefix(Array * components, String * prefix); + + virtual Array * /* String */ componentsFromPath(String * path); + + virtual bool containsFolderPath(String * path); + + static IMAPNamespace * namespaceWithPrefix(String * prefix, char delimiter); + + public: // subclass behavior + IMAPNamespace(IMAPNamespace * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + Array * /* String */ mItems; + void init(); + IMAPNamespaceItem * mainItem(); + IMAPNamespaceItem * itemForPath(String * path); + + public: // private + virtual void importIMAPNamespace(struct mailimap_namespace_item * item); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPNamespaceItem.h b/MailCore.framework/Headers/MCIMAPNamespaceItem.h new file mode 100644 index 000000000..0fffed983 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPNamespaceItem.h @@ -0,0 +1,48 @@ +#ifndef MAILCORE_MCIMAPNAMESPACEITEM_H + +#define MAILCORE_MCIMAPNAMESPACEITEM_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPNamespaceItem : public Object { + public: + IMAPNamespaceItem(); + virtual ~IMAPNamespaceItem(); + + virtual void setPrefix(String * prefix); + virtual String * prefix(); + + virtual void setDelimiter(char delimiter); + virtual char delimiter(); + + virtual String * pathForComponents(Array * components); + virtual Array * /* String */ componentsForPath(String * path); + + virtual bool containsFolder(String * folder); + + public: // subclass behavior + IMAPNamespaceItem(IMAPNamespaceItem * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + char mDelimiter; + String * mPrefix; + void init(); + + public: // private + virtual void importIMAPNamespaceInfo(struct mailimap_namespace_info * info); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPNoopOperation.h b/MailCore.framework/Headers/MCIMAPNoopOperation.h new file mode 100644 index 000000000..515f563a9 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPNoopOperation.h @@ -0,0 +1,32 @@ +// +// MCIMAPNoopOperation.h +// mailcore2 +// +// Created by Robert Widmann on 9/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPNOOPOPERATION_H + +#define MAILCORE_MCIMAPNOOPOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPNoopOperation : public IMAPOperation { + public: + IMAPNoopOperation(); + virtual ~IMAPNoopOperation(); + + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPOperation.h b/MailCore.framework/Headers/MCIMAPOperation.h new file mode 100644 index 000000000..a57d74894 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPOperation.h @@ -0,0 +1,73 @@ +// +// MCIMAPOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPOPERATION_H + +#define MAILCORE_MCIMAPOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPAsyncConnection; + class IMAPAsyncSession; + class IMAPOperationCallback; + + class MAILCORE_EXPORT IMAPOperation : public Operation, public IMAPProgressCallback { + public: + IMAPOperation(); + virtual ~IMAPOperation(); + + virtual void setMainSession(IMAPAsyncSession * session); + virtual IMAPAsyncSession * mainSession(); + + virtual void setSession(IMAPAsyncConnection * session); + virtual IMAPAsyncConnection * session(); + + virtual void setFolder(String * folder); + virtual String * folder(); + + virtual void setUrgent(bool urgent); + virtual bool isUrgent(); + + virtual void setImapCallback(IMAPOperationCallback * callback); + virtual IMAPOperationCallback * imapCallback(); + + virtual void beforeMain(); + virtual void afterMain(); + + virtual void start(); + + // Result. + virtual void setError(ErrorCode error); + virtual ErrorCode error(); + + private: + IMAPAsyncSession * mMainSession; + IMAPAsyncConnection * mSession; + String * mFolder; + IMAPOperationCallback * mImapCallback; + ErrorCode mError; + bool mUrgent; + + private: + virtual void bodyProgress(IMAPSession * session, unsigned int current, unsigned int maximum); + virtual void bodyProgressOnMainThread(void * context); + virtual void itemsProgress(IMAPSession * session, unsigned int current, unsigned int maximum); + virtual void itemsProgressOnMainThread(void * context); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPOperationCallback.h b/MailCore.framework/Headers/MCIMAPOperationCallback.h new file mode 100644 index 000000000..c5e14ffb2 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPOperationCallback.h @@ -0,0 +1,31 @@ +// +// MCIMAPOperationCallback.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPOPERATIONCALLBACK_H + +#define MAILCORE_MCIMAPOPERATIONCALLBACK_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPOperation; + + class MAILCORE_EXPORT IMAPOperationCallback { + public: + virtual void bodyProgress(IMAPOperation * session, unsigned int current, unsigned int maximum) {}; + virtual void itemProgress(IMAPOperation * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPPart.h b/MailCore.framework/Headers/MCIMAPPart.h new file mode 100644 index 000000000..1a34da217 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPPart.h @@ -0,0 +1,66 @@ +#ifndef MAILCORE_MCIMAPPART_H + +#define MAILCORE_MCIMAPPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPMessagePart; + class IMAPMultipart; + + class MAILCORE_EXPORT IMAPPart : public AbstractPart { + public: + IMAPPart(); + virtual ~IMAPPart(); + + virtual void setPartID(String * partID); + virtual String * partID(); + + virtual void setSize(unsigned int size); + virtual unsigned int size(); + + virtual unsigned int decodedSize(); + + virtual void setEncoding(Encoding encoding); + virtual Encoding encoding(); + + public: // subclass behavior + IMAPPart(IMAPPart * other); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + public: // private + static AbstractPart * attachmentWithIMAPBody(struct mailimap_body * body); + + virtual void importIMAPFields(struct mailimap_body_fields * fields, + struct mailimap_body_ext_1part * extension); + + private: + String * mPartID; + Encoding mEncoding; + unsigned int mSize; + void init(); + static AbstractPart * attachmentWithIMAPBodyInternal(struct mailimap_body * body, String * partID); + static AbstractPart * attachmentWithIMAPBody1Part(struct mailimap_body_type_1part * body_1part, + String * partID); + static IMAPMessagePart * attachmentWithIMAPBody1PartMessage(struct mailimap_body_type_msg * message, + struct mailimap_body_ext_1part * extension, + String * partID); + static IMAPPart * attachmentWithIMAPBody1PartBasic(struct mailimap_body_type_basic * basic, + struct mailimap_body_ext_1part * extension); + static IMAPPart * attachmentWithIMAPBody1PartText(struct mailimap_body_type_text * text, + struct mailimap_body_ext_1part * extension); + static IMAPMultipart * attachmentWithIMAPBodyMultipart(struct mailimap_body_type_mpart * body_mpart, + String * partID); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPProgressCallback.h b/MailCore.framework/Headers/MCIMAPProgressCallback.h new file mode 100644 index 000000000..b461eefdb --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPProgressCallback.h @@ -0,0 +1,23 @@ +#ifndef MAILCORE_MCIMAPPROGRESSCALLBACK_H + +#define MAILCORE_MCIMAPPROGRESSCALLBACK_H + +#ifdef __cplusplus + +#include + +namespace mailcore { + + class IMAPSession; + + class MAILCORE_EXPORT IMAPProgressCallback { + public: + virtual void bodyProgress(IMAPSession * session, unsigned int current, unsigned int maximum) {}; + virtual void itemsProgress(IMAPSession * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPQuotaOperation.h b/MailCore.framework/Headers/MCIMAPQuotaOperation.h new file mode 100644 index 000000000..15a1c676a --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPQuotaOperation.h @@ -0,0 +1,40 @@ +// +// MCIMAPQuotaOperation.h +// mailcore2 +// +// Created by Petro Korenev on 8/2/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPQuotaOperation_H + +#define MAILCORE_MCIMAPQuotaOperation_H + +#include "MCIMAPOperation.h" + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPQuotaOperation : public IMAPOperation { + public: + IMAPQuotaOperation(); + virtual ~IMAPQuotaOperation(); + + // Result. + virtual uint32_t limit(); + virtual uint32_t usage(); + + public: // subclass behavior + virtual void main(); + + private: + uint32_t mLimit; + uint32_t mUsage; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPSearchExpression.h b/MailCore.framework/Headers/MCIMAPSearchExpression.h new file mode 100644 index 000000000..182f30138 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPSearchExpression.h @@ -0,0 +1,88 @@ +#ifndef MAILCORE_MCIMAPSEARCHEXPRESSION_H + +#define MAILCORE_MCIMAPSEARCHEXPRESSION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPSearchExpression : public Object { + public: + IMAPSearchExpression(); + virtual ~IMAPSearchExpression(); + + virtual IMAPSearchKind kind(); + virtual String * header(); + virtual String * value(); + virtual uint64_t longNumber(); + virtual time_t date(); + virtual IndexSet * uids(); + virtual IndexSet * numbers(); + + + virtual IMAPSearchExpression * leftExpression(); + virtual IMAPSearchExpression * rightExpression(); + + static IMAPSearchExpression * searchAll(); + static IMAPSearchExpression * searchFrom(String * value); + static IMAPSearchExpression * searchTo(String *value); + static IMAPSearchExpression * searchCc(String *value); + static IMAPSearchExpression * searchBcc(String *value); + static IMAPSearchExpression * searchRecipient(String * value); + static IMAPSearchExpression * searchSubject(String * value); + static IMAPSearchExpression * searchContent(String * value); + static IMAPSearchExpression * searchBody(String * value); + static IMAPSearchExpression * searchHeader(String * header, String * value); + static IMAPSearchExpression * searchUIDs(IndexSet * uids); + static IMAPSearchExpression * searchNumbers(IndexSet * numbers); + static IMAPSearchExpression * searchRead(); + static IMAPSearchExpression * searchUnread(); + static IMAPSearchExpression * searchFlagged(); + static IMAPSearchExpression * searchUnflagged(); + static IMAPSearchExpression * searchAnswered(); + static IMAPSearchExpression * searchUnanswered(); + static IMAPSearchExpression * searchDraft(); + static IMAPSearchExpression * searchUndraft(); + static IMAPSearchExpression * searchDeleted(); + static IMAPSearchExpression * searchSpam(); + static IMAPSearchExpression * searchBeforeDate(time_t date); + static IMAPSearchExpression * searchOnDate(time_t date); + static IMAPSearchExpression * searchSinceDate(time_t date); + static IMAPSearchExpression * searchBeforeReceivedDate(time_t date); + static IMAPSearchExpression * searchOnReceivedDate(time_t date); + static IMAPSearchExpression * searchSinceReceivedDate(time_t date); + static IMAPSearchExpression * searchSizeLarger(uint32_t size); + static IMAPSearchExpression * searchSizeSmaller(uint32_t size); + static IMAPSearchExpression * searchGmailThreadID(uint64_t number); + static IMAPSearchExpression * searchGmailMessageID(uint64_t number); + static IMAPSearchExpression * searchGmailRaw(String * expr); + static IMAPSearchExpression * searchAnd(IMAPSearchExpression * left, IMAPSearchExpression * right); + static IMAPSearchExpression * searchOr(IMAPSearchExpression * left, IMAPSearchExpression * right); + static IMAPSearchExpression * searchNot(IMAPSearchExpression * notExpr); + + + public: // subclass behavior + IMAPSearchExpression(IMAPSearchExpression * other); + virtual String * description(); + virtual Object * copy(); + + private: + IMAPSearchKind mKind; + String * mHeader; + String * mValue; + uint64_t mLongNumber; + IndexSet * mUids; + IndexSet * mNumbers; + IMAPSearchExpression * mLeftExpression; + IMAPSearchExpression * mRightExpression; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPSearchOperation.h b/MailCore.framework/Headers/MCIMAPSearchOperation.h new file mode 100644 index 000000000..bb9cef081 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPSearchOperation.h @@ -0,0 +1,54 @@ +// +// IMAPSearchOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPSEARCHOPERATION_H + +#define MAILCORE_MCIMAPSEARCHOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class IMAPSearchExpression; + + class MAILCORE_EXPORT IMAPSearchOperation : public IMAPOperation { + public: + IMAPSearchOperation(); + virtual ~IMAPSearchOperation(); + + virtual void setSearchKind(IMAPSearchKind kind); + virtual IMAPSearchKind searchKind(); + + virtual void setSearchString(String * searchString); + virtual String * searchString(); + + virtual void setSearchExpression(IMAPSearchExpression * expression); + virtual IMAPSearchExpression * searchExpression(); + + // Result. + virtual IndexSet * uids(); + + public: // subclass behavior + virtual void main(); + + private: + IMAPSearchKind mKind; + String * mSearchString; + IMAPSearchExpression * mExpression; + IndexSet * mUids; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPSession.h b/MailCore.framework/Headers/MCIMAPSession.h new file mode 100755 index 000000000..da46e0a7f --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPSession.h @@ -0,0 +1,297 @@ +#ifndef MAILCORE_MCIMAPSESSION_H + +#define MAILCORE_MCIMAPSESSION_H + +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + extern String * IMAPNamespacePersonal; + extern String * IMAPNamespaceOther; + extern String * IMAPNamespaceShared; + + class IMAPNamespace; + class IMAPSearchExpression; + class IMAPFolder; + class IMAPProgressCallback; + class IMAPSyncResult; + class IMAPFolderStatus; + class IMAPIdentity; + + class MAILCORE_EXPORT IMAPSession : public Object { + public: + IMAPSession(); + virtual ~IMAPSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + // To authenticate using OAuth2, username and oauth2token should be set. + // auth type to use is AuthTypeOAuth2. + virtual void setOAuth2Token(String * token); + virtual String * OAuth2Token(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setVoIPEnabled(bool enabled); + virtual bool isVoIPEnabled(); + + // Needed for fetchSubscribedFolders() and fetchAllFolders(). + virtual void setDefaultNamespace(IMAPNamespace * ns); + virtual IMAPNamespace * defaultNamespace(); + + virtual IMAPIdentity * serverIdentity(); + virtual IMAPIdentity * clientIdentity(); + + virtual void select(String * folder, ErrorCode * pError); + virtual IMAPFolderStatus * folderStatus(String * folder, ErrorCode * pError); + + virtual Array * /* IMAPFolder */ fetchSubscribedFolders(ErrorCode * pError); + virtual Array * /* IMAPFolder */ fetchAllFolders(ErrorCode * pError); // will use xlist if available + + virtual void renameFolder(String * folder, String * otherName, ErrorCode * pError); + virtual void deleteFolder(String * folder, ErrorCode * pError); + virtual void createFolder(String * folder, ErrorCode * pError); + + virtual void subscribeFolder(String * folder, ErrorCode * pError); + virtual void unsubscribeFolder(String * folder, ErrorCode * pError); + + virtual void appendMessage(String * folder, Data * messageData, MessageFlag flags, + IMAPProgressCallback * progressCallback, uint32_t * createdUID, ErrorCode * pError); + virtual void appendMessageWithCustomFlags(String * folder, Data * messageData, MessageFlag flags, Array * customFlags, + IMAPProgressCallback * progressCallback, uint32_t * createdUID, ErrorCode * pError); + virtual void appendMessageWithCustomFlagsAndDate(String * folder, Data * messageData, MessageFlag flags, Array * customFlags, time_t date, + IMAPProgressCallback * progressCallback, uint32_t * createdUID, ErrorCode * pError); + + virtual void copyMessages(String * folder, IndexSet * uidSet, String * destFolder, + HashMap ** pUidMapping, ErrorCode * pError); + + virtual void expunge(String * folder, ErrorCode * pError); + + virtual Array * /* IMAPMessage */ fetchMessagesByUID(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * uids, IMAPProgressCallback * progressCallback, + ErrorCode * pError); + virtual Array * /* IMAPMessage */ fetchMessagesByUIDWithExtraHeaders(String * folder, + IMAPMessagesRequestKind requestKind, + IndexSet * uids, + IMAPProgressCallback * progressCallback, + Array * extraHeaders, ErrorCode * pError); + virtual Array * /* IMAPMessage */ fetchMessagesByNumber(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * numbers, IMAPProgressCallback * progressCallback, + ErrorCode * pError); + virtual Array * /* IMAPMessage */ fetchMessagesByNumberWithExtraHeaders(String * folder, + IMAPMessagesRequestKind requestKind, + IndexSet * numbers, + IMAPProgressCallback * progressCallback, + Array * extraHeaders, ErrorCode * pError); + + virtual Data * fetchMessageByUID(String * folder, uint32_t uid, + IMAPProgressCallback * progressCallback, ErrorCode * pError); + virtual Data * fetchMessageByNumber(String * folder, uint32_t number, + IMAPProgressCallback * progressCallback, ErrorCode * pError); + virtual Data * fetchMessageAttachmentByUID(String * folder, uint32_t uid, String * partID, + Encoding encoding, IMAPProgressCallback * progressCallback, ErrorCode * pError); + virtual Data * fetchMessageAttachmentByNumber(String * folder, uint32_t number, String * partID, + Encoding encoding, IMAPProgressCallback * progressCallback, ErrorCode * pError); + virtual HashMap * fetchMessageNumberUIDMapping(String * folder, uint32_t fromUID, uint32_t toUID, + ErrorCode * pError); + + /* When CONDSTORE or QRESYNC is available */ + virtual IMAPSyncResult * syncMessagesByUID(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * uids, uint64_t modseq, + IMAPProgressCallback * progressCallback, ErrorCode * pError); + /* Same as syncMessagesByUID, allows for extra headers */ + virtual IMAPSyncResult * syncMessagesByUIDWithExtraHeaders(String * folder, IMAPMessagesRequestKind requestKind, + IndexSet * uids, uint64_t modseq, + IMAPProgressCallback * progressCallback, + Array * extraHeaders, ErrorCode * pError); + + virtual void storeFlagsByUID(String * folder, IndexSet * uids, IMAPStoreFlagsRequestKind kind, MessageFlag flags, ErrorCode * pError); + virtual void storeFlagsAndCustomFlagsByUID(String * folder, IndexSet * uids, IMAPStoreFlagsRequestKind kind, MessageFlag flags, Array * customFlags, ErrorCode * pError); + virtual void storeFlagsByNumber(String * folder, IndexSet * numbers, IMAPStoreFlagsRequestKind kind, MessageFlag flags, ErrorCode * pError); + virtual void storeFlagsAndCustomFlagsByNumber(String * folder, IndexSet * numbers, IMAPStoreFlagsRequestKind kind, MessageFlag flags, Array * customFlags, ErrorCode * pError); + + virtual void storeLabelsByUID(String * folder, IndexSet * uids, IMAPStoreFlagsRequestKind kind, Array * labels, ErrorCode * pError); + virtual void storeLabelsByNumber(String * folder, IndexSet * numbers, IMAPStoreFlagsRequestKind kind, Array * labels, ErrorCode * pError); + + virtual IndexSet * search(String * folder, IMAPSearchKind kind, String * searchString, ErrorCode * pError); + virtual IndexSet * search(String * folder, IMAPSearchExpression * expression, ErrorCode * pError); + virtual void getQuota(uint32_t *usage, uint32_t *limit, ErrorCode * pError); + + virtual bool setupIdle(); + virtual void idle(String * folder, uint32_t lastKnownUID, ErrorCode * pError); + virtual void interruptIdle(); + virtual void unsetupIdle(); + + virtual void connect(ErrorCode * pError); + virtual void disconnect(); + + virtual void noop(ErrorCode * pError); + + virtual HashMap * fetchNamespace(ErrorCode * pError); + + virtual void login(ErrorCode * pError); + + virtual IMAPIdentity * identity(IMAPIdentity * clientIdentity, ErrorCode * pError); + + virtual IndexSet * capability(ErrorCode * pError); + + virtual void enableCompression(ErrorCode * pError); + + virtual uint32_t uidValidity(); + virtual uint32_t uidNext(); + virtual uint64_t modSequenceValue(); + virtual unsigned int lastFolderMessageCount(); + virtual uint32_t firstUnseenUid(); + + virtual bool isIdleEnabled(); + virtual bool isXListEnabled(); + virtual bool isCondstoreEnabled(); + virtual bool isQResyncEnabled(); + virtual bool isIdentityEnabled(); + virtual bool isXOAuthEnabled(); + virtual bool isNamespaceEnabled(); + virtual bool isCompressionEnabled(); + virtual bool allowsNewPermanentFlags(); + + virtual String * gmailUserDisplayName() DEPRECATED_ATTRIBUTE; + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + + /** HTML rendering of the body of the message to be displayed in a web view.*/ + virtual String * htmlRendering(IMAPMessage * message, String * folder, ErrorCode * pError); + + /** HTML rendering of the body of the message.*/ + virtual String * htmlBodyRendering(IMAPMessage * message, String * folder, ErrorCode * pError); + + /** Text rendering of the message.*/ + virtual String * plainTextRendering(IMAPMessage * message, String * folder, ErrorCode * pError); + + /** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up if requested. + This method can be used to generate the summary of the message.*/ + virtual String * plainTextBodyRendering(IMAPMessage * message, String * folder, bool stripWhitespace, ErrorCode * pError); + + /** Enable automatic query of the capabilities of the IMAP server when set to true. */ + virtual void setAutomaticConfigurationEnabled(bool enabled); + + /** Check if the automatic query of the capabilities of the IMAP server is enabled. */ + virtual bool isAutomaticConfigurationEnabled(); + + public: // private + virtual void loginIfNeeded(ErrorCode * pError); + virtual void connectIfNeeded(ErrorCode * pError); + virtual void selectIfNeeded(String * folder, ErrorCode * pError); + virtual bool isDisconnected(); + virtual bool isAutomaticConfigurationDone(); + virtual void resetAutomaticConfigurationDone(); + virtual void applyCapabilities(IndexSet * capabilities); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + String * mOAuth2Token; + AuthType mAuthType; + ConnectionType mConnectionType; + bool mCheckCertificateEnabled; + bool mVoIPEnabled; + char mDelimiter; + IMAPNamespace * mDefaultNamespace; + IMAPIdentity * mServerIdentity; + IMAPIdentity * mClientIdentity; + time_t mTimeout; + + bool mBodyProgressEnabled; + bool mIdleEnabled; + bool mXListEnabled; + bool mCondstoreEnabled; + bool mQResyncEnabled; + bool mIdentityEnabled; + bool mXOauth2Enabled; + bool mNamespaceEnabled; + bool mCompressionEnabled; + bool mIsGmail; + bool mAllowsNewPermanentFlags; + String * mWelcomeString; + bool mNeedsMboxMailWorkaround; + uint32_t mUIDValidity; + uint32_t mUIDNext; + uint64_t mModSequenceValue; + unsigned int mFolderMsgCount; + uint32_t mFirstUnseenUid; + bool mYahooServer; + + unsigned int mLastFetchedSequenceNumber; + String * mCurrentFolder; + pthread_mutex_t mIdleLock; + bool mCanIdle; + int mState; + mailimap * mImap; + IMAPProgressCallback * mProgressCallback; + unsigned int mProgressItemsCount; + ConnectionLogger * mConnectionLogger; + bool mAutomaticConfigurationEnabled; + bool mAutomaticConfigurationDone; + bool mShouldDisconnect; + + String * mLoginResponse; + String * mGmailUserDisplayName; + + void init(); + void bodyProgress(unsigned int current, unsigned int maximum); + void itemsProgress(unsigned int current, unsigned int maximum); + bool checkCertificate(); + static void body_progress(size_t current, size_t maximum, void * context); + static void items_progress(size_t current, size_t maximum, void * context); + void setup(); + void unsetup(); + char fetchDelimiterIfNeeded(char defaultDelimiter, ErrorCode * pError); + IMAPSyncResult * fetchMessages(String * folder, IMAPMessagesRequestKind requestKind, + bool fetchByUID, struct mailimap_set * imapset, + IndexSet * uidsFilter, IndexSet * numbersFilter, + uint64_t modseq, + HashMap * mapping, IMAPProgressCallback * progressCallback, + Array * extraHeaders, ErrorCode * pError); + void capabilitySetWithSessionState(IndexSet * capabilities); + bool enableFeature(String * feature); + void enableFeatures(); + Data * fetchMessage(String * folder, bool identifier_is_uid, uint32_t identifier, + IMAPProgressCallback * progressCallback, ErrorCode * pError); + void storeFlagsAndCustomFlags(String * folder, bool identifier_is_uid, IndexSet * identifiers, + IMAPStoreFlagsRequestKind kind, MessageFlag flags, Array * customFlags, ErrorCode * pError); + Data * fetchMessageAttachment(String * folder, bool identifier_is_uid, + uint32_t identifier, String * partID, + Encoding encoding, IMAPProgressCallback * progressCallback, ErrorCode * pError); + void storeLabels(String * folder, bool identifier_is_uid, IndexSet * identifiers, IMAPStoreFlagsRequestKind kind, Array * labels, ErrorCode * pError); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIMAPSyncResult.h b/MailCore.framework/Headers/MCIMAPSyncResult.h new file mode 100644 index 000000000..683ca6cc4 --- /dev/null +++ b/MailCore.framework/Headers/MCIMAPSyncResult.h @@ -0,0 +1,39 @@ +// +// MCIMAPSyncResult.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/3/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCIMAPSYNCRESULT_H + +#define MAILCORE_MCIMAPSYNCRESULT_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IMAPSyncResult : public Object { + public: + IMAPSyncResult(); + virtual ~IMAPSyncResult(); + + virtual void setModifiedOrAddedMessages(Array * /* IMAPMessage */ messages); + virtual Array * /* IMAPMessage */ modifiedOrAddedMessages(); + + virtual void setVanishedMessages(IndexSet * vanishedMessages); + virtual IndexSet * vanishedMessages(); + + private: + Array * /* IMAPMessage */ mModifiedOrAddedMessages; + IndexSet * mVanishedMessages; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIndexSet.h b/MailCore.framework/Headers/MCIndexSet.h new file mode 100644 index 000000000..2e2f48924 --- /dev/null +++ b/MailCore.framework/Headers/MCIndexSet.h @@ -0,0 +1,75 @@ +// +// MCIndexSet.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/4/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCINDEXSET_H + +#define MAILCORE_MCINDEXSET_H + +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT IndexSet : public Object { + public: + IndexSet(); + virtual ~IndexSet(); + + static IndexSet * indexSet(); + static IndexSet * indexSetWithRange(Range range); + static IndexSet * indexSetWithIndex(uint64_t idx); + + virtual unsigned int count(); + virtual void addIndex(uint64_t idx); + virtual void removeIndex(uint64_t idx); + virtual bool containsIndex(uint64_t idx); + + virtual void addRange(Range range); + virtual void removeRange(Range range); + virtual void intersectsRange(Range range); + + virtual void addIndexSet(IndexSet * indexSet); + virtual void removeIndexSet(IndexSet * indexSet); + virtual void intersectsIndexSet(IndexSet * indexSet); + + virtual Range * allRanges(); + virtual unsigned int rangesCount(); + virtual void removeAllIndexes(); + + public: // subclass behavior + IndexSet(IndexSet * o); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + Range * mRanges; + unsigned int mCount; + unsigned int mAllocated; + void init(); + int rangeIndexForIndex(uint64_t idx); + int rangeIndexForIndexWithBounds(uint64_t idx, unsigned int left, unsigned int right); + void addRangeIndex(unsigned int rangeIndex); + void removeRangeIndex(unsigned int rangeIndex, unsigned int count); + int rightRangeIndexForIndex(uint64_t idx); + int rightRangeIndexForIndexWithBounds(uint64_t idx, unsigned int left, unsigned int right); + int leftRangeIndexForIndex(uint64_t idx); + int leftRangeIndexForIndexWithBounds(uint64_t idx, unsigned int left, unsigned int right); + void mergeRanges(unsigned int rangeIndex); + void tryToMergeAdjacentRanges(unsigned int rangeIndex); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCIterator.h b/MailCore.framework/Headers/MCIterator.h new file mode 100644 index 000000000..a3e5b1c17 --- /dev/null +++ b/MailCore.framework/Headers/MCIterator.h @@ -0,0 +1,189 @@ +// +// MCIterator.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 4/18/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_ITERATOR_H + +#define MAILCORE_ITERATOR_H + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus + +#define mc_foreacharray(type, __variable, __array) \ +type * __variable; \ +mailcore::ArrayIterator __variable##__iterator = mailcore::ArrayIteratorInit(__array); \ +for (; NULL != (__variable = (type *) mailcore::ArrayIteratorNext(&__variable##__iterator)); ) + +#define mc_foreacharrayIndex(__index, type, __variable, __array) \ +type * __variable; \ +mailcore::ArrayIterator __variable##__iterator = mailcore::ArrayIteratorInit(__array); \ +for (unsigned int __index = 0; NULL != (__variable = (type *) mailcore::ArrayIteratorNext(&__variable##__iterator)); __index++) + +#define mc_foreachhashmapKey(keyType, __key, __hashmap) \ +keyType * __key; \ +HashMapIterator __key##__iterator = HashMapIteratorInit(__hashmap, true, false); \ +while (HashMapIteratorRun(&__key##__iterator)) \ +while (HashMapIteratorNext(&__key##__iterator, (Object **) &__key, (Object **) NULL)) + +#define mc_foreachhashmapValue(valueType, __value, __hashmap) \ +valueType * __value; \ +HashMapIterator __value##__iterator = HashMapIteratorInit(__hashmap, false, true); \ +while (HashMapIteratorRun(&__value##__iterator)) \ +while (HashMapIteratorNext(&__value##__iterator, (Object **) NULL, (Object **) &__value)) + +#define mc_foreachhashmapKeyAndValue(keyType, __key, valueType, __value, __hashmap) \ +keyType * __key; \ +valueType * __value; \ +HashMapIterator __key##__value##__iterator = HashMapIteratorInit(__hashmap, true, true); \ +while (HashMapIteratorRun(&__key##__value##__iterator)) \ +while (HashMapIteratorNext(&__key##__value##__iterator, (Object **) &__key, (Object **) &__value)) + +#define mc_foreachindexset(__variable, __indexset) \ +int64_t __variable; \ +mailcore::IndexSetIterator __variable##__iterator = mailcore::IndexSetIteratorInit(__indexset); \ +for (; (__variable = IndexSetIteratorValue(&__variable##__iterator)), IndexSetIteratorIsValid(&__variable##__iterator) ; mailcore::IndexSetIteratorNext(&__variable##__iterator)) + +namespace mailcore { + + struct IndexSetIterator { + unsigned int rangeIndex; + unsigned int index; + Range * currentRange; + IndexSet * indexSet; + }; + + static inline IndexSetIterator IndexSetIteratorInit(IndexSet * indexSet) + { + IndexSetIterator iterator = { 0, 0, NULL, indexSet }; + if (indexSet->rangesCount() >= 1) { + iterator.currentRange = &indexSet->allRanges()[0]; + } + return iterator; + } + + static inline bool IndexSetIteratorIsValid(IndexSetIterator * iterator) + { + return iterator->currentRange != NULL; + } + + static inline int64_t IndexSetIteratorValue(IndexSetIterator * iterator) + { + return iterator->currentRange == NULL ? -1 : iterator->currentRange->location + iterator->index; + } + + static inline bool IndexSetIteratorNext(IndexSetIterator * iterator) + { + iterator->index ++; + if (iterator->index > iterator->currentRange->length) { + // switch to an other range + iterator->index = 0; + iterator->rangeIndex ++; + if (iterator->rangeIndex >= iterator->indexSet->rangesCount()) { + iterator->currentRange = NULL; + return false; + } + else { + iterator->currentRange = &iterator->indexSet->allRanges()[iterator->rangeIndex]; + return true; + } + } + else { + return true; + } + } + + struct ArrayIterator { + unsigned index; + unsigned count; + Array * array; + }; + + static inline ArrayIterator ArrayIteratorInit(Array * array) + { + ArrayIterator iterator = { 0, array != NULL ? array->count() : 0, array }; + return iterator; + } + + static inline Object * ArrayIteratorNext(ArrayIterator * iterator) + { + if (iterator->index >= iterator->count) { + return NULL; + } + + Object * result = iterator->array->objectAtIndex(iterator->index); + ++ iterator->index; + return result; + } + + + struct HashMapIterator { + bool cleanup; + unsigned index; + unsigned count; + Array * keys; + Array * values; + }; + + static inline HashMapIterator HashMapIteratorInit(HashMap * hashmap, bool useKeys, bool useValues) + { + AutoreleasePool * pool = new AutoreleasePool(); + Array * keys = useKeys ? (hashmap != NULL ? hashmap->allKeys() : NULL) : NULL; + Array * values = useValues ? (hashmap != NULL ? hashmap->allValues() : NULL) : NULL; + if (keys != NULL) { + keys->retain(); + } + if (values != NULL) { + values->retain(); + } + HashMapIterator iterator = { false, 0, hashmap != NULL ? hashmap->count() : 0, keys, values }; + pool->release(); + + return iterator; + } + + static inline bool HashMapIteratorNext(HashMapIterator * iterator, Object ** keyp, Object ** valuep) + { + if (iterator->index >= iterator->count) { + return false; + } + + if (keyp != NULL) { + MCAssert(iterator->keys != NULL); + * keyp = iterator->keys->objectAtIndex(iterator->index); + } + if (valuep != NULL) { + MCAssert(iterator->values != NULL); + * valuep = iterator->values->objectAtIndex(iterator->index); + } + iterator->index ++; + return true; + } + + + static inline bool HashMapIteratorRun(HashMapIterator * iterator) + { + if (!iterator->cleanup) { + iterator->cleanup = true; + return true; + } else { + MC_SAFE_RELEASE(iterator->keys); + MC_SAFE_RELEASE(iterator->values); + return false; + } + } + +}; + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCJSON.h b/MailCore.framework/Headers/MCJSON.h new file mode 100644 index 000000000..f000dc2de --- /dev/null +++ b/MailCore.framework/Headers/MCJSON.h @@ -0,0 +1,38 @@ +// +// MCJSON.h +// hermes +// +// Created by DINH Viêt Hoà on 4/8/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCJSON_H + +#define MAILCORE_MCJSON_H + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Null; + + class MAILCORE_EXPORT JSON { + public: + static String * objectToJSONString(Object * object); + static Data * objectToJSONData(Object * object); + static Object * objectFromJSONString(String * json); + static Object * objectFromJSONData(Data * json); + }; + +} + +#endif + +#endif /* defined(__hermes__MCJSON__) */ diff --git a/MailCore.framework/Headers/MCLibetpanTypes.h b/MailCore.framework/Headers/MCLibetpanTypes.h new file mode 100644 index 000000000..fcb8e70ad --- /dev/null +++ b/MailCore.framework/Headers/MCLibetpanTypes.h @@ -0,0 +1,46 @@ +// +// MCLibetpanTypes.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 4/7/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCLIBETPANTYPES_H + +#define MAILCORE_MCLIBETPANTYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + struct mailimap_body_fields; + struct mailimap_body_ext_1part; + struct mailimf_address; + struct mailimf_mailbox; + struct mailimap_address; + struct mailmime; + struct mailmime_mechanism; + struct mailimap_namespace_item; + struct mailimap_namespace_info; + struct mailimap_body; + struct mailimap_body_fields; + struct mailimap_body_ext_1part; + struct mailimap_body_type_1part; + struct mailimap_body_type_basic; + struct mailimap_body_type_text; + struct mailimap_body_type_mpart; + struct mailimap_body_type_msg; + typedef struct mailimap mailimap; + struct mailimap_set; + struct mailimap_date_time; + struct mailimf_fields; + struct mailimap_envelope; + typedef struct mailpop3 mailpop3; + typedef struct mailsmtp mailsmtp; + typedef struct newsnntp newsnntp; + struct mailsem; +#ifdef __cplusplus +} +#endif + +#endif diff --git a/MailCore.framework/Headers/MCLog.h b/MailCore.framework/Headers/MCLog.h new file mode 100644 index 000000000..5f3efdb5b --- /dev/null +++ b/MailCore.framework/Headers/MCLog.h @@ -0,0 +1,31 @@ +#ifndef MAILCORE_MCLOG_H + +#define MAILCORE_MCLOG_H + +#include +#include + +#define MCLog(...) MCLogInternal(NULL, __FILE__, __LINE__, 0, __VA_ARGS__) +#define MCLogStack(...) MCLogInternal(NULL, __FILE__, __LINE__, 1, __VA_ARGS__) + +MAILCORE_EXPORT +extern int MCLogEnabled; + +#ifndef __printflike +#define __printflike(a,b) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + MAILCORE_EXPORT + void MCLogInternal(const char * user, + const char * filename, + unsigned int line, + int dumpStack, + const char * format, ...) __printflike(5, 6); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMD5.h b/MailCore.framework/Headers/MCMD5.h new file mode 100644 index 000000000..b8cde2e9a --- /dev/null +++ b/MailCore.framework/Headers/MCMD5.h @@ -0,0 +1,28 @@ +// +// MCMD5.h +// hermes +// +// Created by DINH Viêt Hoà on 4/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCMD5_H + +#define MAILCORE_MCMD5_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + MAILCORE_EXPORT + Data * md5Data(Data * data); + + MAILCORE_EXPORT + String * md5String(Data * data); +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMXRecordResolverOperation.h b/MailCore.framework/Headers/MCMXRecordResolverOperation.h new file mode 100644 index 000000000..7d8a6fc8f --- /dev/null +++ b/MailCore.framework/Headers/MCMXRecordResolverOperation.h @@ -0,0 +1,41 @@ +// +// ResolveProviderUsingMXRecordAsync.h +// mailcore2 +// +// Created by Christopher Hockley on 29/01/15. +// Copyright (c) 2015 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCFETCHASYNCMXRECORD_H + +#define MAILCORE_MCFETCHASYNCMXRECORD_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT MXRecordResolverOperation : public Operation { + public: + MXRecordResolverOperation(); + virtual ~MXRecordResolverOperation(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual Array * mxRecords(); + + public: // subclass behavior + virtual void main(); + + private: + Array * mMXRecords; + String * mHostname; + }; +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMailProvider.h b/MailCore.framework/Headers/MCMailProvider.h new file mode 100644 index 000000000..e0801da5b --- /dev/null +++ b/MailCore.framework/Headers/MCMailProvider.h @@ -0,0 +1,75 @@ +// +// MCMailProvider.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCMAILPROVIDER_H + +#define MAILCORE_MCMAILPROVIDER_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NetService; + + class MAILCORE_EXPORT MailProvider : public Object { + public: + static MailProvider * providerWithInfo(HashMap * info); + + MailProvider(); + virtual ~MailProvider(); + + virtual String * identifier(); + + virtual Array * /* NetService */ imapServices(); + virtual Array * /* NetService */ smtpServices(); + virtual Array * /* NetService */ popServices(); + + virtual bool matchEmail(String * email); + virtual bool matchMX(String * hostname); + + virtual String * sentMailFolderPath(); + virtual String * starredFolderPath(); + virtual String * allMailFolderPath(); + virtual String * trashFolderPath(); + virtual String * draftsFolderPath(); + virtual String * spamFolderPath(); + virtual String * importantFolderPath(); + + // Returns true if one of the folders above matches the given one. + virtual bool isMainFolder(String * folderPath, String * prefix); + + public: // subclass behavior + MailProvider(MailProvider * other); + virtual String * description(); + virtual Object * copy(); + + public: // private + virtual void setIdentifier(String * identifier); + virtual void fillWithInfo(HashMap * info); + + private: + String * mIdentifier; + Array * /* String */ mDomainMatch; + Array * /* String */ mDomainExclude; + Array * /* String */ mMxMatch; + Array * /* NetService */ mImapServices; + Array * /* NetService */ mSmtpServices; + Array * /* NetService */ mPopServices; + HashMap * mMailboxPaths; + + virtual bool matchDomain(String * match, String * domain); + void init(); + }; + +}; + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMailProvidersManager.h b/MailCore.framework/Headers/MCMailProvidersManager.h new file mode 100644 index 000000000..42d1d3bc8 --- /dev/null +++ b/MailCore.framework/Headers/MCMailProvidersManager.h @@ -0,0 +1,43 @@ +// +// MCMailProvidersManager.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCMAILPROVIDERSMANAGER_H + +#define MAILCORE_MCMAILPROVIDERSMANAGER_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MailProvider; + + class MAILCORE_EXPORT MailProvidersManager : public Object { + public: + static MailProvidersManager * sharedManager(); + + virtual MailProvider * providerForEmail(String * email); + virtual MailProvider * providerForMX(String * hostname); + virtual MailProvider * providerForIdentifier(String * identifier); + + virtual void registerProvidersWithFilename(String * filename); + + private: + MailProvidersManager(); + void registerProviders(HashMap * providers); + + HashMap * mProviders; + + void init(); + }; +} + +#endif + +#endif \ No newline at end of file diff --git a/MailCore.framework/Headers/MCMainThread.h b/MailCore.framework/Headers/MCMainThread.h new file mode 100644 index 000000000..df246665a --- /dev/null +++ b/MailCore.framework/Headers/MCMainThread.h @@ -0,0 +1,20 @@ +#ifndef MAILCORE_MCMAINTHREAD_H + +#define MAILCORE_MCMAINTHREAD_H + +#ifdef __cplusplus + +namespace mailcore { + void callOnMainThread(void (*)(void *), void * context); + void callOnMainThreadAndWait(void (*)(void *), void * context); + + // Returns a "call" object. + void * callAfterDelay(void (*)(void *), void * context, double time); + + // Pass the pointer returns by callAfterDelay() to cancel a delayed call. + void cancelDelayedCall(void * call); +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMessageBuilder.h b/MailCore.framework/Headers/MCMessageBuilder.h new file mode 100644 index 000000000..f03bd09a8 --- /dev/null +++ b/MailCore.framework/Headers/MCMessageBuilder.h @@ -0,0 +1,80 @@ +#ifndef MAILCORE_MCMESSAGEBUILDER_H + +#define MAILCORE_MCMESSAGEBUILDER_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Attachment; + class HTMLRendererTemplateCallback; + + class MAILCORE_EXPORT MessageBuilder : public AbstractMessage { + public: + MessageBuilder(); + virtual ~MessageBuilder(); + + virtual void setHTMLBody(String * htmlBody); + virtual String * htmlBody(); + + virtual void setTextBody(String * textBody); + virtual String * textBody(); + + virtual void setAttachments(Array * /* Attachment */ attachments); + virtual Array * /* Attachment */ attachments(); + virtual void addAttachment(Attachment * attachment); + + // attachments (usually images) that are included in HTML. + // a Content-ID should be assigned to these part to be able to reference + // them in the HTML using a cid: URL. + virtual void setRelatedAttachments(Array * /* Attachment */ attachments); + virtual Array * /* Attachment */ relatedAttachments(); + virtual void addRelatedAttachment(Attachment * attachment); + + // When boundary needs to be prefixed (to go through spam filters). + virtual void setBoundaryPrefix(String * boundaryPrefix); + virtual String * boundaryPrefix(); + + virtual Data * data(); + virtual Data * dataForEncryption(); + + virtual String * htmlRendering(HTMLRendererTemplateCallback * htmlCallback = NULL); + virtual String * htmlBodyRendering(); + + virtual String * plainTextRendering(); + virtual String * plainTextBodyRendering(bool stripWhitespace); + + virtual Data * openPGPSignedMessageDataWithSignatureData(Data * signature); + virtual Data * openPGPEncryptedMessageDataWithEncryptedData(Data * encryptedData); + + public: // subclass behavior + MessageBuilder(MessageBuilder * other); + virtual String * description(); + virtual Object * copy(); + + public: // private + virtual String * nextBoundary(); + virtual void resetBoundaries(); + virtual void setBoundaries(Array * boundaries); + + private: + String * mHTMLBody; + String * mTextBody; + Array * /* Attachment */ mAttachments; + Array * /* Attachment */ mRelatedAttachments; + String * mBoundaryPrefix; + void init(); + Data * dataAndFilterBccAndForEncryption(bool filterBcc, bool forEncryption); + struct mailmime * mimeAndFilterBccAndForEncryption(bool filterBcc, bool forEncryption); + Array * mBoundaries; + unsigned int mCurrentBoundaryIndex; + }; + +}; + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMessageConstants.h b/MailCore.framework/Headers/MCMessageConstants.h new file mode 100644 index 000000000..449d7e847 --- /dev/null +++ b/MailCore.framework/Headers/MCMessageConstants.h @@ -0,0 +1,279 @@ +#ifndef MAILCORE_MCMESSAGECONSTANTS_H + +#define MAILCORE_MCMESSAGECONSTANTS_H + +#ifdef __cplusplus + +namespace mailcore { + + enum ConnectionType { + ConnectionTypeClear = 1 << 0, + ConnectionTypeStartTLS = 1 << 1, + ConnectionTypeTLS = 1 << 2, + }; + + enum AuthType { + AuthTypeSASLNone = 0, + AuthTypeSASLCRAMMD5 = 1 << 0, + AuthTypeSASLPlain = 1 << 1, + AuthTypeSASLGSSAPI = 1 << 2, + AuthTypeSASLDIGESTMD5 = 1 << 3, + AuthTypeSASLLogin = 1 << 4, + AuthTypeSASLSRP = 1 << 5, + AuthTypeSASLNTLM = 1 << 6, + AuthTypeSASLKerberosV4 = 1 << 7, + AuthTypeXOAuth2 = 1 << 8, + AuthTypeXOAuth2Outlook = 1 << 9, + }; + + enum IMAPFolderFlag { + IMAPFolderFlagNone = 0, + IMAPFolderFlagMarked = 1 << 0, + IMAPFolderFlagUnmarked = 1 << 1, + IMAPFolderFlagNoSelect = 1 << 2, + IMAPFolderFlagNoInferiors = 1 << 3, + IMAPFolderFlagInbox = 1 << 4, + IMAPFolderFlagSentMail = 1 << 5, + IMAPFolderFlagStarred = 1 << 6, + IMAPFolderFlagAllMail = 1 << 7, + IMAPFolderFlagTrash = 1 << 8, + IMAPFolderFlagDrafts = 1 << 9, + IMAPFolderFlagSpam = 1 << 10, + IMAPFolderFlagImportant = 1 << 11, + IMAPFolderFlagArchive = 1 << 12, + IMAPFolderFlagAll = IMAPFolderFlagAllMail, + IMAPFolderFlagJunk = IMAPFolderFlagSpam, + IMAPFolderFlagFlagged = IMAPFolderFlagStarred, + IMAPFolderFlagFolderTypeMask = IMAPFolderFlagInbox | IMAPFolderFlagSentMail | IMAPFolderFlagStarred | IMAPFolderFlagAllMail | + IMAPFolderFlagTrash| IMAPFolderFlagDrafts | IMAPFolderFlagSpam | IMAPFolderFlagImportant | IMAPFolderFlagArchive, + }; + + enum MessageFlag { + MessageFlagNone = 0, + MessageFlagSeen = 1 << 0, + MessageFlagAnswered = 1 << 1, + MessageFlagFlagged = 1 << 2, + MessageFlagDeleted = 1 << 3, + MessageFlagDraft = 1 << 4, + MessageFlagMDNSent = 1 << 5, + MessageFlagForwarded = 1 << 6, + MessageFlagSubmitPending = 1 << 7, + MessageFlagSubmitted = 1 << 8, + MessageFlagMaskAll = MessageFlagSeen | MessageFlagAnswered | MessageFlagFlagged | + MessageFlagDeleted | MessageFlagDraft | MessageFlagMDNSent | MessageFlagForwarded | + MessageFlagSubmitPending | MessageFlagSubmitted, + } ; + + enum IMAPMessagesRequestKind { + IMAPMessagesRequestKindUid = 0, // This is the default and it's always fetched + IMAPMessagesRequestKindFlags = 1 << 0, + IMAPMessagesRequestKindHeaders = 1 << 1, + IMAPMessagesRequestKindStructure = 1 << 2, + IMAPMessagesRequestKindInternalDate = 1 << 3, + IMAPMessagesRequestKindFullHeaders = 1 << 4, + IMAPMessagesRequestKindHeaderSubject = 1 << 5, + IMAPMessagesRequestKindGmailLabels = 1 << 6, + IMAPMessagesRequestKindGmailMessageID = 1 << 7, + IMAPMessagesRequestKindGmailThreadID = 1 << 8, + IMAPMessagesRequestKindExtraHeaders = 1 << 9, + IMAPMessagesRequestKindSize = 1 << 10, + }; + + enum IMAPFetchRequestType { + IMAPFetchRequestTypeUID = 0, + IMAPFetchRequestTypeSequence = 1 + }; + + enum IMAPStoreFlagsRequestKind { + IMAPStoreFlagsRequestKindAdd, + IMAPStoreFlagsRequestKindRemove, + IMAPStoreFlagsRequestKindSet, + }; + + enum IMAPWorkaround { + IMAPWorkaroundGmail = 1 << 0, + IMAPWorkaroundYahoo = 1 << 1, + IMAPWorkaroundExchange2003 = 1 << 2, + }; + + enum IMAPCapability { + IMAPCapabilityACL, + IMAPCapabilityBinary, + IMAPCapabilityCatenate, + IMAPCapabilityChildren, + IMAPCapabilityCompressDeflate, + IMAPCapabilityCondstore, + IMAPCapabilityEnable, + IMAPCapabilityIdle, + IMAPCapabilityId, + IMAPCapabilityLiteralPlus, + IMAPCapabilityMultiAppend, + IMAPCapabilityNamespace, + IMAPCapabilityQResync, + IMAPCapabilityQuota, + IMAPCapabilitySort, + IMAPCapabilityStartTLS, + IMAPCapabilityThreadOrderedSubject, + IMAPCapabilityThreadReferences, + IMAPCapabilityUIDPlus, + IMAPCapabilityUnselect, + IMAPCapabilityXList, + IMAPCapabilityAuthAnonymous, + IMAPCapabilityAuthCRAMMD5, + IMAPCapabilityAuthDigestMD5, + IMAPCapabilityAuthExternal, + IMAPCapabilityAuthGSSAPI, + IMAPCapabilityAuthKerberosV4, + IMAPCapabilityAuthLogin, + IMAPCapabilityAuthNTLM, + IMAPCapabilityAuthOTP, + IMAPCapabilityAuthPlain, + IMAPCapabilityAuthSKey, + IMAPCapabilityAuthSRP, + IMAPCapabilityXOAuth2, + IMAPCapabilityGmail, + }; + + enum POPCapability { + POPCapabilityNone, + POPCapabilityStartTLS, + POPCapabilityTop, + POPCapabilityUser, + POPCapabilityRespCodes, + POPCapabilityPipelining, + POPCapabilityUIDL, + POPCapabilitySASL, + POPCapabilityAuthAnonymous, + POPCapabilityAuthCRAMMD5, + POPCapabilityAuthDigestMD5, + POPCapabilityAuthExternal, + POPCapabilityAuthGSSAPI, + POPCapabilityAuthKerberosV4, + POPCapabilityAuthLogin, + POPCapabilityAuthNTLM, + POPCapabilityAuthOTP, + POPCapabilityAuthPlain, + POPCapabilityAuthSKey, + POPCapabilityAuthSRP, + }; + + enum Encoding { + Encoding7Bit = 0, // should match MAILIMAP_BODY_FLD_ENC_7BIT + Encoding8Bit = 1, // should match MAILIMAP_BODY_FLD_ENC_8BIT + EncodingBinary = 2, // should match MAILIMAP_BODY_FLD_ENC_BINARY + EncodingBase64 = 3, // should match MAILIMAP_BODY_FLD_ENC_BASE64 + EncodingQuotedPrintable = 4, // should match MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE + EncodingOther = 5, // should match MAILIMAP_BODY_FLD_ENC_OTHER + // negative values should be used for other encoding + EncodingUUEncode = -1 + }; + + enum IMAPSearchKind { + IMAPSearchKindAll, + IMAPSearchKindNone, + IMAPSearchKindFrom, + IMAPSearchKindTo, + IMAPSearchKindCc, + IMAPSearchKindBcc, + IMAPSearchKindRecipient, // Recipient is the combination of To, Cc and Bcc + IMAPSearchKindSubject, + IMAPSearchKindContent, + IMAPSearchKindBody, + IMAPSearchKindUIDs, + IMAPSearchKindNumbers, + IMAPSearchKindHeader, + IMAPSearchKindRead, + IMAPSearchKindUnread, + IMAPSearchKindFlagged, + IMAPSearchKindUnflagged, + IMAPSearchKindAnswered, + IMAPSearchKindUnanswered, + IMAPSearchKindDraft, + IMAPSearchKindUndraft, + IMAPSearchKindDeleted, + IMAPSearchKindSpam, + IMAPSearchKindBeforeDate, + IMAPSearchKindOnDate, + IMAPSearchKindSinceDate, + IMAPSearchKindBeforeReceivedDate, + IMAPSearchKindOnReceivedDate, + IMAPSearchKindSinceReceivedDate, + IMAPSearchKindSizeLarger, + IMAPSearchKindSizeSmaller, + IMAPSearchKindGmailThreadID, + IMAPSearchKindGmailMessageID, + IMAPSearchKindGmailRaw, + IMAPSearchKindOr, + IMAPSearchKindAnd, + IMAPSearchKindNot, + }; + + enum ErrorCode { + ErrorNone, // 0 + ErrorConnection, + ErrorTLSNotAvailable, + ErrorParse, + ErrorCertificate, + ErrorAuthentication, + ErrorGmailIMAPNotEnabled, + ErrorGmailExceededBandwidthLimit, + ErrorGmailTooManySimultaneousConnections, + ErrorMobileMeMoved, + ErrorYahooUnavailable, // 10 + ErrorNonExistantFolder, + ErrorRename, + ErrorDelete, + ErrorCreate, + ErrorSubscribe, + ErrorAppend, + ErrorCopy, + ErrorExpunge, + ErrorFetch, + ErrorIdle, // 20 + ErrorIdentity, + ErrorNamespace, + ErrorStore, + ErrorCapability, + ErrorStartTLSNotAvailable, + ErrorSendMessageIllegalAttachment, + ErrorStorageLimit, + ErrorSendMessageNotAllowed, + ErrorNeedsConnectToWebmail, + ErrorSendMessage, // 30 + ErrorAuthenticationRequired, + ErrorFetchMessageList, + ErrorDeleteMessage, + ErrorInvalidAccount, + ErrorFile, + ErrorCompression, + ErrorNoSender, + ErrorNoRecipient, + ErrorNoop, + ErrorGmailApplicationSpecificPasswordRequired, // 40 + ErrorServerDate, + ErrorNoValidServerFound, + }; + + enum PartType { + PartTypeSingle, + PartTypeMessage, + PartTypeMultipartMixed, + PartTypeMultipartRelated, + PartTypeMultipartAlternative, + PartTypeMultipartSigned, + }; + + // Private type - It should not be used directly. + enum IMAPMessageRenderingType { + IMAPMessageRenderingTypeHTML, + IMAPMessageRenderingTypeHTMLBody, + IMAPMessageRenderingTypePlainText, + IMAPMessageRenderingTypePlainTextBody, + IMAPMessageRenderingTypePlainTextBodyAndStripWhitespace, + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMessageHeader.h b/MailCore.framework/Headers/MCMessageHeader.h new file mode 100644 index 000000000..439e0d441 --- /dev/null +++ b/MailCore.framework/Headers/MCMessageHeader.h @@ -0,0 +1,111 @@ +#ifndef MAILCORE_MCMESSAGEHEADER_H + +#define MAILCORE_MCMESSAGEHEADER_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Address; + + class MAILCORE_EXPORT MessageHeader : public Object { + public: + MessageHeader(); + virtual ~MessageHeader(); + + virtual void setMessageID(String * messageID); + virtual String * messageID(); + + virtual bool isMessageIDAutoGenerated(); + + virtual void setReferences(Array * /* String */ references); + virtual Array * /* String */ references(); + + virtual void setInReplyTo(Array * /* String */ inReplyTo); + virtual Array * /* String */ inReplyTo(); + + virtual void setDate(time_t date); + virtual time_t date(); + + virtual void setReceivedDate(time_t date); + virtual time_t receivedDate(); + + virtual void setSender(Address * sender); + virtual Address * sender(); + + virtual void setFrom(Address * from); + virtual Address * from(); + + virtual void setTo(Array * /* Address */ to); + virtual Array * /* Address */ to(); + + virtual void setCc(Array * /* Address */ cc); + virtual Array * /* Address */ cc(); + + virtual void setBcc(Array * /* Address */ bcc); + virtual Array * /* Address */ bcc(); + + virtual void setReplyTo(Array * /* Address */ replyTo); + virtual Array * /* Address */ replyTo(); + + virtual void setSubject(String * subject); + virtual String * subject(); + + virtual void setUserAgent(String * userAgent); + virtual String * userAgent(); + + virtual void setExtraHeader(String *name, String * value); + virtual void removeExtraHeader(String *name); + virtual String * extraHeaderValueForName(String *name); + virtual Array * allExtraHeadersNames(); + + String * extractedSubject(); + virtual String * partialExtractedSubject(); + virtual void importHeadersData(Data * data); + + virtual MessageHeader * replyHeader(bool replyAll, Array * addressesExcludedFromRecipient); + virtual MessageHeader * forwardHeader(); + + public: // subclass behavior + MessageHeader(MessageHeader * other); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + public: // private + virtual void importIMAPEnvelope(struct mailimap_envelope * env); + virtual void importIMAPReferences(Data * data); + virtual void importIMAPInternalDate(struct mailimap_date_time * date); + + virtual struct mailimf_fields * createIMFFieldsAndFilterBcc(bool filterBcc); + virtual void importIMFFields(struct mailimf_fields * fields); + + private: + String * mMessageID; + bool mMessageIDAutoGenerated; + Array * /* String */ mReferences; + Array * /* String */ mInReplyTo; + Address * mSender; + Address * mFrom; + Array * /* Address */ mTo; + Array * /* Address */ mCc; + Array * /* Address */ mBcc; + Array * /* Address */ mReplyTo; + String * mSubject; + time_t mDate; + time_t mReceivedDate; + HashMap * mExtraHeaders; + void init(bool generateDate, bool generateMessageID); + void setExtraHeaders(HashMap *headers); + Array * recipientWithReplyAll(bool replyAll, bool includeTo, bool includeCc, Array * senderEmails); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMessageParser.h b/MailCore.framework/Headers/MCMessageParser.h new file mode 100644 index 000000000..9682bfce2 --- /dev/null +++ b/MailCore.framework/Headers/MCMessageParser.h @@ -0,0 +1,70 @@ +#ifndef MAILCORE_MCPARSEDMESSAGE_H + +#define MAILCORE_MCPARSEDMESSAGE_H + +#include +#include +#include +#ifdef __APPLE__ +#import +#endif + +#ifdef __cplusplus + +namespace mailcore { + + class HTMLRendererTemplateCallback; + + class MAILCORE_EXPORT MessageParser : public AbstractMessage { + public: + static MessageParser * messageParserWithData(Data * data); + static MessageParser * messageParserWithContentsOfFile(String * filename); + + MessageParser(); + MessageParser(Data * data); + virtual ~MessageParser(); + + virtual AbstractPart * mainPart(); + virtual Data * data(); + + virtual String * htmlRendering(HTMLRendererTemplateCallback * htmlCallback = NULL); + virtual String * htmlBodyRendering(); + + virtual String * plainTextRendering(); + virtual String * plainTextBodyRendering(bool stripWhitespace); + + public: // subclass behavior + MessageParser(MessageParser * other); + virtual String * description(); + virtual Object * copy(); + + virtual AbstractPart * partForContentID(String * contentID); + virtual AbstractPart * partForUniqueID(String * uniqueID); + + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + +#ifdef __APPLE__ + public: + static MessageParser * messageParserWithData(CFDataRef data); + MessageParser(CFDataRef data); +#endif + + private: + Data * mData; + AbstractPart * mMainPart; + void init(); +#if __APPLE__ + void * mNSData; +#endif + + private: + void setBytes(char * bytes, unsigned int length); + Data * dataFromNSData(); + }; + +}; + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMessagePart.h b/MailCore.framework/Headers/MCMessagePart.h new file mode 100644 index 000000000..894cd3e5f --- /dev/null +++ b/MailCore.framework/Headers/MCMessagePart.h @@ -0,0 +1,26 @@ +#ifndef MAILCORE_MCMESSAGEPART_H + +#define MAILCORE_MCMESSAGEPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT MessagePart : public AbstractMessagePart { + public: + MessagePart(); + virtual ~MessagePart(); + + public: // subclass behavior + MessagePart(MessagePart * other); + virtual Object * copy(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCMultipart.h b/MailCore.framework/Headers/MCMultipart.h new file mode 100644 index 000000000..40b0a48b6 --- /dev/null +++ b/MailCore.framework/Headers/MCMultipart.h @@ -0,0 +1,26 @@ +#ifndef MAILCORE_MCMULTIPART_H + +#define MAILCORE_MCMULTIPART_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT Multipart : public AbstractMultipart { + public: + Multipart(); + virtual ~Multipart(); + + public: // subclass behavior + Multipart(Multipart * other); + virtual Object * copy(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTP.h b/MailCore.framework/Headers/MCNNTP.h new file mode 100644 index 000000000..c2da3a669 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTP.h @@ -0,0 +1,9 @@ +#ifndef MAILCORE_MCNNTP_H + +#define MAILCORE_MCNNTP_H + +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCNNTPAsyncSession.h b/MailCore.framework/Headers/MCNNTPAsyncSession.h new file mode 100644 index 000000000..8a5753d46 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPAsyncSession.h @@ -0,0 +1,98 @@ +#ifndef MAILCORE_MCNNTPASYNCSESSION_H + +#define MAILCORE_MCNNTPASYNCSESSION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NNTPOperation; + class NNTPSession; + class NNTPFetchHeaderOperation; + class NNTPFetchArticleOperation; + class NNTPFetchAllArticlesOperation; + class NNTPFetchOverviewOperation; + class NNTPListNewsgroupsOperation; + class NNTPFetchServerTimeOperation; + class NNTPOperationQueueCallback; + class NNTPConnectionLogger; + + class MAILCORE_EXPORT NNTPAsyncSession : public Object { + public: + NNTPAsyncSession(); + virtual ~NNTPAsyncSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * login); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + virtual void setOperationQueueCallback(OperationQueueCallback * callback); + virtual OperationQueueCallback * operationQueueCallback(); + virtual bool isOperationQueueRunning(); + virtual void cancelAllOperations(); + + virtual NNTPFetchAllArticlesOperation * fetchAllArticlesOperation(String * group); + + virtual NNTPFetchHeaderOperation * fetchHeaderOperation(String * groupName, unsigned int index); + + virtual NNTPFetchArticleOperation * fetchArticleOperation(String *groupName, unsigned int index); + virtual NNTPFetchArticleOperation * fetchArticleByMessageIDOperation(String * groupname, String * messageID); + + virtual NNTPFetchOverviewOperation * fetchOverviewOperationWithIndexes(String * groupName, IndexSet * indexes); + + virtual NNTPFetchServerTimeOperation * fetchServerDateOperation(); + + virtual NNTPListNewsgroupsOperation * listAllNewsgroupsOperation(); + virtual NNTPListNewsgroupsOperation * listDefaultNewsgroupsOperation(); + + virtual NNTPOperation * disconnectOperation(); + + virtual NNTPOperation * checkAccountOperation(); + + private: + NNTPSession * mSession; + OperationQueue * mQueue; + NNTPOperationQueueCallback * mQueueCallback; + ConnectionLogger * mConnectionLogger; + pthread_mutex_t mConnectionLoggerLock; + NNTPConnectionLogger * mInternalLogger; + OperationQueueCallback * mOperationQueueCallback; + + public: // private + virtual void runOperation(NNTPOperation * operation); + virtual NNTPSession * session(); + virtual void logConnection(ConnectionLogType logType, Data * buffer); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPCheckAccountOperation.h b/MailCore.framework/Headers/MCNNTPCheckAccountOperation.h new file mode 100644 index 000000000..395178a00 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPCheckAccountOperation.h @@ -0,0 +1,32 @@ +// +// MCNNTPCheckAccountOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPCHECKACCOUNTOPERATION_H + +#define MAILCORE_MCNNTPCHECKACCOUNTOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPCheckAccountOperation : public NNTPOperation { + public: + NNTPCheckAccountOperation(); + virtual ~NNTPCheckAccountOperation(); + + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPFetchAllArticlesOperation.h b/MailCore.framework/Headers/MCNNTPFetchAllArticlesOperation.h new file mode 100644 index 000000000..0fa532c8e --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPFetchAllArticlesOperation.h @@ -0,0 +1,41 @@ +// +// MCNNTPFetchAllArticlesOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPFETCHARTICLESOPERATION_H + +#define MAILCORE_MCNNTPFETCHARTICLESOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPFetchAllArticlesOperation : public NNTPOperation { + public: + NNTPFetchAllArticlesOperation(); + virtual ~NNTPFetchAllArticlesOperation(); + + virtual void setGroupName(String * groupName); + virtual String * groupName(); + + virtual IndexSet * articles(); + + public: // subclass behavior + virtual void main(); + + private: + String * mGroupName; + IndexSet * mArticles; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPFetchArticleOperation.h b/MailCore.framework/Headers/MCNNTPFetchArticleOperation.h new file mode 100644 index 000000000..3e066b7ba --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPFetchArticleOperation.h @@ -0,0 +1,49 @@ +// +// MCNNTPFetchArticleOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPFETCHARTICLEOPERATION_H + +#define MAILCORE_MCNNTPFETCHARTICLEOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + class MAILCORE_EXPORT NNTPFetchArticleOperation : public NNTPOperation { + public: + NNTPFetchArticleOperation(); + virtual ~NNTPFetchArticleOperation(); + + virtual void setGroupName(String * groupName); + virtual String * groupName(); + + virtual void setMessageID(String * groupName); + virtual String * messageID(); + + virtual void setMessageIndex(unsigned int messageIndex); + virtual unsigned int messageIndex(); + + virtual Data * data(); + + public: // subclass behavior + virtual void main(); + + private: + String * mGroupName; + String * mMessageID; + unsigned int mMessageIndex; + Data * mData; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPFetchHeaderOperation.h b/MailCore.framework/Headers/MCNNTPFetchHeaderOperation.h new file mode 100644 index 000000000..93b9d380f --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPFetchHeaderOperation.h @@ -0,0 +1,48 @@ +// +// MCNNTPFetchHeaderOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPFETCHHEADEROPERATION_H + +#define MAILCORE_MCNNTPFETCHHEADEROPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessageHeader; + + class MAILCORE_EXPORT NNTPFetchHeaderOperation : public NNTPOperation { + public: + NNTPFetchHeaderOperation(); + virtual ~NNTPFetchHeaderOperation(); + + virtual void setGroupName(String * groupName); + virtual String * groupName(); + + virtual void setMessageIndex(unsigned int messageIndex); + virtual unsigned int messageIndex(); + + virtual MessageHeader * header(); + + public: // subclass behavior + virtual void main(); + + private: + String * mGroupName; + unsigned int mMessageIndex; + MessageHeader * mHeader; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPFetchOverviewOperation.h b/MailCore.framework/Headers/MCNNTPFetchOverviewOperation.h new file mode 100644 index 000000000..bf8db26fe --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPFetchOverviewOperation.h @@ -0,0 +1,45 @@ +// +// NNTPFetchOverviewOperation.h +// mailcore2 +// +// Created by Robert Widmann on 10/21/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPFETCHOVERVIEWOPERATION_H + +#define MAILCORE_MCNNTPFETCHOVERVIEWOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPFetchOverviewOperation : public NNTPOperation { + public: + NNTPFetchOverviewOperation(); + virtual ~NNTPFetchOverviewOperation(); + + virtual void setIndexes(IndexSet * indexes); + virtual IndexSet * indexes(); + + virtual void setGroupName(String * groupName); + virtual String * groupName(); + + virtual Array * articles(); + + public: // subclass behavior + virtual void main(); + + private: + IndexSet * mIndexes; + String * mGroupName; + Array * /* MessageHeader */ mArticles; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPFetchServerTimeOperation.h b/MailCore.framework/Headers/MCNNTPFetchServerTimeOperation.h new file mode 100644 index 000000000..b01a1599c --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPFetchServerTimeOperation.h @@ -0,0 +1,37 @@ +// +// MCNNTPFetchServerTimeOperation.h +// mailcore2 +// +// Created by Robert Widmann on 10/21/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPFETCHSERVERTIMEOPERATION_H + +#define MAILCORE_MCNNTPFETCHSERVERTIMEOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPFetchServerTimeOperation : public NNTPOperation { + public: + NNTPFetchServerTimeOperation(); + virtual ~NNTPFetchServerTimeOperation(); + + virtual time_t time(); + + public: // subclass behavior + virtual void main(); + + private: + time_t mTime; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPGroupInfo.h b/MailCore.framework/Headers/MCNNTPGroupInfo.h new file mode 100644 index 000000000..75a6675c3 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPGroupInfo.h @@ -0,0 +1,38 @@ +#ifndef MAILCORE_MCNNTPGROUPINFO_H + +#define MAILCORE_MCNNTPGROUPINFO_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPGroupInfo : public Object { + public: + NNTPGroupInfo(); + virtual ~NNTPGroupInfo(); + + virtual void setName(String * uid); + virtual String * name(); + + virtual void setMessageCount(uint32_t messages); + virtual uint32_t messageCount(); + + public: // subclass behavior + NNTPGroupInfo(NNTPGroupInfo * other); + virtual String * description(); + virtual Object * copy(); + + private: + String * mName; + uint32_t mMessageCount; + + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPListNewsgroupsOperation.h b/MailCore.framework/Headers/MCNNTPListNewsgroupsOperation.h new file mode 100644 index 000000000..d2c68038f --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPListNewsgroupsOperation.h @@ -0,0 +1,41 @@ +// +// MCNNTPListNewsgroupsMessagesOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPLISTNEWSGROUPSOPERATION_H + +#define MAILCORE_MCNNTPLISTNEWSGROUPSOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NNTPListNewsgroupsOperation : public NNTPOperation { + public: + NNTPListNewsgroupsOperation(); + virtual ~NNTPListNewsgroupsOperation(); + + virtual void setListsSubscribed(bool listsSubscribed); + virtual bool listsSubscribed(); + + virtual Array * groups(); + + public: // subclass behavior + virtual void main(); + + private: + bool mListsSuscribed; + Array * /* NNTPGroupInfo */ mGroups; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPOperation.h b/MailCore.framework/Headers/MCNNTPOperation.h new file mode 100644 index 000000000..52205e9f9 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPOperation.h @@ -0,0 +1,53 @@ +// +// MCNNTPOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPOPERATION_H + +#define MAILCORE_MCNNTPOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NNTPAsyncSession; + class NNTPOperationCallback; + + class MAILCORE_EXPORT NNTPOperation : public Operation, public NNTPProgressCallback { + public: + NNTPOperation(); + virtual ~NNTPOperation(); + + virtual void setSession(NNTPAsyncSession * session); + virtual NNTPAsyncSession * session(); + + virtual void setNNTPCallback(NNTPOperationCallback * callback); + virtual NNTPOperationCallback * nntpCallback(); + + virtual void setError(ErrorCode error); + virtual ErrorCode error(); + + virtual void start(); + + private: + NNTPAsyncSession * mSession; + NNTPOperationCallback * mPopCallback; + ErrorCode mError; + private: + virtual void bodyProgress(NNTPSession * session, unsigned int current, unsigned int maximum); + virtual void bodyProgressOnMainThread(void * context); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPOperationCallback.h b/MailCore.framework/Headers/MCNNTPOperationCallback.h new file mode 100644 index 000000000..e12a1b757 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPOperationCallback.h @@ -0,0 +1,30 @@ +// +// MCNNTPOperationCallback.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNNTPOPERATIONCALLBACK_H + +#define MAILCORE_MCNNTPOPERATIONCALLBACK_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NNTPOperation; + + class MAILCORE_EXPORT NNTPOperationCallback { + public: + virtual void bodyProgress(NNTPOperation * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPProgressCallback.h b/MailCore.framework/Headers/MCNNTPProgressCallback.h new file mode 100644 index 000000000..dd615d04f --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPProgressCallback.h @@ -0,0 +1,22 @@ +#ifndef MAILCORE_MCNNTPPROGRESSCALLBACK_H + +#define MAILCORE_MCNNTPPROGRESSCALLBACK_H + +#ifdef __cplusplus + +#include + +namespace mailcore { + + class NNTPSession; + + class MAILCORE_EXPORT NNTPProgressCallback { + public: + virtual void bodyProgress(NNTPSession * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNNTPSession.h b/MailCore.framework/Headers/MCNNTPSession.h new file mode 100644 index 000000000..dc2316ff7 --- /dev/null +++ b/MailCore.framework/Headers/MCNNTPSession.h @@ -0,0 +1,92 @@ +#ifndef MAILCORE_MCNNTPSESSION_H +#define MAILCORE_MCNNTPSESSION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class NNTPProgressCallback; + class MessageHeader; + + class MAILCORE_EXPORT NNTPSession : public Object { + public: + NNTPSession(); + virtual ~NNTPSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void connect(ErrorCode * pError); + virtual void disconnect(); + + virtual void login(ErrorCode * pError); + + virtual void checkAccount(ErrorCode * pError); + + virtual Array * /* NNTPGroupInfo */ listAllNewsgroups(ErrorCode * pError); + virtual Array * /* NNTPGroupInfo */ listDefaultNewsgroups(ErrorCode * pError); + + virtual MessageHeader * fetchHeader(String * groupName, unsigned int index, ErrorCode * pError); + virtual Array /*MessageHeader*/ * fetchOverArticlesInRange(Range range, String * groupname, ErrorCode * pError); + + virtual IndexSet * fetchAllArticles(String * groupname, ErrorCode * pError); + + virtual Data * fetchArticle(String *groupName, unsigned int index, NNTPProgressCallback * callback, ErrorCode * pError); + virtual Data * fetchArticleByMessageID(String * groupname, String * messageID, ErrorCode * pError); + + virtual time_t fetchServerDate(ErrorCode * pError); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + ConnectionType mConnectionType; + bool mCheckCertificateEnabled; + time_t mTimeout; + + newsnntp * mNNTP; + int mState; + + ConnectionLogger * mConnectionLogger; + + void init(); + bool checkCertificate(); + void setup(); + void unsetup(); + void connectIfNeeded(ErrorCode * pError); + void loginIfNeeded(ErrorCode * pError); + void readerIfNeeded(ErrorCode * pError); + void listIfNeeded(ErrorCode * pError); + void selectGroup(String * folder, ErrorCode * pError); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCNetService.h b/MailCore.framework/Headers/MCNetService.h new file mode 100644 index 000000000..bc1edf814 --- /dev/null +++ b/MailCore.framework/Headers/MCNetService.h @@ -0,0 +1,59 @@ +// +// MCNetService.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNETSERVICE_H + +#define MAILCORE_MCNETSERVICE_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT NetService : public Object { + + public: + NetService(); + virtual ~NetService(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual String * normalizedHostnameWithEmail(String * email); + + public: // serialization + static NetService * serviceWithInfo(HashMap * info); + virtual HashMap * info(); + + public: //subclass behavior + NetService(NetService * other); + virtual String * description(); + virtual Object * copy(); + + private: + String * mHostname; + unsigned int mPort; + ConnectionType mConnectionType; + + void init(); + void fillWithInfo(HashMap * info); + }; + +} + +#endif + +#endif \ No newline at end of file diff --git a/MailCore.framework/Headers/MCNull.h b/MailCore.framework/Headers/MCNull.h new file mode 100644 index 000000000..dc271e047 --- /dev/null +++ b/MailCore.framework/Headers/MCNull.h @@ -0,0 +1,28 @@ +// +// MCNull.h +// hermes +// +// Created by DINH Viêt Hoà on 4/9/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCNULL_H + +#define MAILCORE_MCNULL_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT Null : public Object { + public: + static Null * null(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCOAbstract.h b/MailCore.framework/Headers/MCOAbstract.h new file mode 100644 index 000000000..e174b818f --- /dev/null +++ b/MailCore.framework/Headers/MCOAbstract.h @@ -0,0 +1,23 @@ +// +// MCOAbstract.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOABSTRACT_H + +#define MAILCORE_MCOABSTRACT_H + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCOAbstractMessage.h b/MailCore.framework/Headers/MCOAbstractMessage.h new file mode 100644 index 000000000..d917d82f5 --- /dev/null +++ b/MailCore.framework/Headers/MCOAbstractMessage.h @@ -0,0 +1,49 @@ +// +// MCOAbstractMessage.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOABSTRACTMESSAGE_H + +#define MAILCORE_MCOABSTRACTMESSAGE_H + +#import + +@class MCOMessageHeader; +@class MCOAbstractPart; + +@interface MCOAbstractMessage : NSObject + +/** Header of the message. */ +@property (nonatomic, strong) MCOMessageHeader * header; + +/** Returns the part with the given Content-ID.*/ +- (MCOAbstractPart *) partForContentID:(NSString *)contentID; + +/** Returns the part with the given unique identifier.*/ +- (MCOAbstractPart *) partForUniqueID:(NSString *)uniqueID; + +/** All attachments in the message. + It will return an array of MCOIMAPPart for MCOIMAPMessage. + It will return an array of MCOAttachment for MCOMessageParser. + It will return an array of MCOAttachment for MCOMessageBuilder. */ +- (NSArray * /* MCOAbstractPart */) attachments; + +/** All image attachments included inline in the message through cid: URLs. + It will return an array of MCOIMAPPart for MCOIMAPMessage. + It will return an array of MCOAttachment for MCOMessageParser. + It will return an array of MCOAttachment for MCOMessageBuilder. */ +- (NSArray * /* MCOAbstractPart */) htmlInlineAttachments; + +/** + Returns parts required to render the message as plain text or html. + This does not include inline images and attachments, but only the text content + */ +- (NSArray *) requiredPartsForRendering; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOAbstractMessagePart.h b/MailCore.framework/Headers/MCOAbstractMessagePart.h new file mode 100644 index 000000000..b5117481d --- /dev/null +++ b/MailCore.framework/Headers/MCOAbstractMessagePart.h @@ -0,0 +1,30 @@ +// +// MCOAbstractMessagePart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOABSTRACTMESSAGEPART_H + +#define MAILCORE_MCOABSTRACTMESSAGEPART_H + +#import +#import + +@class MCOMessageHeader; + +@interface MCOAbstractMessagePart : MCOAbstractPart + +// Returns the header of the embedded message. +@property (nonatomic, strong) MCOMessageHeader * header; + +// Returns the main part of the embedded message. It can be MCOAbstractPart, MCOAbstractMultipart +// or a MCOAbstractMessagePart. +@property (nonatomic, strong) MCOAbstractPart * mainPart; + +@end + +#endif + diff --git a/MailCore.framework/Headers/MCOAbstractMultipart.h b/MailCore.framework/Headers/MCOAbstractMultipart.h new file mode 100644 index 000000000..4502319b5 --- /dev/null +++ b/MailCore.framework/Headers/MCOAbstractMultipart.h @@ -0,0 +1,23 @@ +// +// MCOAbstractMultipart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOABSTRACTMULTIPART_H + +#define MAILCORE_MCOABSTRACTMULTIPART_H + +#import +#import + +@interface MCOAbstractMultipart : MCOAbstractPart + +/** Returns the subparts of that multipart.*/ +@property (nonatomic, copy) NSArray * /* MCOAbstractPart */ parts; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOAbstractPart.h b/MailCore.framework/Headers/MCOAbstractPart.h new file mode 100644 index 000000000..72383f9a3 --- /dev/null +++ b/MailCore.framework/Headers/MCOAbstractPart.h @@ -0,0 +1,102 @@ +// +// MCOAbstractPart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOABSTRACTPART_H + +#define MAILCORE_MCOABSTRACTPART_H + +#import + +@class MCOAbstractMessage; + +typedef NS_ENUM(NSInteger, MCOPartType) { + // Used for a single part. + // The part will be a MCOAbstractPart. + MCOPartTypeSingle, + + // Used for a message part (MIME type: message/rfc822). + // The part will be a MCOAbstractMessagePart. + // It's when a message is sent as attachment of an other message. + MCOPartTypeMessage, + + // Used for a multipart, multipart/mixed. + // The part will be a MCOAbstractMultipart. + MCOPartTypeMultipartMixed, + + // Used for a multipart, multipart/related. + // The part will be a MCOAbstractMultipart. + MCOPartTypeMultipartRelated, + + // Used for a multipart, multipart/alternative. + // The part will be a MCOAbstractMultipart. + MCOPartTypeMultipartAlternative, + + // Used for a signed message, multipart/signed. + // The part will be a MCOAbstractMultipart. + MCOPartTypeMultipartSigned, +}; + +@interface MCOAbstractPart : NSObject + +/** Returns type of the part (single / message part / multipart/mixed, + multipart/related, multipart/alternative). See MCOPartType.*/ +@property (nonatomic, assign) MCOPartType partType; + +/** Returns filename of the part.*/ +@property (nonatomic, copy) NSString * filename; + +/** Returns MIME type of the part. For example application/data.*/ +@property (nonatomic, copy) NSString * mimeType; + +/** Returns charset of the part in case it's a text single part.*/ +@property (nonatomic, copy) NSString * charset; + +/** Returns the unique ID generated for this part. + It's a unique identifier that's created when the object is created manually + or created by the parser.*/ +@property (nonatomic, copy) NSString * uniqueID; + +/** Returns the value of the Content-ID field of the part.*/ +@property (nonatomic, copy) NSString * contentID; + +/** Returns the value of the Content-Location field of the part.*/ +@property (nonatomic, copy) NSString * contentLocation; + +/** Returns the value of the Content-Description field of the part.*/ +@property (nonatomic, copy) NSString * contentDescription; + +/** Returns whether the part is an explicit inline attachment.*/ +@property (nonatomic, assign, getter=isInlineAttachment) BOOL inlineAttachment; + +/** Returns whether the part is an explicit attachment.*/ +@property (nonatomic, assign, getter=isAttachment) BOOL attachment; + +/** Returns the part with the given Content-ID among this part and its subparts.*/ +- (MCOAbstractPart *) partForContentID:(NSString *)contentID; + +/** Returns the part with the given unique identifier among this part and its subparts.*/ +- (MCOAbstractPart *) partForUniqueID:(NSString *)uniqueID; + +/** Returns a string representation of the data according to charset.*/ +- (NSString *) decodedStringForData:(NSData *)data; + +/** Adds a content type parameter.*/ +- (void) setContentTypeParameterValue:(NSString *)value forName:(NSString *)name; + +/** Remove a given content type parameter.*/ +- (void) removeContentTypeParameterForName:(NSString *)name; + +/** Returns the value of a given content type parameter.*/ +- (NSString *) contentTypeParameterValueForName:(NSString *)name; + +/** Returns an array with the names of all content type parameters.*/ +- (NSArray * /* NSString */) allContentTypeParametersNames; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOAccountValidator.h b/MailCore.framework/Headers/MCOAccountValidator.h new file mode 100644 index 000000000..b5f09bc24 --- /dev/null +++ b/MailCore.framework/Headers/MCOAccountValidator.h @@ -0,0 +1,54 @@ +// +// MCOAccountValidator.h +// mailcore2 +// +// Created by Christopher Hockley on 20/01/15. +// Copyright (c) 2015 MailCore. All rights reserved. +// + +#import +#import + +/** + This class is used to validate an email provider and it's associated + metadata and credentials. + + An app might want to use this during setup to limit the number of settings + a user has to input. + */ + +@class MCONetService; + +@interface MCOAccountValidator : MCOOperation + +@property (nonatomic, copy) NSString * email; /* for SMTP */ +@property (nonatomic, copy) NSString * username; +@property (nonatomic, copy) NSString * password; +@property (nonatomic, copy) NSString * OAuth2Token; + +@property (nonatomic, retain) NSArray * /* MCONetService */ imapServers; +@property (nonatomic, retain) NSArray * /* MCONetService */ popServers; +@property (nonatomic, retain) NSArray * /* MCONetService */ smtpServers; + +@property (nonatomic, assign, getter=isImapEnabled) BOOL imapEnabled; +@property (nonatomic, assign, getter=isPopEnabled) BOOL popEnabled; +@property (nonatomic, assign, getter=isSmtpEnabled) BOOL smtpEnabled; + +// result +@property (nonatomic, retain, readonly) NSString * identifier; +@property (nonatomic, retain, readonly) MCONetService * imapServer; +@property (nonatomic, retain, readonly) MCONetService * popServer; +@property (nonatomic, retain, readonly) MCONetService * smtpServer; +@property (nonatomic, retain, readonly) NSError * imapError; +@property (nonatomic, retain, readonly) NSError * popError; +@property (nonatomic, retain, readonly) NSError * smtpError; + +/** + Starts the asynchronous account validation operation. + + @param completionBlock Called when the operation is finished. + */ +- (void) start:(void (^)(void))completionBlock; + + +@end diff --git a/MailCore.framework/Headers/MCOAddress.h b/MailCore.framework/Headers/MCOAddress.h new file mode 100644 index 000000000..6c3284e82 --- /dev/null +++ b/MailCore.framework/Headers/MCOAddress.h @@ -0,0 +1,81 @@ +// +// MCOAddress.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOADDRESS_H + +#define MAILCORE_MCOADDRESS_H + +#import + +@interface MCOAddress : NSObject + +/** Creates an address with a display name and a mailbox. + + Example: [MCOAddress addressWithDisplayName:@"DINH Viêt Hoà" mailbox:@"hoa@etpan.org"] */ ++ (MCOAddress *) addressWithDisplayName:(NSString *)displayName + mailbox:(NSString *)mailbox; + +/** Creates an address with only a mailbox. + + Example: [MCOAddress addressWithMailbox:@"hoa@etpan.org"]*/ ++ (MCOAddress *) addressWithMailbox:(NSString *)mailbox; + +/** Creates an address with a RFC822 string. + + Example: [MCOAddress addressWithRFC822String:@"DINH Vi=C3=AAt Ho=C3=A0 "]*/ ++ (MCOAddress *) addressWithRFC822String:(NSString *)RFC822String; + +/** Creates an address with a non-MIME-encoded RFC822 string. + + Example: [MCOAddress addressWithNonEncodedRFC822String:@"DINH Viêt Hoà "]*/ ++ (MCOAddress *) addressWithNonEncodedRFC822String:(NSString *)nonEncodedRFC822String; + +/** + Returns an NSArray of MCOAddress objects that contain the parsed + forms of the RFC822 encoded addresses. + + For example: @[ @"DINH Vi=C3=AAt Ho=C3=A0 " ]*/ ++ (NSArray *) addressesWithRFC822String:(NSString *)string; + +/** + Returns an NSArray of MCOAddress objects that contain the parsed + forms of non-encoded RFC822 addresses. + + For example: @[ "DINH Viêt Hoà " ]*/ ++ (NSArray *) addressesWithNonEncodedRFC822String:(NSString *)string; + + +/** Returns the display name of the address.*/ +@property (nonatomic, copy) NSString * displayName; + +/** Returns the mailbox of the address.*/ +@property (nonatomic, copy) NSString * mailbox; + +/** Returns the RFC822 encoding of the address. + + For example: "DINH Vi=C3=AAt Ho=C3=A0 "*/ +- (NSString *) RFC822String; + +/** Returns the non-MIME-encoded RFC822 encoding of the address. + + For example: "DINH Viêt Hoà "*/ +- (NSString *) nonEncodedRFC822String; + +@end + +@interface NSArray (MCOAddress) + +/** Returns the RFC822 encoding of the addresses.*/ +- (NSString *) mco_RFC822StringForAddresses; + +/** Returns the non-MIME-encoded RFC822 of the addresses.*/ +- (NSString *) mco_nonEncodedRFC822StringForAddresses; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOAttachment.h b/MailCore.framework/Headers/MCOAttachment.h new file mode 100644 index 000000000..eec1bd198 --- /dev/null +++ b/MailCore.framework/Headers/MCOAttachment.h @@ -0,0 +1,47 @@ +// +// MCOAttachment.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOATTACHMENT_H + +#define MAILCORE_MCOATTACHMENT_H + +#import + +/** This is a single part. + + It can either parsed from RFC 822 message data or created to build a message.*/ + +@interface MCOAttachment : MCOAbstractPart + +/** Returns a MIME type for a filename.*/ ++ (NSString *) mimeTypeForFilename:(NSString *)filename; + +/** Returns a file attachment with the content of the given file.*/ ++ (MCOAttachment *) attachmentWithContentsOfFile:(NSString *)filename; + +/** Returns a file attachment with the given data and filename.*/ ++ (MCOAttachment *) attachmentWithData:(NSData *)data filename:(NSString *)filename; + +/** Returns a part with an HTML content.*/ ++ (MCOAttachment *) attachmentWithHTMLString:(NSString *)htmlString; + +/** Returns a part with a RFC 822 messsage attachment.*/ ++ (MCOAttachment *) attachmentWithRFC822Message:(NSData *)messageData; + +/** Returns a part with an plain text content.*/ ++ (MCOAttachment *) attachmentWithText:(NSString *)text; + +/** Decoded data of the part.*/ +@property (nonatomic, strong) NSData * data; + +/** Returns string representation according to charset*/ +- (NSString *) decodedString; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOConstants.h b/MailCore.framework/Headers/MCOConstants.h new file mode 100644 index 000000000..e4cbebefb --- /dev/null +++ b/MailCore.framework/Headers/MCOConstants.h @@ -0,0 +1,447 @@ +#ifndef MAILCORE_MCOCONSTANTS_H + +#define MAILCORE_MCOCONSTANTS_H + +/** It's the connection type.*/ +typedef NS_OPTIONS(NSInteger, MCOConnectionType) { + /** Clear-text connection for the protocol.*/ + MCOConnectionTypeClear = 1 << 0, + /** Clear-text connection at the beginning, then switch to encrypted connection using TLS/SSL*/ + /** on the same TCP connection.*/ + MCOConnectionTypeStartTLS = 1 << 1, + /** Encrypted connection using TLS/SSL.*/ + MCOConnectionTypeTLS = 1 << 2, +}; + +/** It's the authentication type.*/ +typedef NS_OPTIONS(NSInteger, MCOAuthType) { + /** Default authentication scheme of the protocol.*/ + MCOAuthTypeSASLNone = 0, + /** CRAM-MD5 authentication RFC 2195.*/ + MCOAuthTypeSASLCRAMMD5 = 1 << 0, + /** PLAIN authentication RFC 4616.*/ + MCOAuthTypeSASLPlain = 1 << 1, + /** GSSAPI authentication.*/ + MCOAuthTypeSASLGSSAPI = 1 << 2, + /** DIGEST-MD5 authentication RFC 2831.*/ + MCOAuthTypeSASLDIGESTMD5 = 1 << 3, + /** LOGIN authentication http://tools.ietf.org/id/draft-murchison-sasl-login-00.txt*/ + MCOAuthTypeSASLLogin = 1 << 4, + /** Secure Remote Password Authentication http://tools.ietf.org/html/draft-burdis-cat-srp-sasl-08*/ + MCOAuthTypeSASLSRP = 1 << 5, + /** NTLM authentication.*/ + MCOAuthTypeSASLNTLM = 1 << 6, + /** Kerberos 4 authentication.*/ + MCOAuthTypeSASLKerberosV4 = 1 << 7, + /** OAuth2 authentication.*/ + MCOAuthTypeXOAuth2 = 1 << 8, + /** OAuth2 authentication on outlook.com.*/ + MCOAuthTypeXOAuth2Outlook = 1 << 9, +}; + +/** It's the IMAP flags of the folder.*/ +typedef NS_OPTIONS(NSInteger, MCOIMAPFolderFlag) { + MCOIMAPFolderFlagNone = 0, + /** \Marked*/ + MCOIMAPFolderFlagMarked = 1 << 0, + /** \Unmarked*/ + MCOIMAPFolderFlagUnmarked = 1 << 1, + /** \NoSelect: When a folder can't be selected.*/ + MCOIMAPFolderFlagNoSelect = 1 << 2, + /** \NoInferiors: When the folder has no children.*/ + MCOIMAPFolderFlagNoInferiors = 1 << 3, + /** \Inbox: When the folder is the inbox.*/ + MCOIMAPFolderFlagInbox = 1 << 4, + /** \Sent: When the folder is the sent folder.*/ + MCOIMAPFolderFlagSentMail = 1 << 5, + /** \Starred: When the folder is the starred folder*/ + MCOIMAPFolderFlagStarred = 1 << 6, + /** \AllMail: When the folder is all mail.*/ + MCOIMAPFolderFlagAllMail = 1 << 7, + /** \Trash: When the folder is the trash.*/ + MCOIMAPFolderFlagTrash = 1 << 8, + /** \Drafts: When the folder is the drafts folder.*/ + MCOIMAPFolderFlagDrafts = 1 << 9, + /** \Spam: When the folder is the spam folder.*/ + MCOIMAPFolderFlagSpam = 1 << 10, + /** \Important: When the folder is the important folder.*/ + MCOIMAPFolderFlagImportant = 1 << 11, + /** \Archive: When the folder is archive.*/ + MCOIMAPFolderFlagArchive = 1 << 12, + /** \All: When the folder contains all mails, similar to \AllMail.*/ + MCOIMAPFolderFlagAll = MCOIMAPFolderFlagAllMail, + /** \Junk: When the folder is the spam folder.*/ + MCOIMAPFolderFlagJunk = MCOIMAPFolderFlagSpam, + /** \Flagged: When the folder contains all the flagged emails.*/ + MCOIMAPFolderFlagFlagged = MCOIMAPFolderFlagStarred, + /** Mask to identify the folder */ + MCOIMAPFolderFlagFolderTypeMask = MCOIMAPFolderFlagInbox | MCOIMAPFolderFlagSentMail | MCOIMAPFolderFlagStarred | MCOIMAPFolderFlagAllMail | + MCOIMAPFolderFlagTrash| MCOIMAPFolderFlagDrafts | MCOIMAPFolderFlagSpam | MCOIMAPFolderFlagImportant | MCOIMAPFolderFlagArchive, +}; + +/** It's the flags of a message.*/ +typedef NS_OPTIONS(NSInteger, MCOMessageFlag) { + MCOMessageFlagNone = 0, + /** Seen/Read flag.*/ + MCOMessageFlagSeen = 1 << 0, + /** Replied/Answered flag.*/ + MCOMessageFlagAnswered = 1 << 1, + /** Flagged/Starred flag.*/ + MCOMessageFlagFlagged = 1 << 2, + /** Deleted flag.*/ + MCOMessageFlagDeleted = 1 << 3, + /** Draft flag.*/ + MCOMessageFlagDraft = 1 << 4, + /** $MDNSent flag.*/ + MCOMessageFlagMDNSent = 1 << 5, + /** $Forwarded flag.*/ + MCOMessageFlagForwarded = 1 << 6, + /** $SubmitPending flag.*/ + MCOMessageFlagSubmitPending = 1 << 7, + /** $Submitted flag.*/ + MCOMessageFlagSubmitted = 1 << 8, +}; + +/** It's the encoding of a part.*/ +typedef NS_ENUM(NSInteger, MCOEncoding) { + /** 7bit encoding.*/ + MCOEncoding7Bit = 0, /** should match MAILIMAP_BODY_FLD_ENC_7BIT*/ + /** 8bit encoding.*/ + MCOEncoding8Bit = 1, /** should match MAILIMAP_BODY_FLD_ENC_8BIT*/ + /** binary encoding.*/ + MCOEncodingBinary = 2, /** should match MAILIMAP_BODY_FLD_ENC_BINARY*/ + /** base64 encoding.*/ + MCOEncodingBase64 = 3, /** should match MAILIMAP_BODY_FLD_ENC_BASE64*/ + /** quoted-printable encoding.*/ + MCOEncodingQuotedPrintable = 4, /** should match MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE*/ + /** other encoding.*/ + MCOEncodingOther = 5, /** should match MAILIMAP_BODY_FLD_ENC_OTHER*/ + + /** Negative values should be used for encoding not supported by libetpan.*/ + + /** UUEncode encoding.*/ + MCOEncodingUUEncode = -1 +}; + +/** It's the information to fetch for a given message in the IMAP FETCH request.*/ +typedef NS_OPTIONS(NSInteger, MCOIMAPMessagesRequestKind) { + /** UID of the message.*/ + MCOIMAPMessagesRequestKindUid = 0, /** This is the default and it's always fetched*/ + /** Flags of the message.*/ + MCOIMAPMessagesRequestKindFlags = 1 << 0, + /** Headers of the message (parsed by the server).*/ + MCOIMAPMessagesRequestKindHeaders = 1 << 1, + /** MIME structure of the message.*/ + MCOIMAPMessagesRequestKindStructure = 1 << 2, + /** Received date.*/ + MCOIMAPMessagesRequestKindInternalDate = 1 << 3, + /** Headers through headers data.*/ + MCOIMAPMessagesRequestKindFullHeaders = 1 << 4, + /** Subject of the message.*/ + MCOIMAPMessagesRequestKindHeaderSubject = 1 << 5, + /** Gmail Labels.*/ + MCOIMAPMessagesRequestKindGmailLabels = 1 << 6, + /** Gmail Message ID.*/ + MCOIMAPMessagesRequestKindGmailMessageID = 1 << 7, + /** Gmail Thread ID.*/ + MCOIMAPMessagesRequestKindGmailThreadID = 1 << 8, + /** Extra Headers.*/ + MCOIMAPMessagesRequestKindExtraHeaders = 1 << 9, + /* Request size of message */ + MCOIMAPMessagesRequestKindSize = 1 << 10, + +}; + +/** It defines the behavior of the STORE flags request.*/ +typedef NS_ENUM(NSInteger, MCOIMAPStoreFlagsRequestKind) { + /** Add the given flags.*/ + MCOIMAPStoreFlagsRequestKindAdd, + /** Remove the given flags.*/ + MCOIMAPStoreFlagsRequestKindRemove, + /** Set the given flags.*/ + MCOIMAPStoreFlagsRequestKindSet, +}; + +/** It's the search type.*/ +typedef NS_ENUM(NSInteger, MCOIMAPSearchKind) { + /** Search All */ + MCOIMAPSearchKindAll, + /** No search.*/ + MCOIMAPSearchKindNone, + /** Match sender.*/ + MCOIMAPSearchKindFrom, + /** Match to */ + MCOIMAPSearchKindTo, + /** Match CC: */ + MCOIMAPSearchKindCc, + /** Match BCC: */ + MCOIMAPSearchKindBcc, + /** Match recipient.*/ + MCOIMAPSearchKindRecipient, + /** Match subject.*/ + MCOIMAPSearchKindSubject, + /** Match content of the message, including the headers.*/ + MCOIMAPSearchKindContent, + /** Match content of the message, excluding the headers.*/ + MCOIMAPSearchKindBody, + /** Match uids */ + MCOIMAPSearchKindUids, + /** Match headers of the message.*/ + MCOIMAPSearchKindHeader, + /** Match messages that are read.*/ + MCOIMAPSearchKindRead, + /** Match messages that are not read.*/ + MCOIMAPSearchKindUnread, + /** Match messages that are flagged.*/ + MCOIMAPSearchKindFlagged, + /** Match messages that are not flagged.*/ + MCOIMAPSearchKindUnflagged, + /** Match messages that are answered.*/ + MCOIMAPSearchKindAnswered, + /** Match messages that are not answered.*/ + MCOIMAPSearchKindUnanswered, + /** Match messages that are a drafts.*/ + MCOIMAPSearchKindDraft, + /** Match messages that are not drafts.*/ + MCOIMAPSearchKindUndraft, + /** Match messages that are deleted.*/ + MCOIMAPSearchKindDeleted, + /** Match messages that are spam.*/ + MCOIMAPSearchKindSpam, + /** Match messages before the given date.*/ + MCOIMAPSearchKindBeforeDate, + /** Match messages on the given date.*/ + MCOIMAPSearchKindOnDate, + /** Match messages after the given date.*/ + MCOIMAPSearchKindSinceDate, + /** Match messages before the given received date.*/ + MCOIMAPSearchKindBeforeReceivedDate, + /** Match messages on the given received date.*/ + MCOIMAPSearchKindOnReceivedDate, + /** Match messages after the given received date.*/ + MCOIMAPSearchKindSinceReceivedDate, + /** Match messages that are larger than the given size in bytes.*/ + MCOIMAPSearchKindSizeLarger, + /** Match messages that are smaller than the given size in bytes.*/ + MCOIMAPSearchKindSizeSmaller, + /** Match X-GM-THRID.*/ + MCOIMAPSearchGmailThreadID, + /** Match X-GM-MSGID.*/ + MCOIMAPSearchGmailMessageID, + /** Match X-GM-RAW.*/ + MCOIMAPSearchGmailRaw, + /** Or expresssion.*/ + MCOIMAPSearchKindOr, + /** And expression.*/ + MCOIMAPSearchKindAnd, + /** Not expression.*/ + MCOIMAPSearchKindNot, +}; + +/** Keys for the namespace dictionary.*/ +#define MCOIMAPNamespacePersonal @"IMAPNamespacePersonal" +#define MCOIMAPNamespaceOther @"IMAPNamespaceOther" +#define MCOIMAPNamespaceShared @"IMAPNamespaceShared" + +/** This is the constants for the IMAP capabilities.*/ +/** See corresponding RFC for more information.*/ +typedef NS_ENUM(NSInteger, MCOIMAPCapability) { + /** ACL Capability.*/ + MCOIMAPCapabilityACL, + /** BINARY Capability.*/ + MCOIMAPCapabilityBinary, + /** CATENATE Capability.*/ + MCOIMAPCapabilityCatenate, + /** CHILDREN Capability.*/ + MCOIMAPCapabilityChildren, + /** COMPRESS Capability.*/ + MCOIMAPCapabilityCompressDeflate, + /** CONDSTORE Capability.*/ + MCOIMAPCapabilityCondstore, + /** ENABLE Capability.*/ + MCOIMAPCapabilityEnable, + /** IDLE Capability.*/ + MCOIMAPCapabilityIdle, + /** ID Capability.*/ + MCOIMAPCapabilityId, + /** LITERAL+ Capability.*/ + MCOIMAPCapabilityLiteralPlus, + /** MULTIAPPEND Capability.*/ + MCOIMAPCapabilityMultiAppend, + /** NAMESPACE Capability.*/ + MCOIMAPCapabilityNamespace, + /** QRESYNC Capability.*/ + MCOIMAPCapabilityQResync, + /** QUOTE Capability.*/ + MCOIMAPCapabilityQuota, + /** SORT Capability.*/ + MCOIMAPCapabilitySort, + /** STARTTLS Capability.*/ + MCOIMAPCapabilityStartTLS, + /** THREAD=ORDEREDSUBJECT Capability.*/ + MCOIMAPCapabilityThreadOrderedSubject, + /** THREAD=REFERENCES Capability.*/ + MCOIMAPCapabilityThreadReferences, + /** UIDPLUS Capability.*/ + MCOIMAPCapabilityUIDPlus, + /** UNSELECT Capability.*/ + MCOIMAPCapabilityUnselect, + /** XLIST Capability.*/ + MCOIMAPCapabilityXList, + /** AUTH=ANONYMOUS Capability.*/ + MCOIMAPCapabilityAuthAnonymous, + /** AUTH=CRAM-MD5 Capability.*/ + MCOIMAPCapabilityAuthCRAMMD5, + /** AUTH=DIGEST-MD5 Capability.*/ + MCOIMAPCapabilityAuthDigestMD5, + /** AUTH=EXTERNAL Capability.*/ + MCOIMAPCapabilityAuthExternal, + /** AUTH=GSSAPI Capability.*/ + MCOIMAPCapabilityAuthGSSAPI, + /** AUTH=KERBEROSV4 Capability.*/ + MCOIMAPCapabilityAuthKerberosV4, + /** AUTH=LOGIN Capability.*/ + MCOIMAPCapabilityAuthLogin, + /** AUTH=NTML Capability.*/ + MCOIMAPCapabilityAuthNTLM, + /** AUTH=OTP Capability.*/ + MCOIMAPCapabilityAuthOTP, + /** AUTH=PLAIN Capability.*/ + MCOIMAPCapabilityAuthPlain, + /** AUTH=SKEY Capability.*/ + MCOIMAPCapabilityAuthSKey, + /** AUTH=SRP Capability.*/ + MCOIMAPCapabilityAuthSRP, + /** AUTH=XOAUTH2 Capability.*/ + MCOIMAPCapabilityXOAuth2, + /** X-GM-EXT-1 Capability.*/ + MCOIMAPCapabilityGmail +}; + +/** Error domain for mailcore.*/ +#define MCOErrorDomain @"MCOErrorDomain" + +/** Here's the list of errors.*/ +typedef NS_ENUM(NSInteger, MCOErrorCode) { + /** No error occurred.*/ + MCOErrorNone, // 0 + /** An error related to the connection occurred.*/ + /** It could not connect or it's been disconnected.*/ + MCOErrorConnection, + /** TLS/SSL connection was not available.*/ + MCOErrorTLSNotAvailable, + /** The protocol could not be parsed.*/ + MCOErrorParse, + /** Certificate was not valid.*/ + MCOErrorCertificate, + /** An authentication error occurred.*/ + MCOErrorAuthentication, + /** Specific to Gmail: IMAP not enabled.*/ + MCOErrorGmailIMAPNotEnabled, + /** Specific to Gmail: Exceeded bandwidth limit.*/ + MCOErrorGmailExceededBandwidthLimit, + /** Specific to Gmail: Too many simultaneous connections.*/ + MCOErrorGmailTooManySimultaneousConnections, + /** Specific to Mobile Me: Moved to iCloud.*/ + MCOErrorMobileMeMoved, + /** Specific to Yahoo: not available.*/ + MCOErrorYahooUnavailable, // 10 + /** Non existant folder, select failed.*/ + MCOErrorNonExistantFolder, + /** IMAP: Error occurred while renaming a folder.*/ + MCOErrorRename, + /** IMAP: Error occurred while deleting a folder.*/ + MCOErrorDelete, + /** IMAP: Error occurred while creating a folder.*/ + MCOErrorCreate, + /** IMAP: Error occurred while subscribing/unsubcribing to a folder.*/ + MCOErrorSubscribe, + /** IMAP: Error occurred while adding a message to a folder.*/ + MCOErrorAppend, + /** IMAP: Error occurred while copying a message.*/ + MCOErrorCopy, + /** IMAP: Error occurred while expunging.*/ + MCOErrorExpunge, + /** IMAP: Error occurred while fetching messages.*/ + MCOErrorFetch, + /** IMAP: Error occurred while IDLing.*/ + MCOErrorIdle, // 20 + /** IMAP: Error occurred while sending/getting identity.*/ + MCOErrorIdentity, + /** IMAP: Error occurred while getting namespace.*/ + MCOErrorNamespace, + /** IMAP: Error occurred while storing flags.*/ + MCOErrorStore, + /** IMAP: Error wile getting capabilities.*/ + MCOErrorCapability, + /** STARTTLS is not available.*/ + MCOErrorStartTLSNotAvailable, + /** SMTP: Illegal attachment: certain kind of attachment cannot be sent.*/ + MCOErrorSendMessageIllegalAttachment, + /** SMTP: Storage limit: message is probably too big.*/ + MCOErrorStorageLimit, + /** SMTP: Sending message is not allowed.*/ + MCOErrorSendMessageNotAllowed, + /** SMTP: Specific to hotmail. Needs to connect to webmail.*/ + MCOErrorNeedsConnectToWebmail, + /** SMTP: Error while sending message.*/ + MCOErrorSendMessage, // 30 + /** SMTP: Authentication required.*/ + MCOErrorAuthenticationRequired, + /** POP: Error occurred while fetching message list.*/ + MCOErrorFetchMessageList, + /** POP: Error occurred while deleting message.*/ + MCOErrorDeleteMessage, + /** SMTP: Error while checking account.*/ + MCOErrorInvalidAccount, + /** Error when accessing/reading/writing file.*/ + MCOErrorFile, + /** IMAP: Error when trying to enable compression.*/ + MCOErrorCompression, + /** SMTP: Error when no sender has been specified.*/ + MCOErrorNoSender, + /** SMTP: Error when no recipient has been specified.*/ + MCOErrorNoRecipient, + /** IMAP: Error when a noop operation fails.*/ + MCOErrorNoop, + /** IMAP: Error when the password has been entered but second factor + authentication is enabled: an application specific password is required. */ + MCOErrorGmailApplicationSpecificPasswordRequired, // 40 + /** NNTP: error when requesting date */ + MCOErrorServerDate, + /** No valid server found */ + MCOErrorNoValidServerFound, + /** The count of all errors */ + MCOErrorCodeCount, +}; + +/** Here's the list of connection log types.*/ +typedef NS_ENUM(NSInteger, MCOConnectionLogType) { + /** Received data.*/ + MCOConnectionLogTypeReceived, + /** Sent data.*/ + MCOConnectionLogTypeSent, + /** Sent private data. It can be a password.*/ + MCOConnectionLogTypeSentPrivate, + /** Parse error.*/ + MCOConnectionLogTypeErrorParse, + /** Error while receiving data. The data passed to the log will be nil.*/ + MCOConnectionLogTypeErrorReceived, + /** Error while sending dataThe data passed to the log will be nil.*/ + MCOConnectionLogTypeErrorSent, +}; + +/** + It's a network traffic logger. + @param connectionID is the identifier of the underlaying network socket. + @param type is the type of the log. + @param data is the data related to the log. + */ +typedef void (^MCOConnectionLogger)(void * connectionID, MCOConnectionLogType type, NSData * data); + +/** + It's called when asynchronous operations stop/start running. + */ +typedef void (^MCOOperationQueueRunningChangeBlock)(void); + +#endif diff --git a/MailCore.framework/Headers/MCOHTMLRendererDelegate.h b/MailCore.framework/Headers/MCOHTMLRendererDelegate.h new file mode 100644 index 000000000..eb62cb750 --- /dev/null +++ b/MailCore.framework/Headers/MCOHTMLRendererDelegate.h @@ -0,0 +1,106 @@ +// +// MCOHTMLRendererDelegate.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOHTMLRENDERERDELEGATE_H + +#define MAILCORE_MCOHTMLRENDERERDELEGATE_H + +#import + +/** This delegate protocol is used to help rendering of the message. + + It will be used for the following methods. + + [MCOMessageParser htmlRenderingWithDelegate:], + + [MCOMessageBuilder htmlRenderingWithDelegate:] + + -[MCOIMAPMessage htmlRenderingWithFolder:delegate:] +*/ + +@class MCOAbstractPart; +@class MCOAbstractMessage; +@class MCOMessageHeader; +@class MCOAbstractMessagePart; + +@protocol MCOHTMLRendererDelegate + +/** All methods are optional.*/ +@optional + +/** This delegate method should return YES if it can render a preview of the attachment as an image. + part is always a single part. + +If the attachment can be previewed, it will be rendered using the image template. +If not, the attachment template will be used.*/ +- (BOOL) MCOAbstractMessage:(MCOAbstractMessage *)msg canPreviewPart:(MCOAbstractPart *)part; + +/** This delegate method should return YES if the part should be rendered.*/ +- (BOOL) MCOAbstractMessage:(MCOAbstractMessage *)msg shouldShowPart:(MCOAbstractPart *)part; + +/** This delegate method returns the values to be applied to the template for the given header. + See the content of MCHTMLRendererCallback.cpp for the default values of the header.*/ +- (NSDictionary *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateValuesForHeader:(MCOMessageHeader *)header; + +/** This delegate method returns the values to be applied to the template for the given attachment. + See the content of MCHTMLRendererCallback.cpp for the default values of the attachment.*/ +- (NSDictionary *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateValuesForPart:(MCOAbstractPart *)part; + +/** @name Template Methods + The following methods returns templates. They will match the syntax of ctemplate. + See https://code.google.com/p/ctemplate/ */ + +/** This delegate method returns the template for the main header of the message. + See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForMainHeader:(MCOMessageHeader *)header; + +/** This delegate method returns the template an image attachment.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForImage:(MCOAbstractPart *)header; + +/** This delegate method returns the template attachment other than images. + See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForAttachment:(MCOAbstractPart *)part; + +/** This delegate method returns the template of the main message. + It should include HEADER and a BODY values. + See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/ +- (NSString *) MCOAbstractMessage_templateForMessage:(MCOAbstractMessage *)msg; + +/** This delegate method returns the template of an embedded message (included as attachment). + It should include HEADER and a BODY values. + See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForEmbeddedMessage:(MCOAbstractMessagePart *)part; + +/** This delegate method returns the template for the header of an embedded message. + See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForEmbeddedMessageHeader:(MCOMessageHeader *)header; + +/** This delegate method returns the separator between the text of the message and the attachments.*/ +- (NSString *) MCOAbstractMessage_templateForAttachmentSeparator:(MCOAbstractMessage *)msg; + +/** This delegate method cleans HTML content. + For example, it could fix broken tags, add missing , tags. + Default implementation uses HTMLCleaner::cleanHTML to clean HTML content. */ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg cleanHTMLForPart:(NSString *)html; + +/** @name Filters + + The following methods will filter the HTML content and may apply some filters to + change how to display the message.*/ + +/** This delegate method will apply the filter to HTML rendered content of a given text part. + For example, it could filter the CSS content.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg filterHTMLForPart:(NSString *)html; + +/** This delegate method will apply a filter to the whole HTML content. + For example, it could collapse the quoted messages.*/ +- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg filterHTMLForMessage:(NSString *)html; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOHTMLRendererIMAPDelegate.h b/MailCore.framework/Headers/MCOHTMLRendererIMAPDelegate.h new file mode 100644 index 000000000..a127ec27f --- /dev/null +++ b/MailCore.framework/Headers/MCOHTMLRendererIMAPDelegate.h @@ -0,0 +1,52 @@ +// +// MCOHTMLRendererIMAPDelegate.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOHTMLRENDERERIMAPDELEGATE_H + +#define MAILCORE_MCOHTMLRENDERERIMAPDELEGATE_H + +#import + +/** + This delegate protocol is used to fetch the content of the part of the message when the HTML render needs them. + It will help fetch the minimal amount of information from the message required to render the HTML. + + It will be used for the following method. + + [MCOIMAPMessage htmlRenderingWithFolder:delegate:] +*/ + +@class MCOIMAPPart; + +@protocol MCOHTMLRendererIMAPDelegate + +/** All methods are optional.*/ +@optional + +/** + The delegate method returns NULL if the delegate have not fetch the part yet. The opportunity can also be used to + start fetching the attachment. + It will return the data synchronously if it has already fetched it. +*/ +- (NSData *) MCOAbstractMessage:(MCOAbstractMessage *)msg dataForIMAPPart:(MCOIMAPPart *)part folder:(NSString *)folder; + +/** + The delegate method will notify the delegate to start fetching the given part. + It will be used to render an attachment that cannot be previewed. +*/ +- (void) MCOAbstractMessage:(MCOAbstractMessage *)msg prefetchAttachmentIMAPPart:(MCOIMAPPart *)part folder:(NSString *)folder; + +/** + The delegate method will notify the delegate to start fetching the given part. + It will be used to render an attachment that can be previewed. +*/ +- (void) MCOAbstractMessage:(MCOAbstractMessage *)msg prefetchImageIMAPPart:(MCOIMAPPart *)part folder:(NSString *)folder; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAP.h b/MailCore.framework/Headers/MCOIMAP.h new file mode 100755 index 000000000..1957afd8c --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAP.h @@ -0,0 +1,45 @@ +// +// MCOIMAP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAP_H + +#define MAILCORE_MCOIMAP_H + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPAppendMessageOperation.h b/MailCore.framework/Headers/MCOIMAPAppendMessageOperation.h new file mode 100644 index 000000000..1e5fbd39d --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPAppendMessageOperation.h @@ -0,0 +1,42 @@ +// +// MCOIMAPAppendMessageOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPAPPENDMESSAGEOPERATION_H + +#define MAILCORE_MCOIMAPAPPENDMESSAGEOPERATION_H + +/** This class implements an operation that adds a message to a folder. */ + +#import +#import + +@interface MCOIMAPAppendMessageOperation : MCOIMAPBaseOperation + +@property (nonatomic, assign) time_t date; + +/** + This block will be called as bytes are sent +*/ +@property (nonatomic, copy) MCOIMAPBaseOperationProgressBlock progress; + +/** + Starts the asynchronous append operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `createdUID` will be the value of the + UID of the created message if the server supports UIDPLUS or zero if not. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `createdUID` will be zero. +*/ +- (void) start:(void (^)(NSError * error, uint32_t createdUID))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPBaseOperation.h b/MailCore.framework/Headers/MCOIMAPBaseOperation.h new file mode 100644 index 000000000..82a343786 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPBaseOperation.h @@ -0,0 +1,42 @@ +// +// MCOIMAPBaseOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/26/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPBASEOPERATION_H + +#define MAILCORE_MCOIMAPBASEOPERATION_H + +/** Represents a generic IMAP operation with methods that are called with progress updates */ + +#import + +typedef void (^MCOIMAPBaseOperationProgressBlock)(unsigned int current, unsigned int maximum); +typedef void (^MCOIMAPBaseOperationItemProgressBlock)(unsigned int current); + +@interface MCOIMAPBaseOperation : MCOOperation + +@property (nonatomic, assign, getter=isUrgent) BOOL urgent; + +/* Can be overriden by subclasses */ + +/* + Will be called when a sending or receiving the contents of a message + @param current The number of bytes sent or received + @param maximum The total number of bytes expected +*/ +- (void)bodyProgress:(unsigned int)current maximum:(unsigned int)maximum; + +/* + Will be called when a new item is received in a list of items, like for example a message list + @param current The number of items downloaded + @param maximum The total number of items expected +*/ +- (void)itemProgress:(unsigned int)current maximum:(unsigned int)maximum; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPCapabilityOperation.h b/MailCore.framework/Headers/MCOIMAPCapabilityOperation.h new file mode 100644 index 000000000..96314e2a6 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPCapabilityOperation.h @@ -0,0 +1,40 @@ +// +// MCOIMAPCapabilityOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPCAPABILITYOPERATION_H + +#define MAILCORE_MCOIMAPCAPABILITYOPERATION_H + +/** + This class implements an operation to query for IMAP capabilities, + like for example the extensions UIDPLUS, IDLE, NAMESPACE, ... etc +*/ + +#import + +@class MCOIndexSet; + +@interface MCOIMAPCapabilityOperation : MCOIMAPBaseOperation + + +/** + Starts the asynchronous capabilities operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `capabilities` will contain a set of IMAP capabilities. + See `MCOConstants.h` under `MCOIMAPCapability` for a list of possible values. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `capabilities` will be nil +*/ +- (void) start:(void (^)(NSError * error, MCOIndexSet * capabilities))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPCopyMessagesOperation.h b/MailCore.framework/Headers/MCOIMAPCopyMessagesOperation.h new file mode 100644 index 000000000..4c573a519 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPCopyMessagesOperation.h @@ -0,0 +1,37 @@ +// +// MCOIMAPCopyMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import + +#ifndef MAILCORE_MCOCOPYMESSAGESOPERATION_H + +#define MAILCORE_MCOCOPYMESSAGESOPERATION_H + +/** Implements an operation for copying messages between folders */ + +@class MCOIndexSet; + +@interface MCOIMAPCopyMessagesOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous copy operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `destUids` will contain the UIDs of the messages created + in the destination folder. If the server doesn't support UIDPLUS then `destUids` will be nil. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `destUids` will be nil +*/ + +- (void) start:(void (^)(NSError * error, NSDictionary * uidMapping))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFetchContentOperation.h b/MailCore.framework/Headers/MCOIMAPFetchContentOperation.h new file mode 100644 index 000000000..254cd1468 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFetchContentOperation.h @@ -0,0 +1,43 @@ +// +// MCOIMAPFetchContentOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFETCHCONTENTOPERATION_H + +#define MAILCORE_MCOIMAPFETCHCONTENTOPERATION_H + +/** + This class implements an operation to fetch the content of a message. + It can be a part or a full message. +*/ + +#import +#import + +@interface MCOIMAPFetchContentOperation : MCOIMAPBaseOperation + +/** + This block will be called as bytes are received from the network +*/ +@property (nonatomic, copy) MCOIMAPBaseOperationProgressBlock progress; + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `data` will contain the requested data + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `data` will be nil +*/ + +- (void) start:(void (^)(NSError * error, NSData * data))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFetchFoldersOperation.h b/MailCore.framework/Headers/MCOIMAPFetchFoldersOperation.h new file mode 100644 index 000000000..853c55fcd --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFetchFoldersOperation.h @@ -0,0 +1,33 @@ +// +// MCOIMAPFetchFoldersOperation.h +// mailcore2 +// +// Created by Matt Ronge on 1/31/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFETCHFOLDERSOPERATION_H + +#define MAILCORE_MCOIMAPFETCHFOLDERSOPERATION_H + +/** This class implements an operation to fetch a list of folders. */ + +#import + +@interface MCOIMAPFetchFoldersOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `folders` will contain an array of MCOIMAPFolder + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `folders` will be nil +*/ +- (void) start:(void (^)(NSError * error, NSArray * /* MCOIMAPFolder */ folders))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFetchMessagesOperation.h b/MailCore.framework/Headers/MCOIMAPFetchMessagesOperation.h new file mode 100644 index 000000000..13dad1b48 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFetchMessagesOperation.h @@ -0,0 +1,45 @@ +// +// MCOIMAPFetchMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFETCHMESSAGESOPERATION_H + +#define MAILCORE_MCOIMAPFETCHMESSAGESOPERATION_H + +#import +#import + +/** This class implements an operation to fetch a list of messages from a folder */ + +@class MCOIndexSet; + +@interface MCOIMAPFetchMessagesOperation : MCOIMAPBaseOperation + +/** This block will be called each time a new message is downloaded. */ +@property (nonatomic, copy) MCOIMAPBaseOperationItemProgressBlock progress; + +/** Extra headers to request. Must set requestKind | IMAPMessagesRequestKindExtraHeaders */ +@property (nonatomic, copy) NSArray * extraHeaders; + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `messages` will be an array of MCOIMAPMessage. + `vanishedMessages` will contain the messages removed on the server if the server supports QRESYNC and if it was a sync request + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `messages` and `vanishedMessages` will be nil + + If you are not supporting QRESYNC you can safely ignore `vanishedMessages`. +*/ +- (void) start:(void (^)(NSError * error, NSArray * /* MCOIMAPMessage */ messages, MCOIndexSet * vanishedMessages))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFetchNamespaceOperation.h b/MailCore.framework/Headers/MCOIMAPFetchNamespaceOperation.h new file mode 100644 index 000000000..5d58f0523 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFetchNamespaceOperation.h @@ -0,0 +1,39 @@ +// +// MCOIMAPFetchNamespaceOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFETCHNAMESPACEOPERATION_H + +#define MAILCORE_MCOIMAPFETCHNAMESPACEOPERATION_H + +/** This class implements an operation to fetch any IMAP namespaces. */ + +#import + +@interface MCOIMAPFetchNamespaceOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous namespace fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `namespaces` will contain these keys: + + - `MCOIMAPNamespacePersonal` for personal namespaces, + - `MCOIMAPNamespaceOther` for other namespaces, + - `MCOIMAPNamespaceShared` for shared namespaces. + + Values of the dictionary are MCOIMAPNamespace + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `namespaces` will be nil +*/ +- (void) start:(void (^)(NSError * error, NSDictionary * namespaces))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFetchParsedContentOperation.h b/MailCore.framework/Headers/MCOIMAPFetchParsedContentOperation.h new file mode 100644 index 000000000..de2b16634 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFetchParsedContentOperation.h @@ -0,0 +1,44 @@ +// +// MCOIMAPFetchParsedContentOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFETCHPARSEDCONTENTOPERATION_H + +#define MAILCORE_MCOIMAPFETCHPARSEDCONTENTOPERATION_H + +/** + This class implements an operation to fetch the parsed content of a message. +*/ + +#import +#import + +@class MCOMessageParser; + +@interface MCOIMAPFetchParsedContentOperation : MCOIMAPBaseOperation + +/** + This block will be called as bytes are received from the network +*/ +@property (nonatomic, copy) MCOIMAPBaseOperationProgressBlock progress; + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `parser` will contain the requested message + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `data` will be nil +*/ + +- (void) start:(void (^)(NSError * error, MCOMessageParser * parser))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFolder.h b/MailCore.framework/Headers/MCOIMAPFolder.h new file mode 100644 index 000000000..048dfb55d --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFolder.h @@ -0,0 +1,34 @@ +// +// MCOIMAPFolder.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFOLDER_H + +#define MAILCORE_MCOIMAPFOLDER_H + +/** This class represents an IMAP folder */ + +#import +#import + +@interface MCOIMAPFolder : NSObject + +/** The folder's path, like for example INBOX.Archive */ +@property (nonatomic, copy) NSString * path; + +/** It's the delimiter for each component of the path. Commonly . or / */ +@property (nonatomic, assign) char delimiter; + +/** + Any flags the folder may have, like if the folder is for Drafts, Spam, Junk, etc. Or + it could be marked with metadata like that it has no children. +*/ +@property (nonatomic, assign) MCOIMAPFolderFlag flags; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFolderInfo.h b/MailCore.framework/Headers/MCOIMAPFolderInfo.h new file mode 100644 index 000000000..1397e8418 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFolderInfo.h @@ -0,0 +1,39 @@ +// +// MCOIMAPFolderInfo.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFOLDERINFO_H + +#define MAILCORE_MCOIMAPFOLDERINFO_H + +#import + +/* This class holds IMAP folder metadata */ + +@interface MCOIMAPFolderInfo : NSObject + +/** The folder's IMAP UIDNEXT value. Used to determine the uid for the next received message. */ +@property (nonatomic, assign) uint32_t uidNext; + +/** The folders IMAP UIDVALIDITY value. Must be used to determine if the server has changed assigned UIDs */ +@property (nonatomic, assign) uint32_t uidValidity; + +/** An advanced value used for doing quick flag syncs if the server supports it. The MODSEQ value. */ +@property (nonatomic, assign) uint64_t modSequenceValue; + +/** Total number of messages in the folder */ +@property (nonatomic, assign) int messageCount; + +// first uid of the unseen messages. +@property (nonatomic, assign) uint32_t firstUnseenUid; + +/** An boolean indicates that this folder or IMAP server allows to add a new permanent flags */ +@property (nonatomic, assign) BOOL allowsNewPermanentFlags; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFolderInfoOperation.h b/MailCore.framework/Headers/MCOIMAPFolderInfoOperation.h new file mode 100644 index 000000000..e25016c71 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFolderInfoOperation.h @@ -0,0 +1,39 @@ +// +// MCOIMAPFolderInfoOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFOLDERINFOOPERATION_H + +#define MAILCORE_MCOIMAPFOLDERINFOOPERATION_H + +#import + +/** + The class is used to get folder metadata (like UIDVALIDITY, UIDNEXT, etc). + @see MCOIMAPFolderInfo +*/ + +@class MCOIMAPFolderInfo; + +@interface MCOIMAPFolderInfoOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `info` will contain the folder metadata + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `info` will be nil +*/ + +- (void) start:(void (^)(NSError * error, MCOIMAPFolderInfo * info))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFolderStatus.h b/MailCore.framework/Headers/MCOIMAPFolderStatus.h new file mode 100644 index 000000000..bd1ddef3c --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFolderStatus.h @@ -0,0 +1,39 @@ +// +// MCOIMAPFolderStatus.h +// mailcore2 +// +// Created by Sebastian on 6/5/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFOLDERSTATUS_H + +#define MAILCORE_MCOIMAPFOLDERSTATUS_H + +#import + +/* This class holds IMAP folder metadata */ + +@interface MCOIMAPFolderStatus : NSObject + +/** The folder's IMAP UIDNEXT value. Used to determine the uid for the next received message. */ +@property (nonatomic, assign) uint32_t uidNext; + +/** The folders IMAP UIDVALIDITY value. Must be used to determine if the server has changed assigned UIDs */ +@property (nonatomic, assign) uint32_t uidValidity; + +/** Number of recent messages received in the folder */ +@property (nonatomic, assign) uint32_t recentCount; + +/** Number of unseen messages in the folder */ +@property (nonatomic, assign) uint32_t unseenCount; + +/** Number of messages in the folder */ +@property (nonatomic, assign) uint32_t messageCount; + +/** Highest modification sequence value for this folder. See CONDSTORE RFC 4551. */ +@property (nonatomic, assign) uint64_t highestModSeqValue; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPFolderStatusOperation.h b/MailCore.framework/Headers/MCOIMAPFolderStatusOperation.h new file mode 100644 index 000000000..2117260f0 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPFolderStatusOperation.h @@ -0,0 +1,39 @@ +// +// MCOIMAPFolderStatusOperation.h +// mailcore2 +// +// Created by Sebastian on 6/5/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPFOLDERSTATUSOPERATION_H + +#define MAILCORE_MCOIMAPFOLDERSTATUSOPERATION_H + +#import + +/** + The class is used to get folder metadata (like UIDVALIDITY, UIDNEXT, etc). + @see MCOIMAPFolderStatus + */ + +@class MCOIMAPFolderStatus; + +@interface MCOIMAPFolderStatusOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `status` will contain the status metadata + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `info` will be nil + */ + +- (void) start:(void (^)(NSError * error, MCOIMAPFolderStatus * status))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPIdentity.h b/MailCore.framework/Headers/MCOIMAPIdentity.h new file mode 100644 index 000000000..69f18c968 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPIdentity.h @@ -0,0 +1,45 @@ +// +// MCOIMAPIdentity.h +// mailcore2 +// +// Created by Hoa V. DINH on 8/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPIDENTITY_H + +#define MAILCORE_MCOIMAPIDENTITY_H + +#import + +@interface MCOIMAPIdentity : NSObject + +/** Returns a simple identity */ ++ (MCOIMAPIdentity *) identityWithVendor:(NSString *)vendor + name:(NSString *)name + version:(NSString *)version; + +/** Vendor of the IMAP client */ +@property (nonatomic, copy) NSString * vendor; + +/** Name of the IMAP client */ +@property (nonatomic, copy) NSString * name; + +/** Version of the IMAP client */ +@property (nonatomic, copy) NSString * version; + +/** All fields names of the identity of the client */ +- (NSArray *) allInfoKeys; + +/** Set a custom field in the identity */ +- (NSString *) infoForKey:(NSString *)key; + +/** Retrieve a custom field in the identity */ +- (void) setInfo:(NSString *)value forKey:(NSString *)key; + +/** Remove all info keys including vendor, name and version */ +- (void) removeAllInfos; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPIdentityOperation.h b/MailCore.framework/Headers/MCOIMAPIdentityOperation.h new file mode 100644 index 000000000..20b9fc88b --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPIdentityOperation.h @@ -0,0 +1,39 @@ +// +// MCOIMAPIdentityOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPIDENTITYOPERATION_H + +#define MAILCORE_MCOIMAPIDENTITYOPERATION_H + +/** + This class implements an operation to get the servers identification info or + to send the clients identification info. Useful for bug reports and usage + statistics. + @warn Not all servers support this. +*/ + +#import + +@interface MCOIMAPIdentityOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous identity operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `serverIdentity` will contain identifying server information. + See [RFC2971](http://tools.ietf.org/html/rfc2971) for commons dictionary keys. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h`, `serverIdentity` will be nil +*/ +- (void) start:(void (^)(NSError * error, NSDictionary * serverIdentity))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPIdleOperation.h b/MailCore.framework/Headers/MCOIMAPIdleOperation.h new file mode 100644 index 000000000..672a3258e --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPIdleOperation.h @@ -0,0 +1,40 @@ +// +// MCOIMAPIdleOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPIDLEOPERATION_H + +#define MAILCORE_MCOIMAPIDLEOPERATION_H + +/** + This class implements an IMAP IDLE. IDLE is used to keep a connection + open with the server so that new messages can be pushed to the client. + See [RFC2177](http://tools.ietf.org/html/rfc2177) +*/ + +#import + +@interface MCOIMAPIdleOperation : MCOIMAPBaseOperation + +/** Stop the current IDLE session */ +- (void) interruptIdle; + +/** + Starts IDLE + + @param completionBlock Called when the IDLE times out, errors out or detects a change + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in `MCOConstants.h` +*/ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPMessage.h b/MailCore.framework/Headers/MCOIMAPMessage.h new file mode 100644 index 000000000..8e2e1c270 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPMessage.h @@ -0,0 +1,85 @@ +// +// MCOIMAPMessage.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPMESSAGE_H + +#define MAILCORE_MCOIMAPMESSAGE_H + +/** + This represents an IMAP message. + + If you fetched the MIME structure of the message, you can fetch + efficiently the content of the message by fetching only the parts + that you need to show it. + + For example, you could fetch only the text parts to show the summary + of the message, using [MCOIMAPSession fetchMessageAttachmentByUIDOperationWithFolder:uid:partID:encoding:] + + You can also decide to fetch entirely the message using + [MCOIMAPSession fetchMessageByUIDOperationWithFolder:uid:] +*/ + +#import +#import + +@protocol MCOHTMLRendererIMAPDelegate; + +@interface MCOIMAPMessage : MCOAbstractMessage + +/** IMAP UID of the message. */ +@property (nonatomic, assign) uint32_t uid; + +/** IMAP sequence number of the message. + @warning *Important*: This property won't be serialized. */ +@property (nonatomic, assign) uint32_t sequenceNumber; + +/* Size of the entire message */ +@property (nonatomic, assign) uint32_t size; + +/** Flags of the message, like if it is deleted, read, starred etc */ +@property (nonatomic, assign) MCOMessageFlag flags; + +/** The contents of the message flags when it was fetched from the server */ +@property (nonatomic, assign) MCOMessageFlag originalFlags; + +/** Flag keywords of the message, mostly custom flags */ +@property (nonatomic, copy) NSArray * /* NSString */ customFlags; + +/** It's the last modification sequence value of the message synced from the server. See RFC4551 */ +@property (nonatomic, assign) uint64_t modSeqValue; + +/** Main MIME part of the message */ +@property (nonatomic, retain) MCOAbstractPart * mainPart; + +/** All Gmail labels of the message */ +@property (nonatomic, copy) NSArray * /* NSString */ gmailLabels; + +/** Gmail message ID of the message */ +@property (nonatomic, assign) uint64_t gmailMessageID; + +/** Gmail thread ID of the message */ +@property (nonatomic, assign) uint64_t gmailThreadID; + +/** + Returns the part with the given part identifier. + @param partID A part identifier looks like 1.2.1 +*/ +- (MCOAbstractPart *) partForPartID:(NSString *)partID; + +/** + HTML rendering of the message to be displayed in a web view. + The delegate should implement at least + [MCOAbstractMessage:dataForIMAPPart:folder:] + so that the complete HTML rendering can take place. +*/ +- (NSString *) htmlRenderingWithFolder:(NSString *)folder + delegate:(id )delegate; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPMessagePart.h b/MailCore.framework/Headers/MCOIMAPMessagePart.h new file mode 100644 index 000000000..c455d336a --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPMessagePart.h @@ -0,0 +1,24 @@ +// +// MCOIMAPMessagePart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPMESSAGEPART_H + +#define MAILCORE_MCOIMAPMESSAGEPART_H + +/** Represents a message part. */ + +#import + +@interface MCOIMAPMessagePart : MCOAbstractMessagePart + +/** A part identifier is of the form 1.2.1*/ +@property (nonatomic, copy) NSString * partID; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPMessageRenderingOperation.h b/MailCore.framework/Headers/MCOIMAPMessageRenderingOperation.h new file mode 100644 index 000000000..2c7f56d59 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPMessageRenderingOperation.h @@ -0,0 +1,35 @@ +// +// MCOIMAPMessageRenderingOperation.h +// mailcore2 +// +// Created by Paul Young on 07/07/2013. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPMESSAGERENDERINGOPERATION_H + +#define MAILCORE_MCOIMAPMESSAGERENDERINGOPERATION_H + +#import + +/** + The class is used to get the HTML string of a message. + */ + +@interface MCOIMAPMessageRenderingOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `htmlString` will contain the message + + - On failure, `error` will be set and `htmlString` will be nil + */ + +- (void) start:(void (^)(NSString * htmlString, NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPMultipart.h b/MailCore.framework/Headers/MCOIMAPMultipart.h new file mode 100644 index 000000000..c083f4256 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPMultipart.h @@ -0,0 +1,24 @@ +// +// MCOIMAPMultipart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPMULTIPART_H + +#define MAILCORE_MCOIMAPMULTIPART_H + +/** Represents the a multipart retrieved from IMAP */ + +#import + +@interface MCOIMAPMultipart : MCOAbstractMultipart + +/** A part identifier looks like 1.2.1 */ +@property (nonatomic, copy) NSString * partID; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPNamespace.h b/MailCore.framework/Headers/MCOIMAPNamespace.h new file mode 100644 index 000000000..3e842aadd --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPNamespace.h @@ -0,0 +1,55 @@ +// +// MCOIMAPNamespace.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPNAMESPACE_H + +#define MAILCORE_MCOIMAPNAMESPACE_H + +/** Represents an IMAP namespace */ + +#import + +@class MCOIMAPNamespace; + +@interface MCOIMAPNamespace : NSObject + +/** + Returns a simple namespace with only one item. +*/ ++ (MCOIMAPNamespace *) namespaceWithPrefix:(NSString *)prefix delimiter:(char)delimiter; + +/** Returns the prefix of the main item of this namespace. */ +- (NSString *) mainPrefix; + +/** Returns the path delimiter of the main item of this namespace */ +- (char) mainDelimiter; + +/** Returns the list of prefixes of this namespace. */ +- (NSArray * /* NSString */) prefixes; + +/** + Returns the folder path for the given list of path components in the context + of the main item of the namespace. +*/ +- (NSString *) pathForComponents:(NSArray *)components; + +/** + Returns the folder path for the given list of path components and a prefix. + It will use the best item matching the prefix to compute the path. +*/ +- (NSString *) pathForComponents:(NSArray *)components prefix:(NSString *)prefix; + +/** Returns the components given a folder path. */ +- (NSArray * /* NSString */) componentsFromPath:(NSString *)path; + +/** Returns YES if the namespace contains the given folder path. */ +- (BOOL) containsFolderPath:(NSString *)path; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPNamespaceItem.h b/MailCore.framework/Headers/MCOIMAPNamespaceItem.h new file mode 100644 index 000000000..64ae3c5fa --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPNamespaceItem.h @@ -0,0 +1,36 @@ +// +// MCOIMAPNamespaceItem.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPNAMESPACEITEM_H + +#define MAILCORE_MCOIMAPNAMESPACEITEM_H + +/** Represents a namespace item */ + +#import + +@interface MCOIMAPNamespaceItem : NSObject + +/** This is the prefix for this namespace item */ +@property (nonatomic, copy) NSString * prefix; + +/** This is the delimiter of the path for this namespace item */ +@property (nonatomic, assign) char delimiter; + +/** Returns folder path for given path components in the context of this namespace item */ +- (NSString *) pathForComponents:(NSArray *)components; + +/** Returns components for the given path in the context of this namespace */ +- (NSArray * /* NSString */) componentsForPath:(NSString *)path; + +/** Returns YES if the namespace contains this folder path */ +- (BOOL) containsFolder:(NSString *)folder; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPOperation.h b/MailCore.framework/Headers/MCOIMAPOperation.h new file mode 100644 index 000000000..f8003c070 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPOperation.h @@ -0,0 +1,33 @@ +// +// MCOIMAPOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPOPERATION_H + +#define MAILCORE_MCOIMAPOPERATION_H + +/** This class implements a generic IMAP operation */ + +#import + +@interface MCOIMAPOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous append operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, +*/ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPPart.h b/MailCore.framework/Headers/MCOIMAPPart.h new file mode 100644 index 000000000..660113b56 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPPart.h @@ -0,0 +1,38 @@ +// +// MCOIMAPPart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPABSTRACTPART_H + +#define MAILCORE_MCOIMAPABSTRACTPART_H + +#import + +#import + +/** Represents a single IMAP message part */ + +@interface MCOIMAPPart : MCOAbstractPart + +/** A part identifier looks like 1.2.1 */ +@property (nonatomic, copy) NSString * partID; + +/** The size of the single part in bytes */ +@property (nonatomic, nonatomic) unsigned int size; + +/** It's the encoding of the single part */ +@property (nonatomic, nonatomic) MCOEncoding encoding; + +/** + Returns the decoded size of the part. + For example, for a part that's encoded with base64, it will return actual_size * 3/4. +*/ +- (unsigned int) decodedSize; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPQuotaOperation.h b/MailCore.framework/Headers/MCOIMAPQuotaOperation.h new file mode 100644 index 000000000..c0463bb0f --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPQuotaOperation.h @@ -0,0 +1,15 @@ +// +// MCOIMAPQuotaOperation.h +// mailcore2 +// +// Created by Petro Korenev on 8/2/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import "MCOIMAPBaseOperation.h" + +@interface MCOIMAPQuotaOperation : MCOIMAPBaseOperation + +- (void) start:(void (^)(NSError * error, NSUInteger usage, NSUInteger limit))completionBlock; + +@end diff --git a/MailCore.framework/Headers/MCOIMAPSearchExpression.h b/MailCore.framework/Headers/MCOIMAPSearchExpression.h new file mode 100644 index 000000000..225b3a5ef --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPSearchExpression.h @@ -0,0 +1,365 @@ +// +// MCOIMAPSearchExpression.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPSEARCHEXPRESSION_H + +#define MAILCORE_MCOIMAPSEARCHEXPRESSION_H + +/** Used to construct an IMAP search query */ + +#import +#import +#import + +@interface MCOIMAPSearchExpression : NSObject + +/** + Creates a search expression that returns all UIDS for the mailbox + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAll] +*/ ++ (MCOIMAPSearchExpression *) searchAll; + +/** + Creates a search expression that matches the sender of an email. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"] +*/ ++ (MCOIMAPSearchExpression *) searchFrom:(NSString *)value; + +/** + Creates a search expression that matches any recipient of an email. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchRecipient:@"ngan@etpan.org"] + **/ ++ (MCOIMAPSearchExpression *) searchRecipient:(NSString *)value; + +/** + Creates a search expression that matches on the receiver (to) of an email. Useful to check whether the mail is directly addressed to the receiver. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchTo:@"ngan@etpan.org"] +**/ ++ (MCOIMAPSearchExpression *) searchTo:(NSString *)value; + +/** + Creates a search expression that matches on the cc of an email. Useful to check whether the mail is addressed to the receiver as cc. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchCc:@"ngan@etpan.org"] + **/ ++ (MCOIMAPSearchExpression *) searchCc:(NSString *)value; + +/** + Creates a search expression that matches on the bcc field of an email. Useful to check whether the mail is addressed to the receiver as bcc. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBcc:@"ngan@etpan.org"] + **/ ++ (MCOIMAPSearchExpression *) searchBcc:(NSString *)value; + +/* + Creates a search expression that matches the subject of an email. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSubject:@"airline"] +**/ ++ (MCOIMAPSearchExpression *) searchSubject:(NSString *)value; + +/** + Creates a search expression that matches the content of an email, including the headers. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchContent:@"meeting"] +*/ ++ (MCOIMAPSearchExpression *) searchContent:(NSString *)value; + +/** + Creates a search expression that matches the content of an email, excluding the headers. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBody:@"building"] + */ ++ (MCOIMAPSearchExpression *) searchBody:(NSString *)value; + +/** + Creates a search expression that matches the uids specified. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUids:uids] + **/ ++ (MCOIMAPSearchExpression *) searchUIDs:(MCOIndexSet *) uids; + +/** + Creates a search expression that matches the message numbers specified. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchNumbers:numbers] + **/ ++ (MCOIMAPSearchExpression *) searchNumbers:(MCOIndexSet *) numbers; + +/** + Creates a search expression that matches the content of a specific header. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchHeader:@"List-Id" value:@"shoes"] +**/ ++ (MCOIMAPSearchExpression *) searchHeader:(NSString *)header value:(NSString *)value; + +/** + Creates a search expression that matches messages with the Read flag. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchRead] + **/ ++ (MCOIMAPSearchExpression *) searchRead; + +/** + Creates a search expression that matches messages without the Read flag. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnread] + **/ ++ (MCOIMAPSearchExpression *) searchUnread; + +/** + Creates a search expression that matches messages that have been flagged. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchFlagged] + **/ ++ (MCOIMAPSearchExpression *) searchFlagged; + +/** + Creates a search expression that matches messages that haven't been flagged. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnflagged] + **/ ++ (MCOIMAPSearchExpression *) searchUnflagged; + +/** + Creates a search expression that matches messages that have the answered flag set. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAnswered] + **/ ++ (MCOIMAPSearchExpression *) searchAnswered; + +/** + Creates a search expression that matches messages that don't have the answered flag set.. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUnanswered] + **/ ++ (MCOIMAPSearchExpression *) searchUnanswered; + +/** + Creates a search expression that matches draft messages. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchDraft] + **/ ++ (MCOIMAPSearchExpression *) searchDraft; + +/** + Creates a search expression that matches messages that aren't drafts. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchUndraft] + **/ ++ (MCOIMAPSearchExpression *) searchUndraft; + +/** + Creates a search expression that matches messages that are deleted. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchDeleted] + **/ ++ (MCOIMAPSearchExpression *) searchDeleted; + +/** + Creates a search expression that matches messages that are spam. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSpam] + **/ ++ (MCOIMAPSearchExpression *) searchSpam; + +/** + Creates a search expression that matches messages sent before a date. + + Example: + + NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBeforeDate:yesterday] + **/ ++ (MCOIMAPSearchExpression *) searchBeforeDate:(NSDate *)date; + +/** + Creates a search expression that matches messages sent on a date. + + Example: + + NSDate *now = [NSDate date]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOnDate:now] + **/ ++ (MCOIMAPSearchExpression *) searchOnDate:(NSDate *)date; + +/** + Creates a search expression that matches messages sent since a date. + + Example: + + NSDate *now = [NSDate date]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSinceDate:now] + **/ ++ (MCOIMAPSearchExpression *) searchSinceDate:(NSDate *)date; + +/** + Creates a search expression that matches messages received before a date. + + Example: + + NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBeforeReceivedDate:yesterday] + **/ ++ (MCOIMAPSearchExpression *) searchBeforeReceivedDate:(NSDate *)date; + +/** + Creates a search expression that matches messages received on a date. + + Example: + + NSDate *now = [NSDate date]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOnReceivedDate:now] + **/ ++ (MCOIMAPSearchExpression *) searchOnReceivedDate:(NSDate *)date; + +/** + Creates a search expression that matches messages received since a date. + + Example: + + NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-(60.0 * 60.0 * 24.0)]; + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSinceReceivedDate:yesterday] + **/ ++ (MCOIMAPSearchExpression *) searchSinceReceivedDate:(NSDate *)date; + +/** + Creates a search expression that matches messages larger than a given size in bytes. + + Example: + + uint32_t minSize = 1024 * 10; // 10 KB + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSizeLargerThan:minSize] + **/ ++ (MCOIMAPSearchExpression *) searchSizeLargerThan:(uint32_t)size; + +/** + Creates a search expression that matches messages smaller than a given size in bytes. + + Example: + + uint32_t maxSize = 1024 * 10; // 10 KB + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchSizeSmallerThan:maxSize] + **/ ++ (MCOIMAPSearchExpression *) searchSizeSmallerThan:(uint32_t)size; + +/** + Creates a search expression that matches emails with the given gmail thread id + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailThreadID:aThreadID] + */ ++ (MCOIMAPSearchExpression *) searchGmailThreadID:(uint64_t)number; + + +/** + Creates a search expression that matches emails with the given gmail message id + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailMessageID:aMessageID] + */ ++ (MCOIMAPSearchExpression *) searchGmailMessageID:(uint64_t)number; + +/** + Creates a search expression that gets emails that match a gmail raw search + expression. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchGmailRaw:@"from:bill has:attachment filename:cal meeting schedule"] + */ ++ (MCOIMAPSearchExpression *) searchGmailRaw:(NSString *)expr; + + +/** + Creates a search expression that's a disjunction of two search expressions. + + Example: + + MCOIMAPSearchExpression * exprFrom = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"] + MCOIMAPSearchExpression * exprSubject = [MCOIMAPSearchExpression searchContent:@"meeting"] + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchAnd:exprFrom other:exprSubject]; +**/ + ++ (MCOIMAPSearchExpression *) searchAnd:(MCOIMAPSearchExpression *)expression other:(MCOIMAPSearchExpression *)other; +/** + Creates a search expression that's a conjunction of two search expressions. + + Example: + + MCOIMAPSearchExpression * exprFrom = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"] + MCOIMAPSearchExpression * exprOtherFrom = [MCOIMAPSearchExpression searchRecipient:@"ngan@etpan.org"] + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchOr:exprFrom exprOtherFrom]; +*/ ++ (MCOIMAPSearchExpression *) searchOr:(MCOIMAPSearchExpression *)expression other:(MCOIMAPSearchExpression *)other; + +/** + Creates a search expression that matches when the argument is not matched. + + Example: + + MCOIMAPSearchExpression * exprSubject = [MCOIMAPSearchExpression searchSubject:@"airline"] + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchNot:exprSubject]; + The expression will match when the subject does not contain the word airline + + */ ++ (MCOIMAPSearchExpression *) searchNot:(MCOIMAPSearchExpression *)expression; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPSearchOperation.h b/MailCore.framework/Headers/MCOIMAPSearchOperation.h new file mode 100644 index 000000000..1ec3c95cd --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPSearchOperation.h @@ -0,0 +1,36 @@ +// +// MCOIMAPSearchOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSEARCHOPERATION_H + +#define MAILCORE_MCOSEARCHOPERATION_H + +/** This class runs an IMAP search operation */ + +#import + +@class MCOIndexSet; + +@interface MCOIMAPSearchOperation : MCOIMAPBaseOperation + +/** + Starts the asynchronous search operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `searchResults` will contain the UIDs of any matching messages + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `searchResult` will be nil +*/ + +- (void) start:(void (^)(NSError * error, MCOIndexSet * searchResult))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIMAPSession.h b/MailCore.framework/Headers/MCOIMAPSession.h new file mode 100755 index 000000000..f364c1591 --- /dev/null +++ b/MailCore.framework/Headers/MCOIMAPSession.h @@ -0,0 +1,1011 @@ +// +// MCOIMAPSession.h +// mailcore2 +// +// Created by Matt Ronge on 1/31/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOIMAPSESSION_H + +#define MAILCORE_MCOIMAPSESSION_H + +#import +#import + +@class MCOIMAPFetchFoldersOperation; +@class MCOIMAPOperation; +@class MCOIMAPNamespace; +@class MCOIMAPFolderInfoOperation; +@class MCOIMAPFolderStatusOperation; +@class MCOIMAPAppendMessageOperation; +@class MCOIMAPCopyMessagesOperation; +@class MCOIndexSet; +@class MCOIMAPFetchMessagesOperation; +@class MCOIMAPFetchContentOperation; +@class MCOIMAPFetchParsedContentOperation; +@class MCOIMAPSearchOperation; +@class MCOIMAPIdleOperation; +@class MCOIMAPFetchNamespaceOperation; +@class MCOIMAPSearchExpression; +@class MCOIMAPIdentityOperation; +@class MCOIMAPCapabilityOperation; +@class MCOIMAPQuotaOperation; +@class MCOIMAPMessageRenderingOperation; +@class MCOIMAPMessage; +@class MCOIMAPIdentity; + +/** + This is the main IMAP class from which all operations are created + + After calling a method that returns an operation you must call start: on the instance + to begin the operation. +*/ + +@interface MCOIMAPSession : NSObject + +/** This is the hostname of the IMAP server to connect to. */ +@property (nonatomic, copy) NSString *hostname; + +/** This is the port of the IMAP server to connect to. */ +@property (nonatomic, assign) unsigned int port; + +/** This is the username of the account. */ +@property (nonatomic, copy) NSString *username; + +/** This is the password of the account. */ +@property (nonatomic, copy) NSString *password; + +/** This is the OAuth2 token. */ +@property (nonatomic, copy) NSString *OAuth2Token; + +/** + This is the authentication type to use to connect. + `MCOAuthTypeSASLNone` means that it uses the clear-text is used (and is the default). + @warning *Important*: Over an encrypted connection like TLS, the password will still be secure +*/ +@property (nonatomic, assign) MCOAuthType authType; + +/** + This is the encryption type to use. + See MCOConnectionType for more information. +*/ +@property (nonatomic, assign) MCOConnectionType connectionType; + +/** This is the timeout of the connection. */ +@property (nonatomic, assign) NSTimeInterval timeout; + +/** When set to YES, the connection will fail if the certificate is incorrect. */ +@property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabled; + +/** When set to YES, VoIP capability will be enabled on the IMAP connection on iOS */ +@property (nonatomic, assign, getter=isVoIPEnabled) BOOL voIPEnabled; + +/** The default namespace. */ +@property (nonatomic, strong) MCOIMAPNamespace * defaultNamespace; + +/** The identity of the IMAP client. */ +@property (nonatomic, strong, readonly) MCOIMAPIdentity * clientIdentity; + +/** The identity of the IMAP server. */ +@property (nonatomic, strong, readonly) MCOIMAPIdentity * serverIdentity; + +/** + Display name of the Gmail user. It will be nil if it's not a Gmail server. + + ** DEPRECATED ** + This attribute has been broken by Gmail IMAP server. It's not longer available + as a correct display name. +*/ +@property (nonatomic, copy, readonly) NSString * gmailUserDisplayName DEPRECATED_ATTRIBUTE; + +/** + When set to YES, the session is allowed open to open several connections to the same folder. + @warning Some older IMAP servers don't like this +*/ +@property (nonatomic, assign) BOOL allowsFolderConcurrentAccessEnabled; + +/** + Maximum number of connections to the server allowed. +*/ +@property (nonatomic, assign) unsigned int maximumConnections; + +/** + Sets logger callback. The network traffic will be sent to this block. + + [session setConnectionLogger:^(void * connectionID, MCOConnectionLogType type, NSData * data) { + NSLog(@"%@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + // ... + }]; +*/ +@property (nonatomic, copy) MCOConnectionLogger connectionLogger; + +/** This property provides some hints to MCOIMAPSession about where it's called from. + It will make MCOIMAPSession safe. It will also set all the callbacks of operations to run on this given queue. + Defaults to the main queue. + This property should be used only if there's performance issue using MCOIMAPSession in the main thread. */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, retain) dispatch_queue_t dispatchQueue; +#else +@property (nonatomic, assign) dispatch_queue_t dispatchQueue; +#endif + +/** + The value will be YES when asynchronous operations are running, else it will return NO. +*/ +@property (nonatomic, assign, readonly, getter=isOperationQueueRunning) BOOL operationQueueRunning; + +/** + Sets operation running callback. It will be called when operations start or stop running. + + [session setOperationQueueRunningChangeBlock:^{ + if ([session isOperationQueueRunning]) { + ... + } + else { + ... + } + }]; +*/ +@property (nonatomic, copy) MCOOperationQueueRunningChangeBlock operationQueueRunningChangeBlock; + +/** + Cancel all operations + */ +- (void) cancelAllOperations; + +/** @name Folder Operations */ + +/** + Returns an operation that retrieves folder metadata (like UIDNext) + + MCOIMAPFolderInfoOperation * op = [session folderInfoOperation:@"INBOX"]; + [op start:^(NSError *error, MCOIMAPFolderInfo * info) { + NSLog(@"UIDNEXT: %lu", (unsigned long) [info uidNext]); + NSLog(@"UIDVALIDITY: %lu", (unsigned long) [info uidValidity]); + NSLog(@"HIGHESTMODSEQ: %llu", (unsigned long long) [info modSequenceValue]); + NSLog(@"messages count: %lu", [info messageCount]); + }]; +*/ + +- (MCOIMAPFolderInfoOperation *) folderInfoOperation:(NSString *)folder; + +/** + Returns an operation that retrieves folder status (like UIDNext - Unseen -) + + MCOIMAPFolderStatusOperation * op = [session folderStatusOperation:@"INBOX"]; + [op start:^(NSError *error, MCOIMAPFolderStatus * info) { + NSLog(@"UIDNEXT: %lu", (unsigned long) [info uidNext]); + NSLog(@"UIDVALIDITY: %lu", (unsigned long) [info uidValidity]); + NSLog(@"messages count: %lu", [info totalMessages]); + }]; + */ + +- (MCOIMAPFolderStatusOperation *) folderStatusOperation:(NSString *)folder; + +/** + Returns an operation that gets the list of subscribed folders. + + MCOIMAPFetchFoldersOperation * op = [session fetchSubscribedFoldersOperation]; + [op start:^(NSError * error, NSArray * folders) { + ... + }]; + */ + +- (MCOIMAPFetchFoldersOperation *) fetchSubscribedFoldersOperation; + +/** + Returns an operation that gets all folders + + MCOIMAPFetchFoldersOperation * op = [session fetchAllFoldersOperation]; + [op start:^(NSError * error, NSArray *folders) { + ... + }]; +*/ +- (MCOIMAPFetchFoldersOperation *) fetchAllFoldersOperation; + +/** + Creates an operation for renaming a folder + + MCOIMAPOperation * op = [session renameFolderOperation:@"my documents" otherName:@"Documents"]; + [op start:^(NSError * error) { + ... + }]; + +*/ +- (MCOIMAPOperation *) renameFolderOperation:(NSString *)folder otherName:(NSString *)otherName; + +/** + Create an operation for deleting a folder + + MCOIMAPOperation * op = [session deleteFolderOperation:@"holidays 2009"]; + [op start:^(NSError * error) { + ... + }]]; +*/ +- (MCOIMAPOperation *) deleteFolderOperation:(NSString *)folder; + +/** + Returns an operation that creates a new folder + + MCOIMAPOperation * op = [session createFolderOperation:@"holidays 2013"]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPOperation *) createFolderOperation:(NSString *)folder; + +/** + Returns an operation to subscribe to a folder. + + MCOIMAPOperation * op = [session createFolderOperation:@"holidays 2013"]; + [op start:^(NSError * error) { + if (error != nil) + return; + MCOIMAPOperation * op = [session subscribeFolderOperation:@"holidays 2013"]; + ... + }]; +*/ +- (MCOIMAPOperation *) subscribeFolderOperation:(NSString *)folder; + +/** + Returns an operation to unsubscribe from a folder. + + MCOIMAPOperation * op = [session unsubscribeFolderOperation:@"holidays 2009"]; + [op start:^(NSError * error) { + if (error != nil) + return; + MCOIMAPOperation * op = [session deleteFolderOperation:@"holidays 2009"] + ... + }]; +*/ +- (MCOIMAPOperation *) unsubscribeFolderOperation:(NSString *)folder; + +/** + Returns an operation to expunge a folder. + + MCOIMAPOperation * op = [session expungeOperation:@"INBOX"]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPOperation *) expungeOperation:(NSString *)folder; + +/** @name Message Actions */ + +/** + Returns an operation to add a message to a folder. + + MCOIMAPOperation * op = [session appendMessageOperationWithFolder:@"Sent Mail" messageData:rfc822Data flags:MCOMessageFlagNone]; + [op start:^(NSError * error, uint32_t createdUID) { + if (error == nil) { + NSLog(@"created message with UID %lu", (unsigned long) createdUID); + } + }]; +*/ +- (MCOIMAPAppendMessageOperation *)appendMessageOperationWithFolder:(NSString *)folder + messageData:(NSData *)messageData + flags:(MCOMessageFlag)flags; + +/** + Returns an operation to add a message with custom flags to a folder. + + MCOIMAPOperation * op = [session appendMessageOperationWithFolder:@"Sent Mail" messageData:rfc822Data flags:MCOMessageFlagNone customFlags:@[@"$CNS-Greeting-On"]]; + [op start:^(NSError * error, uint32_t createdUID) { + if (error == nil) { + NSLog(@"created message with UID %lu", (unsigned long) createdUID); + } + }]; + */ +- (MCOIMAPAppendMessageOperation *)appendMessageOperationWithFolder:(NSString *)folder + messageData:(NSData *)messageData + flags:(MCOMessageFlag)flags + customFlags:(NSArray *)customFlags; + +/** + Returns an operation to copy messages to a folder. + + MCOIMAPCopyMessagesOperation * op = [session copyMessagesOperationWithFolder:@"INBOX" + uids:[MCIndexSet indexSetWithIndex:456] + destFolder:@"Cocoa"]; + [op start:^(NSError * error, NSDictionary * uidMapping) { + NSLog(@"copied to folder with UID mapping %@", uidMapping); + }]; +*/ +- (MCOIMAPCopyMessagesOperation *)copyMessagesOperationWithFolder:(NSString *)folder + uids:(MCOIndexSet *)uids + destFolder:(NSString *)destFolder NS_RETURNS_NOT_RETAINED; + +/** + Returns an operation to change flags of messages. + + For example: Adds the seen flag to the message with UID 456. + + MCOIMAPOperation * op = [session storeFlagsOperationWithFolder:@"INBOX" + uids:[MCOIndexSet indexSetWithIndex:456] + kind:MCOIMAPStoreFlagsRequestKindAdd + flags:MCOMessageFlagSeen]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPOperation *) storeFlagsOperationWithFolder:(NSString *)folder + uids:(MCOIndexSet *)uids + kind:(MCOIMAPStoreFlagsRequestKind)kind + flags:(MCOMessageFlag)flags; + +/** + Returns an operation to change flags of messages, using IMAP sequence number. + + For example: Adds the seen flag to the message with the sequence number number 42. + + MCOIMAPOperation * op = [session storeFlagsOperationWithFolder:@"INBOX" + numbers:[MCOIndexSet indexSetWithIndex:42] + kind:MCOIMAPStoreFlagsRequestKindAdd + flags:MCOMessageFlagSeen]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *) storeFlagsOperationWithFolder:(NSString *)folder + numbers:(MCOIndexSet *)numbers + kind:(MCOIMAPStoreFlagsRequestKind)kind + flags:(MCOMessageFlag)flags; + +/** + Returns an operation to change flags and custom flags of messages. + + For example: Adds the seen flag and $CNS-Greeting-On flag to the message with UID 456. + + MCOIMAPOperation * op = [session storeFlagsOperationWithFolder:@"INBOX" + uids:[MCOIndexSet indexSetWithIndex:456] + kind:MCOIMAPStoreFlagsRequestKindAdd + flags:MCOMessageFlagSeen + customFlags:@["$CNS-Greeting-On"]]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *) storeFlagsOperationWithFolder:(NSString *)folder + uids:(MCOIndexSet *)uids + kind:(MCOIMAPStoreFlagsRequestKind)kind + flags:(MCOMessageFlag)flags + customFlags:(NSArray *)customFlags; + + +/** + Returns an operation to change flags and custom flags of messages, using IMAP sequence number. + + For example: Adds the seen flag and $CNS-Greeting-On flag to the message with the sequence number 42. + + MCOIMAPOperation * op = [session storeFlagsOperationWithFolder:@"INBOX" + numbers:[MCOIndexSet indexSetWithIndex:42] + kind:MCOIMAPStoreFlagsRequestKindAdd + flags:MCOMessageFlagSeen + customFlags:@["$CNS-Greeting-On"]]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *) storeFlagsOperationWithFolder:(NSString *)folder + numbers:(MCOIndexSet *)numbers + kind:(MCOIMAPStoreFlagsRequestKind)kind + flags:(MCOMessageFlag)flags + customFlags:(NSArray *)customFlags; + +/** + Returns an operation to change labels of messages. Intended for Gmail + + For example: Adds the label "Home" flag to the message with UID 42. + + MCOIMAPOperation * op = [session storeLabelsOperationWithFolder:@"INBOX" + numbers:[MCOIndexSet indexSetWithIndex:42] + kind:MCOIMAPStoreFlagsRequestKindAdd + labels:[NSArray arrayWithObject:@"Home"]]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPOperation *) storeLabelsOperationWithFolder:(NSString *)folder + numbers:(MCOIndexSet *)numbers + kind:(MCOIMAPStoreFlagsRequestKind)kind + labels:(NSArray *)labels; + +/** + Returns an operation to change labels of messages. Intended for Gmail + + For example: Adds the label "Home" flag to the message with UID 456. + + MCOIMAPOperation * op = [session storeLabelsOperationWithFolder:@"INBOX" + uids:[MCOIndexSet indexSetWithIndex:456] + kind:MCOIMAPStoreFlagsRequestKindAdd + labels:[NSArray arrayWithObject:@"Home"]]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPOperation *) storeLabelsOperationWithFolder:(NSString *)folder + uids:(MCOIndexSet *)uids + kind:(MCOIMAPStoreFlagsRequestKind)kind + labels:(NSArray *)labels; + +/** @name Fetching Messages */ + +/** + Returns an operation to fetch messages by UID. + + MCOIMAPFetchMessagesOperation * op = [session fetchMessagesByUIDOperationWithFolder:@"INBOX" + requestKind:MCOIMAPMessagesRequestKindHeaders | MCOIMAPMessagesRequestKindStructure + uids:MCORangeMake(1, UINT64_MAX)]; + [op start:^(NSError * error, NSArray * messages, MCOIndexSet * vanishedMessages) { + for(MCOIMAPMessage * msg in messages) { + NSLog(@"%lu: %@", [msg uid], [msg header]); + } + }]; +*/ +- (MCOIMAPFetchMessagesOperation *) fetchMessagesByUIDOperationWithFolder:(NSString *)folder + requestKind:(MCOIMAPMessagesRequestKind)requestKind + uids:(MCOIndexSet *)uids DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to fetch messages by UID. + + MCOIMAPFetchMessagesOperation * op = [session fetchMessagesOperationWithFolder:@"INBOX" + requestKind:MCOIMAPMessagesRequestKindHeaders | MCOIMAPMessagesRequestKindStructure + uids:MCORangeMake(1, UINT64_MAX)]; + [op start:^(NSError * error, NSArray * messages, MCOIndexSet * vanishedMessages) { + for(MCOIMAPMessage * msg in messages) { + NSLog(@"%lu: %@", [msg uid], [msg header]); + } + }]; +*/ +- (MCOIMAPFetchMessagesOperation *) fetchMessagesOperationWithFolder:(NSString *)folder + requestKind:(MCOIMAPMessagesRequestKind)requestKind + uids:(MCOIndexSet *)uids; + +/** + Returns an operation to fetch messages by (sequence) number. + For example: show 50 most recent uids. + NSString *folder = @"INBOX"; + MCOIMAPFolderInfoOperation *folderInfo = [session folderInfoOperation:folder]; + + [folderInfo start:^(NSError *error, MCOIMAPFolderInfo *info) { + int numberOfMessages = 50; + numberOfMessages -= 1; + MCOIndexSet *numbers = [MCOIndexSet indexSetWithRange:MCORangeMake([info messageCount] - numberOfMessages, numberOfMessages)]; + + MCOIMAPFetchMessagesOperation *fetchOperation = [session fetchMessagesByNumberOperationWithFolder:folder + requestKind:MCOIMAPMessagesRequestKindUid + numbers:numbers]; + + [fetchOperation start:^(NSError *error, NSArray *messages, MCOIndexSet *vanishedMessages) { + for (MCOIMAPMessage * message in messages) { + NSLog(@"%u", [message uid]); + } + }]; + }]; +*/ +- (MCOIMAPFetchMessagesOperation *) fetchMessagesByNumberOperationWithFolder:(NSString *)folder + requestKind:(MCOIMAPMessagesRequestKind)requestKind + numbers:(MCOIndexSet *)numbers; + +/** + Returns an operation to sync the last changes related to the given message list given a modSeq. + + MCOIMAPFetchMessagesOperation * op = [session syncMessagesByUIDWithFolder:@"INBOX" + requestKind:MCOIMAPMessagesRequestKindUID + uids:MCORangeMake(1, UINT64_MAX) + modSeq:lastModSeq]; + [op start:^(NSError * error, NSArray * messages, MCOIndexSet * vanishedMessages) { + NSLog(@"added or modified messages: %@", messages); + NSLog(@"deleted messages: %@", vanishedMessages); + }]; + +@warn *Important*: This is only for servers that support Conditional Store. See [RFC4551](http://tools.ietf.org/html/rfc4551) +vanishedMessages will be set only for servers that support QRESYNC. See [RFC5162](http://tools.ietf.org/html/rfc5162) +*/ +- (MCOIMAPFetchMessagesOperation *) syncMessagesByUIDWithFolder:(NSString *)folder + requestKind:(MCOIMAPMessagesRequestKind)requestKind + uids:(MCOIndexSet *)uids + modSeq:(uint64_t)modSeq DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to sync the last changes related to the given message list given a modSeq. + + MCOIMAPFetchMessagesOperation * op = [session syncMessagesWithFolder:@"INBOX" + requestKind:MCOIMAPMessagesRequestKindUID + uids:MCORangeMake(1, UINT64_MAX) + modSeq:lastModSeq]; + [op start:^(NSError * error, NSArray * messages, MCOIndexSet * vanishedMessages) { + NSLog(@"added or modified messages: %@", messages); + NSLog(@"deleted messages: %@", vanishedMessages); + }]; + +@warn *Important*: This is only for servers that support Conditional Store. See [RFC4551](http://tools.ietf.org/html/rfc4551) +vanishedMessages will be set only for servers that support QRESYNC. See [RFC5162](http://tools.ietf.org/html/rfc5162) +*/ +- (MCOIMAPFetchMessagesOperation *) syncMessagesWithFolder:(NSString *)folder + requestKind:(MCOIMAPMessagesRequestKind)requestKind + uids:(MCOIndexSet *)uids + modSeq:(uint64_t)modSeq; + +/** + Returns an operation to fetch the content of a message. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageByUIDOperationWithFolder:@"INBOX" uid:456 urgent:NO]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageByUIDOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + urgent:(BOOL)urgent DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to fetch the content of a message. + + MCOIMAPFetchContentOperation * op = [session fetchMessageByUIDOperationWithFolder:@"INBOX" uid:456]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageByUIDOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to fetch the content of a message. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageOperationWithFolder:@"INBOX" uid:456 urgent:NO]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; + */ +- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch the content of a message. + + MCOIMAPFetchContentOperation * op = [session fetchMessageOperationWithFolder:@"INBOX" uid:456]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; + */ +- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid; + +/** + Returns an operation to fetch the content of a message, using IMAP sequence number. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageOperationWithFolder:@"INBOX" number:42 urgent:NO]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder + number:(uint32_t)number + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch the content of a message, using IMAP sequence number. + + MCOIMAPFetchContentOperation * op = [session fetchMessageOperationWithFolder:@"INBOX" number:42]; + [op start:^(NSError * error, NSData * messageData) { + MCOMessageParser * parser = [MCOMessageParser messageParserWithData:messageData] + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder + number:(uint32_t)number; + +/** + Returns an operation to fetch the parsed content of a message. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchParsedContentOperation * op = [session fetchParsedMessageOperationWithFolder:@"INBOX" uid:456 urgent:NO]; + [op start:^(NSError * error, MCOMessageParser * parser) { + + ... + }]; + */ +- (MCOIMAPFetchParsedContentOperation *) fetchParsedMessageOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch the parsed content of a message. + + MCOIMAPFetchParsedContentOperation * op = [session fetchParsedMessageOperationWithFolder:@"INBOX" uid:456]; + [op start:^(NSError * error, MCOMessageParser * parser) { + + ... + }]; + */ +- (MCOIMAPFetchParsedContentOperation *) fetchParsedMessageOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid; + +/** + Returns an operation to fetch the parsed content of a message, using IMAP sequence number. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchParsedContentOperation * op = [session fetchParsedMessageOperationWithFolder:@"INBOX" number:42 urgent:NO]; + [op start:^(NSError * error, MCOMessageParser * parser) { + + ... + }]; + */ +- (MCOIMAPFetchParsedContentOperation *) fetchParsedMessageOperationWithFolder:(NSString *)folder + number:(uint32_t)number + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch the parsed content of a message, using IMAP sequence number. + + MCOIMAPFetchParsedContentOperation * op = [session fetchParsedMessageOperationWithFolder:@"INBOX" number:42]; + [op start:^(NSError * error, MCOMessageParser * parser) { + + ... + }]; + */ +- (MCOIMAPFetchParsedContentOperation *) fetchParsedMessageOperationWithFolder:(NSString *)folder + number:(uint32_t)number; + +/** @name Fetching Attachment Operations */ + +/** + Returns an operation to fetch an attachment. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentByUIDOperationWithFolder:@"INBOX" + uid:456 + partID:@"1.2" + encoding:MCOEncodingBase64 + urgent:YES]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentByUIDOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + partID:(NSString *)partID + encoding:(MCOEncoding)encoding + urgent:(BOOL)urgent DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to fetch an attachment. + + Example 1: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentByUIDOperationWithFolder:@"INBOX" + uid:456 + partID:@"1.2" + encoding:MCOEncodingBase64]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; + + Example 2: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentByUIDOperationWithFolder:@"INBOX" + uid:[message uid] + partID:[part partID] + encoding:[part encoding]]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentByUIDOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + partID:(NSString *)partID + encoding:(MCOEncoding)encoding DEPRECATED_ATTRIBUTE; + +/** + Returns an operation to fetch an attachment. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + uid:456 + partID:@"1.2" + encoding:MCOEncodingBase64 + urgent:YES]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + partID:(NSString *)partID + encoding:(MCOEncoding)encoding + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch an attachment. + + Example 1: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + uid:456 + partID:@"1.2" + encoding:MCOEncodingBase64]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; + + Example 2: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + uid:[message uid] + partID:[part partID] + encoding:[part encoding]]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentOperationWithFolder:(NSString *)folder + uid:(uint32_t)uid + partID:(NSString *)partID + encoding:(MCOEncoding)encoding; + +/** + Returns an operation to fetch an attachment. + @param urgent is set to YES, an additional connection to the same folder might be opened to fetch the content. + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + uid:456 + partID:@"1.2" + encoding:MCOEncodingBase64 + urgent:YES]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentOperationWithFolder:(NSString *)folder + number:(uint32_t)number + partID:(NSString *)partID + encoding:(MCOEncoding)encoding + urgent:(BOOL)urgent; + +/** + Returns an operation to fetch an attachment. + + Example 1: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + number:42 + partID:@"1.2" + encoding:MCOEncodingBase64]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; + + Example 2: + + MCOIMAPFetchContentOperation * op = [session fetchMessageAttachmentOperationWithFolder:@"INBOX" + number:[message sequenceNumber] + partID:[part partID] + encoding:[part encoding]]; + [op start:^(NSError * error, NSData * partData) { + ... + }]; +*/ +- (MCOIMAPFetchContentOperation *) fetchMessageAttachmentOperationWithFolder:(NSString *)folder + number:(uint32_t)number + partID:(NSString *)partID + encoding:(MCOEncoding)encoding; + +/** @name General IMAP Actions */ + +/** + Returns an operation to wait for something to happen in the folder. + See [RFC2177](http://tools.ietf.org/html/rfc2177) for me info. + + MCOIMAPIdleOperation * op = [session idleOperationWithFolder:@"INBOX" + lastKnownUID:0]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOIMAPIdleOperation *) idleOperationWithFolder:(NSString *)folder + lastKnownUID:(uint32_t)lastKnownUID; + +/** + Returns an operation to fetch the list of namespaces. + + MCOIMAPFetchNamespaceOperation * op = [session fetchNamespaceOperation]; + [op start:^(NSError * error, NSDictionary * namespaces) { + if (error != nil) + return; + MCOIMAPNamespace * ns = [namespace objectForKey:MCOIMAPNamespacePersonal]; + NSString * path = [ns pathForComponents:[NSArray arrayWithObject:]]; + MCOIMAPOperation * createOp = [session createFolderOperation:foobar]; + [createOp start:^(NSError * error) { + ... + }]; + }]; +*/ +- (MCOIMAPFetchNamespaceOperation *) fetchNamespaceOperation; + +/** + Returns an operation to send the client or get the server identity. + + MCOIMAPIdentity * identity = [MCOIMAPIdentity identityWithVendor:@"Mozilla" name:@"Thunderbird" version:@"17.0.5"]; + MCOIMAPIdentityOperation * op = [session identityOperationWithClientIdentity:identity]; + [op start:^(NSError * error, NSDictionary * serverIdentity) { + ... + }]; +*/ +- (MCOIMAPIdentityOperation *) identityOperationWithClientIdentity:(MCOIMAPIdentity *)identity; + +/** + Returns an operation that will connect to the given IMAP server without authenticating. + Useful for checking initial server capabilities. + + MCOIMAPOperation * op = [session connectOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *)connectOperation; + +/** + Returns an operation that will perform a No-Op operation on the given IMAP server. + + MCOIMAPOperation * op = [session noopOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *) noopOperation; + +/** + Returns an operation that will check whether the IMAP account is valid. + + MCOIMAPOperation * op = [session checkAccountOperation]; + [op start:^(NSError * error) { + ... + }]; +*/ + +- (MCOIMAPOperation *) checkAccountOperation; + +/** + Returns an operation to request capabilities of the server. + See MCOIMAPCapability for the list of capabilities. + + canIdle = NO; + MCOIMAPCapabilityOperation * op = [session capabilityOperation]; + [op start:^(NSError * error, MCOIndexSet * capabilities) { + if ([capabilities containsIndex:MCOIMAPCapabilityIdle]) { + canIdle = YES; + } + }]; +*/ +- (MCOIMAPCapabilityOperation *) capabilityOperation; + +- (MCOIMAPQuotaOperation *) quotaOperation; + +/** @name Search Operations */ + +/** + Returns an operation to search for messages with a simple match. + + MCOIMAPSearchOperation * op = [session searchOperationWithFolder:@"INBOX" + kind:MCOIMAPSearchKindFrom + searchString:@"laura"]; + [op start:^(NSError * error, MCOIndexSet * searchResult) { + ... + }]; +*/ +- (MCOIMAPSearchOperation *) searchOperationWithFolder:(NSString *)folder + kind:(MCOIMAPSearchKind)kind + searchString:(NSString *)searchString; + +/** + Returns an operation to search for messages. + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchFrom:@"laura@etpan.org"] + MCOIMAPSearchOperation * op = [session searchExpressionOperationWithFolder:@"INBOX" + expression:expr]; + [op start:^(NSError * error, MCOIndexSet * searchResult) { + ... + }]; +*/ +- (MCOIMAPSearchOperation *) searchExpressionOperationWithFolder:(NSString *)folder + expression:(MCOIMAPSearchExpression *)expression; + +/** @name Rendering Operations */ + +/** + Returns an operation to render the HTML version of a message to be displayed in a web view. + + MCOIMAPMessageRenderingOperation * op = [session htmlRenderingOperationWithMessage:msg + folder:@"INBOX"]; + + [op start:^(NSString * htmlString, NSError * error) { + ... + }]; +*/ +- (MCOIMAPMessageRenderingOperation *) htmlRenderingOperationWithMessage:(MCOIMAPMessage *)message + folder:(NSString *)folder; + +/** + Returns an operation to render the HTML body of a message to be displayed in a web view. + + MCOIMAPMessageRenderingOperation * op = [session htmlBodyRenderingOperationWithMessage:msg + folder:@"INBOX"]; + + [op start:^(NSString * htmlString, NSError * error) { + ... + }]; + */ +- (MCOIMAPMessageRenderingOperation *) htmlBodyRenderingOperationWithMessage:(MCOIMAPMessage *)message + folder:(NSString *)folder; + +/** + Returns an operation to render the plain text version of a message. + + MCOIMAPMessageRenderingOperation * op = [session plainTextRenderingOperationWithMessage:msg + folder:@"INBOX"]; + + [op start:^(NSString * htmlString, NSError * error) { + ... + }]; + */ +- (MCOIMAPMessageRenderingOperation *) plainTextRenderingOperationWithMessage:(MCOIMAPMessage *)message + folder:(NSString *)folder; + +/** + Returns an operation to render the plain text body of a message. + All end of line will be removed and white spaces cleaned up if requested. + This method can be used to generate the summary of the message. + + MCOIMAPMessageRenderingOperation * op = [session plainTextBodyRenderingOperationWithMessage:msg + folder:@"INBOX" + stripWhitespace:YES]; + + [op start:^(NSString * htmlString, NSError * error) { + ... + }]; + */ +- (MCOIMAPMessageRenderingOperation *) plainTextBodyRenderingOperationWithMessage:(MCOIMAPMessage *)message + folder:(NSString *)folder + stripWhitespace:(BOOL)stripWhitespace; + +/** + Returns an operation to render the plain text body of a message. + All end of line will be removed and white spaces cleaned up. + This method can be used to generate the summary of the message. + + MCOIMAPMessageRenderingOperation * op = [session plainTextBodyRenderingOperationWithMessage:msg + folder:@"INBOX"]; + + [op start:^(NSString * htmlString, NSError * error) { + ... + }]; + */ +- (MCOIMAPMessageRenderingOperation *) plainTextBodyRenderingOperationWithMessage:(MCOIMAPMessage *)message + folder:(NSString *)folder; + +/** + Returns an operation to disconnect the session. + It will disconnect all the sockets created by the session. + + MCOIMAPOperation * op = [session disconnectOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOIMAPOperation *) disconnectOperation; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOIndexSet.h b/MailCore.framework/Headers/MCOIndexSet.h new file mode 100644 index 000000000..3705fa3a3 --- /dev/null +++ b/MailCore.framework/Headers/MCOIndexSet.h @@ -0,0 +1,74 @@ +// +// MCOIndexSet.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/23/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOINDEXSET_H + +#define MAILCORE_MCOINDEXSET_H + +#import + +#import + +/** similar to NSMutableIndexSet but supports int64_t. MCORange has a location (uint64_t) and length (uint64_t). */ + +@interface MCOIndexSet : NSObject + +/** Creates an empty index set.*/ ++ (MCOIndexSet *) indexSet; + +/** Creates an index set that contains a range of integers.*/ ++ (MCOIndexSet *) indexSetWithRange:(MCORange)range; + +/** Creates an index set with a single integer.*/ ++ (MCOIndexSet *) indexSetWithIndex:(uint64_t)idx; + +/** Returns the number of integers in that index set.*/ +- (unsigned int) count; + +/** Adds an integer to the index set.*/ +- (void) addIndex:(uint64_t)idx; + +/** Removes an integer from the index set.*/ +- (void) removeIndex:(uint64_t)idx; + +/** Returns YES if the index set contains the given integer.*/ +- (BOOL) containsIndex:(uint64_t)idx; + +/** Adds a range of integers to the index set.*/ +- (void) addRange:(MCORange)range; + +/** Removes a range of integers from the index set.*/ +- (void) removeRange:(MCORange)range; + +/** Removes all integers that are not in the given range.*/ +- (void) intersectsRange:(MCORange)range; + +/** Adds all indexes from an other index set to the index set.*/ +- (void) addIndexSet:(MCOIndexSet *)indexSet; + +/** Remove all indexes from an other index set from the index set.*/ +- (void) removeIndexSet:(MCOIndexSet *)indexSet; + +/** Removes all integers that are not in the given index set.*/ +- (void) intersectsIndexSet:(MCOIndexSet *)indexSet; + +/** Returns all the ranges of ths index set.*/ +- (MCORange *) allRanges; + +/** Returns the number of ranges in this index set.*/ +- (unsigned int) rangesCount; + +/** Enumerates all the indexes of the index set.*/ +- (void) enumerateIndexes:(void (^)(uint64_t idx))block; + +/** Returns an NSIndexSet from a MCOIndexSet */ +- (NSIndexSet *) nsIndexSet; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOMailProvider.h b/MailCore.framework/Headers/MCOMailProvider.h new file mode 100644 index 000000000..85a23a8de --- /dev/null +++ b/MailCore.framework/Headers/MCOMailProvider.h @@ -0,0 +1,86 @@ +// +// MCOMailProvider.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import + +/** + Represents a email service provider, like for example Gmail, Yahoo, Fastmail.fm etc. +*/ + +@interface MCOMailProvider : NSObject + +@property (nonatomic, copy) NSString * identifier; + +- (id) initWithInfo:(NSDictionary *)info; + +/** + A list of ways that you can connect to the IMAP server + @return An array of MCONetService +*/ +- (NSArray * /* MCONetService */) imapServices; + +/** + A list of ways that you can connect to the SMTP server + @return An array of MCONetService +*/ +- (NSArray * /* MCONetService */) smtpServices; + +/** + A list of ways that you can connect to the POP3 server + @return An array of MCONetService +*/ +- (NSArray * /* MCONetService */) popServices; + +- (BOOL) matchEmail:(NSString *)email; +- (BOOL) matchMX:(NSString *)hostname; + +/** + Where sent mail is stored on the IMAP server + @return Returns nil if it is unknown +*/ +- (NSString *) sentMailFolderPath; + +/** + Where starred mail is stored on the IMAP server. + This only applies to some servers like Gmail + @return Returns nil if it is unknown +*/ +- (NSString *) starredFolderPath; + +/** + Where all mail or the archive folder is stored on the IMAP server + @return Returns nil if it is unknown +*/ +- (NSString *) allMailFolderPath; + +/** + Where trash is stored on the IMAP server + @return Returns nil if it is unknown +*/ +- (NSString *) trashFolderPath; + +/** + Where draft messages are stored on the IMAP server + @return Returns nil if it is unknown +*/ +- (NSString *) draftsFolderPath; + +/** + Where spam messages are stored on the IMAP server + @return Returns nil if it is unknown +*/ +- (NSString *) spamFolderPath; + +/** + Where important messages are stored on the IMAP server + This only applies to some servers, like Gmail + @return Returns nil if it is unknown +*/ +- (NSString *) importantFolderPath; + +@end diff --git a/MailCore.framework/Headers/MCOMailProvidersManager.h b/MailCore.framework/Headers/MCOMailProvidersManager.h new file mode 100644 index 000000000..09df25ad9 --- /dev/null +++ b/MailCore.framework/Headers/MCOMailProvidersManager.h @@ -0,0 +1,51 @@ +// +// MCOMailProvidersManager.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import + +/** + This class is used to detect an email provider and it's associated + metadata either by MX record or by the email addresss. + + An app might want to use this during setup to limit the number of settings + a user has to input. +*/ + +@class MCOMailProvider; + +@interface MCOMailProvidersManager : NSObject + +/** The shared manager that is used for all lookups */ ++ (MCOMailProvidersManager *) sharedManager; + +/** + Given an email address will try to determine the provider + @return The email provider info or nil if it can't be determined. +*/ +- (MCOMailProvider *) providerForEmail:(NSString *)email; + +/** + Given the DNS MX record will try to determine the provider + @return The email provider info or nil if it can't be determined. +*/ +- (MCOMailProvider *) providerForMX:(NSString *)hostname; + +/** + Will return information about a provider. Useful if you already know the + provider (like if it has been determined previously) + @return The email provider info or nil if none matches +*/ +- (MCOMailProvider *) providerForIdentifier:(NSString *)identifier; + +/** + Registers the providers in the JSON file at the file path so they + can be used with MCOMailProvidersManager. + */ +- (void) registerProvidersWithFilename:(NSString *)filename; + +@end diff --git a/MailCore.framework/Headers/MCOMessageBuilder.h b/MailCore.framework/Headers/MCOMessageBuilder.h new file mode 100644 index 000000000..1663d6f7f --- /dev/null +++ b/MailCore.framework/Headers/MCOMessageBuilder.h @@ -0,0 +1,98 @@ +// +// MCOMessageBuilder.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOMESSAGEBUILDER_H + +#define MAILCORE_MCOMESSAGEBUILDER_H + +#import + +/** + This class will allow you to build a RFC 822 formatted message. + For example when you need to send a message using SMTP, + you need to generate first a RFC 822 formatted message. + This class will help you do that. + + MCOMessageBuilder * builder = [[MCOMessageBuilder alloc] init]; + [[builder header] setFrom:[MCOAddress addressWithDisplayName:@"Hoa V. DINH" mailbox:@"hoa@etpan.org"]; + NSArray * to = [NSArray arrayWithObject:[MCOAddress addressWithDisplayName:@"Gael Roualland" mailbox:@"gael@etpan.org"]]; + [[builder header] setTo:to]; + [[builder header] setSubject:@"A nice picture!"]; + [builder setHTMLBody:@"
Here's the message I need to send.
"]; + [builder addAttachment:[MCOAttachment attachmentWithContentsOfFile:@"/Users/foo/Pictures/image.jpg"]]; + NSData * rfc822Data = [builder data]; + +*/ + +@class MCOAttachment; +@protocol MCOHTMLRendererDelegate; + +@interface MCOMessageBuilder : MCOAbstractMessage + +/** Main HTML content of the message.*/ +@property (nonatomic, copy, setter=setHTMLBody:) NSString * htmlBody; + +/** Plain text content of the message.*/ +@property (nonatomic, copy) NSString * textBody; + +/** List of file attachments.*/ +@property (nonatomic, copy) NSArray * /* MCOAttachment */ attachments; + +/** List of related file attachments (included as cid: link in the HTML part).*/ +@property (nonatomic, copy) NSArray * /* MCOAttachment */ relatedAttachments; + +/** Prefix for the boundary identifier. Default value is nil.*/ +@property (nonatomic, copy) NSString * boundaryPrefix; + +/** Add an attachment.*/ +- (void) addAttachment:(MCOAttachment *)attachment; + +/** Add a related attachment.*/ +- (void) addRelatedAttachment:(MCOAttachment *)attachment; + +/** RFC 822 formatted message.*/ +- (NSData *) data; + +/** RFC 822 formatted message for encryption.*/ +- (NSData *) dataForEncryption; + +/** + Returns an OpenPGP signed message with a given signature. + The signature needs to be computed on the data returned by -dataForEncryption + before calling this method. + You could use http://www.netpgp.com to generate it. + */ +- (NSData *) openPGPSignedMessageDataWithSignatureData:(NSData *)signature; + +/** + Returns an OpenPGP encrypted message with a given encrypted data. + The encrypted data needs to be computed before calling this method. + You could use http://www.netpgp.com to generate it. + */ +- (NSData *) openPGPEncryptedMessageDataWithEncryptedData:(NSData *)encryptedData; + +/** HTML rendering of the message to be displayed in a web view. The delegate can be nil.*/ +- (NSString *) htmlRenderingWithDelegate:(id )delegate; + +/** HTML rendering of the body of the message to be displayed in a web view.*/ +- (NSString *) htmlBodyRendering; + +/** Text rendering of the message.*/ +- (NSString *) plainTextRendering; + +/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up. + This method can be used to generate the summary of the message.*/ +- (NSString *) plainTextBodyRendering; + +/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up if requested. + This method can be used to generate the summary of the message.*/ +- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOMessageHeader.h b/MailCore.framework/Headers/MCOMessageHeader.h new file mode 100644 index 000000000..4f9a9cdac --- /dev/null +++ b/MailCore.framework/Headers/MCOMessageHeader.h @@ -0,0 +1,101 @@ +// +// MCOMessageHeader.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOMESSAGEHEADER_H + +#define MAILCORE_MCOMESSAGEHEADER_H + +#import + +/** This class implements common fields of a message header.*/ + +@class MCOAddress; + +@interface MCOMessageHeader : NSObject + +/** Message-ID field.*/ +@property (nonatomic, copy) NSString * messageID; + +/** Message-ID auto-generated flag.*/ +@property (nonatomic, readonly, getter=isMessageIDAutoGenerated) BOOL messageIDAutoGenerated; + +/** References field. It's an array of message-ids.*/ +@property (nonatomic, copy) NSArray * /* NSString */ references; + +/** In-Reply-To field. It's an array of message-ids.*/ +@property (nonatomic, copy) NSArray * /* NSString */ inReplyTo; + +/** Date field: sent date of the message.*/ +@property (nonatomic, strong) NSDate * date; + +/** Received date: received date of the message.*/ +@property (nonatomic, strong) NSDate * receivedDate; + +/** Sender field.*/ +@property (nonatomic, copy) MCOAddress * sender; + +/** From field: address of the sender of the message.*/ +@property (nonatomic, copy) MCOAddress * from; + +/** To field: recipient of the message. It's an array of MCOAddress.*/ +@property (nonatomic, copy) NSArray * /* MCOAddress */ to; + +/** Cc field: cc recipient of the message. It's an array of MCOAddress.*/ +@property (nonatomic, copy) NSArray * /* MCOAddress */ cc; + +/** Bcc field: bcc recipient of the message. It's an array of MCOAddress.*/ +@property (nonatomic, copy) NSArray * /* MCOAddress */ bcc; + +/** Reply-To field. It's an array of MCOAddress.*/ +@property (nonatomic, copy) NSArray * /* MCOAddress */ replyTo; + +/** Subject of the message.*/ +@property (nonatomic, copy) NSString * subject; + +/** Email user agent name: X-Mailer header.*/ +@property (nonatomic, copy) NSString * userAgent; + +/** Returns a header created from RFC 822 data.*/ ++ (MCOMessageHeader *) headerWithData:(NSData *)data; + +/** Initialize a header with RFC 822 data.*/ +- (id) initWithData:(NSData *)data; + +/** Adds a custom header.*/ +- (void) setExtraHeaderValue:(NSString *)value forName:(NSString *)name; + +/** Remove a given custom header.*/ +- (void) removeExtraHeaderForName:(NSString *)name; + +/** Returns the value of a given custom header.*/ +- (NSString *) extraHeaderValueForName:(NSString *)name; + +/** Returns an array with the names of all custom headers.*/ +- (NSArray * /* NSString */) allExtraHeadersNames; + +/** Extracted subject (also remove square brackets).*/ +- (NSString *) extractedSubject; + +/** Extracted subject (don't remove square brackets).*/ +- (NSString *) partialExtractedSubject; + +/** Fill the header using the given RFC 822 data.*/ +- (void) importHeadersData:(NSData *)data; + +/** Returns a header that can be used as a base for a reply message.*/ +- (MCOMessageHeader *) replyHeaderWithExcludedRecipients:(NSArray * /* MCOAddress */)excludedRecipients; + +/** Returns a header that can be used as a base for a reply all message.*/ +- (MCOMessageHeader *) replyAllHeaderWithExcludedRecipients:(NSArray * /* MCOAddress */)excludedRecipients; + +/** Returns a header that can be used as a base for a forward message.*/ +- (MCOMessageHeader *) forwardHeader; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOMessageParser.h b/MailCore.framework/Headers/MCOMessageParser.h new file mode 100644 index 000000000..6bbed0be9 --- /dev/null +++ b/MailCore.framework/Headers/MCOMessageParser.h @@ -0,0 +1,57 @@ +// +// MCOMessageParser.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOMESSAGEPARSER_H + +#define MAILCORE_MCOMESSAGEPARSER_H + +/** + This class implements a parsed message. + When the full content of a message has been fetched using POP or IMAP, + you need to parse it. +*/ + +#import + +@protocol MCOHTMLRendererDelegate; + +@interface MCOMessageParser : MCOAbstractMessage + +/** returns a parsed message from the given RFC 822 data.*/ ++ (MCOMessageParser *) messageParserWithData:(NSData *)data; + +/** data is the RFC 822 formatted message.*/ +- (id) initWithData:(NSData *)data; +- (void) dealloc; + +/** It's the main part of the message. It can be MCOMessagePart, MCOMultipart or MCOAttachment.*/ +- (MCOAbstractPart *) mainPart; + +/** data of the RFC 822 formatted message. It's the input of the parser.*/ +- (NSData *) data; + +/** HTML rendering of the message to be displayed in a web view. delegate can be nil.*/ +- (NSString *) htmlRenderingWithDelegate:(id )delegate; + +/** HTML rendering of the body of the message to be displayed in a web view.*/ +- (NSString *) htmlBodyRendering; + +/** Text rendering of the message.*/ +- (NSString *) plainTextRendering; + +/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up. + This method can be used to generate the summary of the message.*/ +- (NSString *) plainTextBodyRendering; + +/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up if requested. + This method can be used to generate the summary of the message.*/ +- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOMessagePart.h b/MailCore.framework/Headers/MCOMessagePart.h new file mode 100644 index 000000000..5098e35f0 --- /dev/null +++ b/MailCore.framework/Headers/MCOMessagePart.h @@ -0,0 +1,21 @@ +// +// MessagePart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOMESSAGEPART_H + +#define MAILCORE_MCOMESSAGEPART_H + +#import + +/** Message part parsed from RFC 822 message data. */ + +@interface MCOMessagePart : MCOAbstractMessagePart + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOMultipart.h b/MailCore.framework/Headers/MCOMultipart.h new file mode 100644 index 000000000..1b97a13f2 --- /dev/null +++ b/MailCore.framework/Headers/MCOMultipart.h @@ -0,0 +1,21 @@ +// +// MCOMultipart.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOMULTIPART_H + +#define MAILCORE_MCOMULTIPART_H + +#import + +/** Multipart parsed from RFC 822 message data. */ + +@interface MCOMultipart : MCOAbstractMultipart + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTP.h b/MailCore.framework/Headers/MCONNTP.h new file mode 100644 index 000000000..71979dfa7 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTP.h @@ -0,0 +1,23 @@ +// +// MCONNTP.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTP_H + +#define MAILCORE_MCONNTP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCONNTPDisconnectOperation.h b/MailCore.framework/Headers/MCONNTPDisconnectOperation.h new file mode 100644 index 000000000..7d8986bb6 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPDisconnectOperation.h @@ -0,0 +1,21 @@ +// +// MCONNTPDisconnectOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPDICONNECTOPERATION_H + +#define MAILCORE_MCONNTPDICONNECTOPERATION_H + +#import +#import + +/* The class is used to perform a disconnect operation. */ +@interface MCONNTPDisconnectOperation : NSObject + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPFetchAllArticlesOperation.h b/MailCore.framework/Headers/MCONNTPFetchAllArticlesOperation.h new file mode 100644 index 000000000..34ccee7e3 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPFetchAllArticlesOperation.h @@ -0,0 +1,35 @@ +// +// MCONNTPFetchAllArticlesOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPFETCHARTICLESOPERATION_H + +#define MAILCORE_MCONNTPFETCHARTICLESOPERATION_H + +#import +#import + +@class MCOIndexSet; + +/** This is an asynchronous operation that will fetch the list of a messages on the NNTP server. */ +@interface MCONNTPFetchAllArticlesOperation : MCONNTPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `articles` will be an index set of article numbers. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `messages` will be null + */ +- (void) start:(void (^)(NSError * error, MCOIndexSet * articles))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPFetchArticleOperation.h b/MailCore.framework/Headers/MCONNTPFetchArticleOperation.h new file mode 100644 index 000000000..b8bffcb06 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPFetchArticleOperation.h @@ -0,0 +1,39 @@ +// +// MCONNTPFetchArticleOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPFETCHARTICLEOPERATION_H + +#define MAILCORE_MCONNTPFETCHARTICLEOPERATION_H + +#import +#import + +/** Fetch a message from NNTP3 */ + +typedef void (^MCONNTPOperationProgressBlock)(unsigned int current, unsigned int maximum); + +@interface MCONNTPFetchArticleOperation : MCONNTPOperation + +/** This block will be called as data is downloaded from the network */ +@property (nonatomic, copy) MCONNTPOperationProgressBlock progress; + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `data` will contain the message data + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `data` will be nil + */ +- (void) start:(void (^)(NSError * error, NSData * messageData))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPFetchHeaderOperation.h b/MailCore.framework/Headers/MCONNTPFetchHeaderOperation.h new file mode 100644 index 000000000..63ce7677a --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPFetchHeaderOperation.h @@ -0,0 +1,39 @@ +// +// MCONNTPFetchHeaderOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPFETCHHEADEROPERATION_H + +#define MAILCORE_MCONNTPFETCHHEADEROPERATION_H + +#import +#import + +/** + This is an asynchronous operation that will fetch the header of a message. + @See MCONNTPSession + */ + +@class MCOMessageHeader; + +@interface MCONNTPFetchHeaderOperation : MCONNTPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `header` will contain the message header + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `header` will be null + */ +- (void) start:(void (^)(NSError * error, MCOMessageHeader * header))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPFetchOverviewOperation.h b/MailCore.framework/Headers/MCONNTPFetchOverviewOperation.h new file mode 100644 index 000000000..d63668e82 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPFetchOverviewOperation.h @@ -0,0 +1,32 @@ +// +// MCONNTPFetchOverviewOperation.h +// mailcore2 +// +// Created by Robert Widmann on 10/21/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPFETCHOVERVIEWOPERATION_H + +#define MAILCORE_MCONNTPFETCHOVERVIEWOPERATION_H + +#import +#import + +@interface MCONNTPFetchOverviewOperation : MCONNTPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `messages` will be an array of MCOMessageHeaders + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `messages` will be null + */ +- (void) start:(void (^)(NSError * error, NSArray * /* MCOMessageHeader */ messages))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPFetchServerTimeOperation.h b/MailCore.framework/Headers/MCONNTPFetchServerTimeOperation.h new file mode 100644 index 000000000..a06dd7468 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPFetchServerTimeOperation.h @@ -0,0 +1,35 @@ +// +// MCONNTPFetchServerTimeOperation.h +// mailcore2 +// +// Created by Robert Widmann on 10/21/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPFETCHSERVERTIMEOPERATION_H + +#define MAILCORE_MCONNTPFETCHSERVERTIMEOPERATION_H + +#import +#import + +@class MCOIndexSet; + +/** This is an asynchronous operation that will fetch the list of a messages on the NNTP server. */ +@interface MCONNTPFetchServerTimeOperation : MCONNTPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `date` will be the server's date and time as an NSDate. + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `messages` will be null + */ +- (void) start:(void (^)(NSError * error, NSDate * date))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPGroupInfo.h b/MailCore.framework/Headers/MCONNTPGroupInfo.h new file mode 100644 index 000000000..e34445a9e --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPGroupInfo.h @@ -0,0 +1,27 @@ +// +// MCONNTPGroupInfo.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPGROUPINFO_H + +#define MAILCORE_MCONNTPGROUPINFO_H + +#import + +/** This is information of a message fetched by MCONNTPListNewsgroupsOperation.*/ + +@interface MCONNTPGroupInfo : NSObject + +/** The name of the news group. */ +@property (nonatomic, copy) NSString *name; + +/** The number of messages in the news group. */ +@property (nonatomic, assign) unsigned int messageCount; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPListNewsgroupsOperation.h b/MailCore.framework/Headers/MCONNTPListNewsgroupsOperation.h new file mode 100644 index 000000000..ea702b755 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPListNewsgroupsOperation.h @@ -0,0 +1,32 @@ +// +// MCONNTPListNewsgroupsOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPLISTNEWSGROUPSOPERATION_H + +#define MAILCORE_MCONNTPLISTNEWSGROUPSOPERATION_H + +#import +#import + +@interface MCONNTPListNewsgroupsOperation : MCONNTPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `messages` will be an array of MCONNTPGroupInfo + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `messages` will be null + */ +- (void) start:(void (^)(NSError * error, NSArray * /* MCONNTPGroupInfo */ messages))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPOperation.h b/MailCore.framework/Headers/MCONNTPOperation.h new file mode 100644 index 000000000..9d4e2fcff --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPOperation.h @@ -0,0 +1,37 @@ +// +// MCONNTPOperation.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCONNTPOPERATION_H + +#define MAILCORE_MCONNTPOPERATION_H + +#import +#import + +/** + This is a generic asynchronous NNTP3 operation. + @see MCONNTPSession + */ + +@interface MCONNTPOperation : MCOOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, + */ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONNTPSession.h b/MailCore.framework/Headers/MCONNTPSession.h new file mode 100644 index 000000000..083d973b2 --- /dev/null +++ b/MailCore.framework/Headers/MCONNTPSession.h @@ -0,0 +1,197 @@ +// +// MCONNTPSession.h +// mailcore2 +// +// Created by Robert Widmann on 8/13/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#import + +#ifndef MAILCORE_MCONNTPSESSION_H + +#define MAILCORE_MCONNTPSESSION_H + +#import + +#import + +@class MCONNTPFetchAllArticlesOperation; +@class MCONNTPFetchHeaderOperation; +@class MCONNTPFetchArticleOperation; +@class MCONNTPListNewsgroupsOperation; +@class MCONNTPFetchOverviewOperation; +@class MCONNTPFetchServerTimeOperation; +@class MCONNTPOperation; +@class MCOIndexSet; + +/** This class implements asynchronous access to the NNTP protocol.*/ + +@interface MCONNTPSession : NSObject + +/** This is the hostname of the NNTP server to connect to.*/ +@property (nonatomic, copy) NSString * hostname; + +/** This is the port of the NNTP server to connect to.*/ +@property (nonatomic, assign) unsigned int port; + +/** This is the username of the account.*/ +@property (nonatomic, copy) NSString * username; + +/** This is the password of the account.*/ +@property (nonatomic, copy) NSString * password; + +/** This is the encryption type to use. + See MCOConnectionType for more information.*/ +@property (nonatomic, assign) MCOConnectionType connectionType; + +/** This is the timeout of the connection.*/ +@property (nonatomic, assign) NSTimeInterval timeout; + +/** When set to YES, the connection will fail if the certificate is incorrect.*/ +@property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabled; + +/** + Sets logger callback. The network traffic will be sent to this block. + + [session setConnectionLogger:^(void * connectionID, MCOConnectionLogType type, NSData * data) { + ... + }]; + */ +@property (nonatomic, copy) MCOConnectionLogger connectionLogger; + +/** This property provides some hints to MCONNTPSession about where it's called from. + It will make MCONNTPSession safe. It will also set all the callbacks of operations to run on this given queue. + Defaults to the main queue. + This property should be used only if there's performance issue using MCONNTPSession in the main thread. */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, retain) dispatch_queue_t dispatchQueue; +#else +@property (nonatomic, assign) dispatch_queue_t dispatchQueue; +#endif + +/** + The value will be YES when asynchronous operations are running, else it will return NO. + */ +@property (nonatomic, assign, readonly, getter=isOperationQueueRunning) BOOL operationQueueRunning; + +/** + Sets operation running callback. It will be called when operations start or stop running. + + [session setOperationQueueRunningChangeBlock:^{ + if ([session isOperationQueueRunning]) { + ... + } + else { + ... + } + }]; + */ +@property (nonatomic, copy) MCOOperationQueueRunningChangeBlock operationQueueRunningChangeBlock; + +/** + Cancel all operations + */ +- (void) cancelAllOperations; + +/** @name Operations */ + +/** + Returns an operation that will fetch the list of article numbers. + + MCONNTPFetchAllArticlesOperation * op = [session fetchAllArticlesOperation:@"comp.lang.c"]; + [op start:^(NSError * error, MCOIndexSet * articles) { + }]; + */ +- (MCONNTPFetchAllArticlesOperation *) fetchAllArticlesOperation:(NSString *)group; + +/** + Returns an operation that will fetch the header of the given message. + + MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx inGroup:@"comp.lang.c"]; + [op start:^(NSError * error, MCOMessageHeader * header) { + // header is the parsed header of the message. + }]; + */ +- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)group; + +/** + Returns an operation that will fetch an overview (headers) for a set of messages. + + MCONNTPFetchHeaderOperation * op = [session fetchOverviewOperationWithIndexes:indexes inGroup:@"comp.lang.c"]; + [op start:^(NSError * error, NSArray * headers) { + // headers are the parsed headers of each part of the overview. + }]; + */ +- (MCONNTPFetchOverviewOperation *)fetchOverviewOperationWithIndexes:(MCOIndexSet *)indexes inGroup:(NSString *)group; + +/** + Returns an operation that will fetch the content of the given message. + + MCONNTPFetchArticleOperation * op = [session fetchArticleOperationWithIndex:idx inGroup:@"comp.lang.c"]; + [op start:^(NSError * error, NSData * messageData) { + // messageData is the RFC 822 formatted message data. + }]; + */ +- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group; + +/** + Returns an operation that will fetch the content of a message with the given messageID. + + MCONNTPFetchArticleOperation * op = [session fetchArticleOperationWithMessageID:@"" inGroup:@"comp.lang.c"]; + [op start:^(NSError * error, NSData * messageData) { + // messageData is the RFC 822 formatted message data. + }]; + */ +- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithMessageID:(NSString *)messageID inGroup:(NSString *)group; + +/** + Returns an operation that will fetch the server's date and time. + + MCONNTPFetchArticleOperation * op = [session fetchServerDateOperation]; + [op start:^(NSError * error, NSDate * serverDate) { + }]; + */ +- (MCONNTPFetchServerTimeOperation *) fetchServerDateOperation; + +/** + Returns an operation that will list all available newsgroups. + + MCONNTPListNewsgroupsOperation * op = [session listAllNewsgroupsOperation]; + [op start:^(NSError * error, NSArray * subscribedGroups) { + }]; + */ +- (MCONNTPListNewsgroupsOperation *) listAllNewsgroupsOperation; + +/** + Returns an operation that will list server-suggested default newsgroups. + + MCONNTPListNewsgroupsOperation * op = [session listDefaultNewsgroupsOperation]; + [op start:^(NSError * error, NSArray * defaultGroups) { + }]; + */ +- (MCONNTPListNewsgroupsOperation *) listDefaultNewsgroupsOperation; + +/** + Returns an operation that will disconnect the session. + + MCONNTPOperation * op = [session disconnectOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCONNTPOperation *) disconnectOperation; + +/** + Returns an operation that will check whether the NNTP account is valid. + + MCONNTPOperation * op = [session checkAccountOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCONNTPOperation *) checkAccountOperation; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCONetService.h b/MailCore.framework/Headers/MCONetService.h new file mode 100644 index 000000000..eb198e5ee --- /dev/null +++ b/MailCore.framework/Headers/MCONetService.h @@ -0,0 +1,41 @@ +// +// MCONetService.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import +#import + +/** + This class provides a specific way to access a given service +*/ + +@interface MCONetService : NSObject + +/** + The hostname of the server. [MCONetService hostnameWithEmail:] is recommended + instead as it can handle services with custom domains +*/ +@property (nonatomic, copy) NSString * hostname; + +/** The port number of the service */ +@property (nonatomic, assign) unsigned int port; + +/** What kind of connection type is supported, like SSL, Start TLS, Plain etc. */ +@property (nonatomic, assign) MCOConnectionType connectionType; + ++ (MCONetService *) serviceWithInfo:(NSDictionary *)info; + +- (id) initWithInfo:(NSDictionary *)info; +- (NSDictionary *) info; + +/** + If the service uses a custom domain this will return the proper hostname based + off the email address +*/ +- (NSString *) hostnameWithEmail:(NSString *)email; + +@end diff --git a/MailCore.framework/Headers/MCOObjectWrapper.h b/MailCore.framework/Headers/MCOObjectWrapper.h new file mode 100644 index 000000000..67cb45e17 --- /dev/null +++ b/MailCore.framework/Headers/MCOObjectWrapper.h @@ -0,0 +1,31 @@ +// +// MCOObjectWrapper.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/25/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOOBJECTWRAPPER_H + +#define MAILCORE_MCOOBJECTWRAPPER_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class Object; +} +#endif + +@interface MCOObjectWrapper : NSObject + +#ifdef __cplusplus +@property (nonatomic, assign) mailcore::Object * object; + ++ (MCOObjectWrapper *) objectWrapperWithObject:(mailcore::Object *)object; +#endif + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOOperation.h b/MailCore.framework/Headers/MCOOperation.h new file mode 100644 index 000000000..e3aa758a4 --- /dev/null +++ b/MailCore.framework/Headers/MCOOperation.h @@ -0,0 +1,41 @@ +// +// MCOOperation.h +// mailcore2 +// +// Created by Matt Ronge on 01/31/13. +// Copyright (c) 2013 __MyCompanyName__. All rights reserved. +// + +#ifndef MAILCORE_MCOOPERATION_H + +#define MAILCORE_MCOOPERATION_H + +#import + +@interface MCOOperation : NSObject + +/** Returns whether the operation is cancelled.*/ +@property (readonly) BOOL isCancelled; + +/** Returns whether the operation should run even if it's cancelled.*/ +@property (nonatomic, assign) BOOL shouldRunWhenCancelled; + +/** The queue this operation dispatches the callback on. Defaults to the main queue. + This property should be used only if there's performance issue creating or calling the callback + in the main thread. */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, retain) dispatch_queue_t callbackDispatchQueue; +#else +@property (nonatomic, assign) dispatch_queue_t callbackDispatchQueue; +#endif + +/** This methods is called on the main thread when the asynchronous operation is finished. + Needs to be overriden by subclasses.*/ +- (void) operationCompleted; + +/** Cancel the operation.*/ +- (void) cancel; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOP.h b/MailCore.framework/Headers/MCOPOP.h new file mode 100644 index 000000000..5a75ff4ff --- /dev/null +++ b/MailCore.framework/Headers/MCOPOP.h @@ -0,0 +1,20 @@ +// +// MCOPOP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/30/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOP_H + +#define MAILCORE_MCOPOP_H + +#import +#import +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCOPOPFetchHeaderOperation.h b/MailCore.framework/Headers/MCOPOPFetchHeaderOperation.h new file mode 100644 index 000000000..d4735ce45 --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPFetchHeaderOperation.h @@ -0,0 +1,39 @@ +// +// MCOFetchHeaderOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPFETCHHEADEROPERATION_H + +#define MAILCORE_MCOPOPFETCHHEADEROPERATION_H + +#import +#import + +/** + This is an asynchronous operation that will fetch the header of a message. + @See MCOPOPSession +*/ + +@class MCOMessageHeader; + +@interface MCOPOPFetchHeaderOperation : MCOPOPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `header` will contain the message header + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `header` will be null +*/ +- (void) start:(void (^)(NSError * error, MCOMessageHeader * header))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPFetchMessageOperation.h b/MailCore.framework/Headers/MCOPOPFetchMessageOperation.h new file mode 100644 index 000000000..b97825cfe --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPFetchMessageOperation.h @@ -0,0 +1,39 @@ +// +// MCOFetchMessageOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPFETCHMESSAGEOPERATION_H + +#define MAILCORE_MCOPOPFETCHMESSAGEOPERATION_H + +#import +#import + +/** Fetch a message from POP3 */ + +typedef void (^MCOPOPOperationProgressBlock)(unsigned int current, unsigned int maximum); + +@interface MCOPOPFetchMessageOperation : MCOPOPOperation + +/** This block will be called as data is downloaded from the network */ +@property (nonatomic, copy) MCOPOPOperationProgressBlock progress; + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `data` will contain the message data + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `data` will be nil +*/ +- (void) start:(void (^)(NSError * error, NSData * messageData))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPFetchMessagesOperation.h b/MailCore.framework/Headers/MCOPOPFetchMessagesOperation.h new file mode 100644 index 000000000..aef49081b --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPFetchMessagesOperation.h @@ -0,0 +1,34 @@ +// +// MCOPOPFetchMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPFETCHMESSAGESOPERATION_H + +#define MAILCORE_MCOPOPFETCHMESSAGESOPERATION_H + +#import +#import + +/** This is an asynchronous operation that will fetch the list of a messages on the POP3 account. */ + +@interface MCOPOPFetchMessagesOperation : MCOPOPOperation + +/** + Starts the asynchronous fetch operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil and `messages` will be an array of MCOPOPMessageInfo + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, `messages` will be null +*/ +- (void) start:(void (^)(NSError * error, NSArray * /* MCOPOPMessageInfo */ messages))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPMessageInfo.h b/MailCore.framework/Headers/MCOPOPMessageInfo.h new file mode 100644 index 000000000..416747f38 --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPMessageInfo.h @@ -0,0 +1,31 @@ +// +// MCOPOPMessageInfo.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/30/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPMESSAGEINFO_H + +#define MAILCORE_MCOPOPMESSAGEINFO_H + +#import + +/** This is information of a message fetched by MCOPOPFetchMessagesOperation.*/ + +@interface MCOPOPMessageInfo : NSObject + +/** This is the index of a given message.*/ +@property (nonatomic, assign) unsigned int index; + +/** This is the size of the given message.*/ +@property (nonatomic, assign) unsigned int size; + +/** This is the unique identifier of the message. + It can be used as a cache identifier.*/ +@property (nonatomic, copy) NSString * uid; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPNoopOperation.h b/MailCore.framework/Headers/MCOPOPNoopOperation.h new file mode 100644 index 000000000..015a1685f --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPNoopOperation.h @@ -0,0 +1,34 @@ +// +// MCOPOPNoopOperation.h +// mailcore2 +// +// Created by Robert Widmann on 9/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPNOOPOPERATION_H + +#define MAILCORE_MCOPOPNOOPOPERATION_H + +#import +#import + +/** This is an asynchronous operation that will perform a No-Op on the POP3 account. */ + +@interface MCOPOPNoopOperation : MCOPOPOperation + +/** + Starts the asynchronous noop operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h + */ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPOperation.h b/MailCore.framework/Headers/MCOPOPOperation.h new file mode 100644 index 000000000..30180ccdd --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPOperation.h @@ -0,0 +1,37 @@ +// +// MCODeleteMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPOPERATION_H + +#define MAILCORE_MCOPOPOPERATION_H + +#import +#import + +/** + This is a generic asynchronous POP3 operation. + @see MCOPOPSession +*/ + +@interface MCOPOPOperation : MCOOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, +*/ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOPOPSession.h b/MailCore.framework/Headers/MCOPOPSession.h new file mode 100644 index 000000000..bf1f8cf98 --- /dev/null +++ b/MailCore.framework/Headers/MCOPOPSession.h @@ -0,0 +1,179 @@ +// +// MCOPOPSession.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOPOPSESSION_H + +#define MAILCORE_MCOPOPSESSION_H + +#import + +#import + +@class MCOPOPFetchMessagesOperation; +@class MCOPOPFetchHeaderOperation; +@class MCOPOPFetchMessageOperation; +@class MCOPOPOperation; +@class MCOIndexSet; + +/** This class implements asynchronous access to the POP3 protocol.*/ + +@interface MCOPOPSession : NSObject + +/** This is the hostname of the POP3 server to connect to.*/ +@property (nonatomic, copy) NSString * hostname; + +/** This is the port of the POP3 server to connect to.*/ +@property (nonatomic, assign) unsigned int port; + +/** This is the username of the account.*/ +@property (nonatomic, copy) NSString * username; + +/** This is the password of the account.*/ +@property (nonatomic, copy) NSString * password; + +/** + This is the authentication type to use to connect. + `MCOAuthTypeSASLNone` means that it uses the clear-text is used (and is the default). + @warning *Important*: Over an encrypted connection like TLS, the password will still be secure +*/ +@property (nonatomic, assign) MCOAuthType authType; + +/** This is the encryption type to use. +See MCOConnectionType for more information.*/ +@property (nonatomic, assign) MCOConnectionType connectionType; + +/** This is the timeout of the connection.*/ +@property (nonatomic, assign) NSTimeInterval timeout; + +/** When set to YES, the connection will fail if the certificate is incorrect.*/ +@property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabled; + +/** + Sets logger callback. The network traffic will be sent to this block. + + [session setConnectionLogger:^(void * connectionID, MCOConnectionLogType type, NSData * data) { + ... + }]; + */ +@property (nonatomic, copy) MCOConnectionLogger connectionLogger; + +/** This property provides some hints to MCOPOPSession about where it's called from. + It will make MCOPOPSession safe. It will also set all the callbacks of operations to run on this given queue. + Defaults to the main queue. + This property should be used only if there's performance issue using MCOPOPSession in the main thread. */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, retain) dispatch_queue_t dispatchQueue; +#else +@property (nonatomic, assign) dispatch_queue_t dispatchQueue; +#endif + +/** + The value will be YES when asynchronous operations are running, else it will return NO. + */ +@property (nonatomic, assign, readonly, getter=isOperationQueueRunning) BOOL operationQueueRunning; + +/** + Sets operation running callback. It will be called when operations start or stop running. + + [session setOperationQueueRunningChangeBlock:^{ + if ([session isOperationQueueRunning]) { + ... + } + else { + ... + } + }]; + */ +@property (nonatomic, copy) MCOOperationQueueRunningChangeBlock operationQueueRunningChangeBlock; + +/** + Cancel all operations + */ +- (void) cancelAllOperations; + +/** @name Operations */ + +/** + Returns an operation that will fetch the list of messages. + + MCOPOPFetchMessagesOperation * op = [session fetchMessagesOperation]; + [op start:^(NSError * error, NSArray * messages) { + // messages is an array of MCOPOPMessageInfo + // [info index] can be used as reference for a given message in the other operations. + }]; +*/ +- (MCOPOPFetchMessagesOperation *) fetchMessagesOperation; + +/** + Returns an operation that will fetch the header of the given message. + + MCOPOPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx]; + [op start:^(NSError * error, MCOMessageHeader * header) { + // header is the parsed header of the message. + }]; +*/ +- (MCOPOPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index; + +/** + Returns an operation that will fetch the content of the given message. + + MCOPOPFetchMessageOperation * op = [session fetchMessageOperationWithIndex:idx]; + [op start:^(NSError * error, NSData * messageData) { + // messageData is the RFC 822 formatted message data. + }]; +*/ +- (MCOPOPFetchMessageOperation *) fetchMessageOperationWithIndex:(unsigned int)index; + +/** + Returns an operation that will delete the given messages. + Will disconnect when finished. + + MCOIndexSet * indexes = [MCOIndexSet indexSet]; + [indexes addIndex:1]; + [indexes addIndex:2]; + [indexes addIndex:3]; + MCOPOPOperation * op = [session deleteMessagesOperationWithIndexes:indexes]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOPOPOperation *) deleteMessagesOperationWithIndexes:(MCOIndexSet *)indexes; + +/** + Returns an operation that will disconnect the session. + + MCOPOPOperation * op = [session disconnectOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOPOPOperation *) disconnectOperation; + +/** + Returns an operation that will check whether the POP account is valid. + + MCOPOPOperation * op = [session checkAccountOperation]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOPOPOperation *) checkAccountOperation; + +/** + Returns an operation that will perform a No-Op operation. + + MCOPOPOperation * op = [session noopOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOPOPOperation *) noopOperation; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOProvider.h b/MailCore.framework/Headers/MCOProvider.h new file mode 100644 index 000000000..3c7bf7ced --- /dev/null +++ b/MailCore.framework/Headers/MCOProvider.h @@ -0,0 +1,17 @@ +// +// MCOPROVIDER.h +// mailcore2 +// +// Created by Pushkar Singh on 5/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef _MAILCORE__MCOPROVIDER_h +#define _MAILCORE__MCOPROVIDER_h + +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCORFC822.h b/MailCore.framework/Headers/MCORFC822.h new file mode 100644 index 000000000..ce894aa84 --- /dev/null +++ b/MailCore.framework/Headers/MCORFC822.h @@ -0,0 +1,19 @@ +// +// MCORFC822.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCORFC822_H + +#define MAILCORE_MCORFC822_H + +#import +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCORange.h b/MailCore.framework/Headers/MCORange.h new file mode 100644 index 000000000..fa6d4ae9c --- /dev/null +++ b/MailCore.framework/Headers/MCORange.h @@ -0,0 +1,77 @@ +// +// MCORange.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCORANGE_H + +#define MAILCORE_MCORANGE_H + +#import + +#ifdef __cplusplus +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +@class MCOIndexSet; + +typedef struct { + /** first integer of the range.*/ + uint64_t location; + + /** length of the range.*/ + uint64_t length; +} MCORange; + +/** Constants for an emtpy range.*/ +extern MCORange MCORangeEmpty; + +/** Returns a new range given a location and length.*/ +MCORange MCORangeMake(uint64_t location, uint64_t length); + +/** Returns an index set that is the result of sustracting a range from a range.*/ +MCOIndexSet * MCORangeRemoveRange(MCORange range1, MCORange range2); + +/** Returns an index set that is the result of the union a range from a range.*/ +MCOIndexSet * MCORangeUnion(MCORange range1, MCORange range2); + +#ifdef __cplusplus + +/** Returns a C++ range from an Objective-C range.*/ +mailcore::Range MCORangeToMCRange(MCORange range); + +/** Returns an Objective-C range from a C++ range.*/ +MCORange MCORangeWithMCRange(mailcore::Range range); + +#endif + +/** Returns the intersection of two ranges.*/ +MCORange MCORangeIntersection(MCORange range1, MCORange range2); + +/** Returns YES if two given ranges have an intersection.*/ +BOOL MCORangeHasIntersection(MCORange range1, MCORange range2); + +/** Returns left bound of a range.*/ +uint64_t MCORangeLeftBound(MCORange range); + +/** Returns right bound of a range.*/ +uint64_t MCORangeRightBound(MCORange range); + +/** Returns a serializable form (NSString) of a range */ +NSString * MCORangeToString(MCORange range); + +/** Create a range from a serializable form (NSString). */ +MCORange MCORangeFromString(NSString * rangeString); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/MailCore.framework/Headers/MCOSMTP.h b/MailCore.framework/Headers/MCOSMTP.h new file mode 100644 index 000000000..49d01de31 --- /dev/null +++ b/MailCore.framework/Headers/MCOSMTP.h @@ -0,0 +1,17 @@ +// +// MCOSMTP.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSMTP_H + +#define MAILCORE_MCOSMTP_H + +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCOSMTPLoginOperation.h b/MailCore.framework/Headers/MCOSMTPLoginOperation.h new file mode 100644 index 000000000..e7ffc641c --- /dev/null +++ b/MailCore.framework/Headers/MCOSMTPLoginOperation.h @@ -0,0 +1,32 @@ +// +// MCOSMTPLoginOperation.h +// mailcore2 +// +// Created by Hironori Yoshida on 10/29/14. +// Copyright (c) 2014 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSMTPLOGINOPERATION_H + +#define MAILCORE_MCOSMTPLOGINOPERATION_H + +#import + +/** This is an asynchronous operation that will perform a noop operation through SMTP. */ +@interface MCOSMTPLoginOperation : MCOSMTPOperation + +/* + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, + */ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOSMTPOperation.h b/MailCore.framework/Headers/MCOSMTPOperation.h new file mode 100644 index 000000000..7b92148fd --- /dev/null +++ b/MailCore.framework/Headers/MCOSMTPOperation.h @@ -0,0 +1,33 @@ +// +// MCOSMTPCheckAccountOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSMTPOPERATION_H + +#define MAILCORE_MCOSMTPOPERATION_H + +#import + +/** This is an asynchronous SMTP operation, used for sending messages. */ + +@interface MCOSMTPOperation : MCOOperation + +/** + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, +*/ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOSMTPSendOperation.h b/MailCore.framework/Headers/MCOSMTPSendOperation.h new file mode 100644 index 000000000..82b238c26 --- /dev/null +++ b/MailCore.framework/Headers/MCOSMTPSendOperation.h @@ -0,0 +1,38 @@ +// +// MCOSMTPSendOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSMTPSENDOPERATION_H + +#define MAILCORE_MCOSMTPSENDOPERATION_H + +#import + +/** This is an asynchronous operation that will send a message through SMTP. */ + +typedef void (^MCOSMTPOperationProgressBlock)(unsigned int current, unsigned int maximum); + +@interface MCOSMTPSendOperation : MCOSMTPOperation + +/** This block will be called as the message is sent */ +@property (nonatomic, copy) MCOSMTPOperationProgressBlock progress; + +/* + Starts the asynchronous operation. + + @param completionBlock Called when the operation is finished. + + - On success `error` will be nil + + - On failure, `error` will be set with `MCOErrorDomain` as domain and an + error code available in MCOConstants.h, +*/ +- (void) start:(void (^)(NSError * error))completionBlock; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOSMTPSession.h b/MailCore.framework/Headers/MCOSMTPSession.h new file mode 100644 index 000000000..64389c148 --- /dev/null +++ b/MailCore.framework/Headers/MCOSMTPSession.h @@ -0,0 +1,179 @@ +// +// MCOSMTPSession.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOSMTPSESSION_H + +#define MAILCORE_MCOSMTPSESSION_H + +#import + +#import + +/** + This class is used to create an SMTP connection and send messages + + After calling a method that returns an operation you must call start: on the instance + to begin the operation. +*/ + +@class MCOSMTPSendOperation; +@class MCOSMTPOperation; +@class MCOAddress; + +@interface MCOSMTPSession : NSObject + +/** This is the hostname of the SMTP server to connect to. */ +@property (nonatomic, copy) NSString * hostname; + +/** This is the port of the SMTP server to connect to. */ +@property (nonatomic, assign) unsigned int port; + +/** This is the username of the account. */ +@property (nonatomic, copy) NSString * username; + +/** This is the password of the account. */ +@property (nonatomic, copy) NSString * password; + +/** This is the OAuth2 token. */ +@property (nonatomic, copy) NSString *OAuth2Token; + +/** + This is the authentication type to use to connect. + `MCOAuthTypeSASLNone` means that it uses the clear-text is used (and is the default). + @warning *Important*: Over an encrypted connection like TLS, the password will still be secure +*/ +@property (nonatomic, assign) MCOAuthType authType; + +/** + This is the encryption type to use. + See MCOConnectionType for more information. +*/ +@property (nonatomic, assign) MCOConnectionType connectionType; + +/** This is the timeout of the connection. */ +@property (nonatomic, assign) NSTimeInterval timeout; + +/** When set to YES, the connection will fail if the certificate is incorrect. */ +@property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabled; + +/** + If set to YES, when sending the EHLO or HELO command, use IP address instead of hostname. + Default is NO. +*/ +@property (nonatomic, assign, getter=isUseHeloIPEnabled) BOOL useHeloIPEnabled; + +/** + Sets logger callback. The network traffic will be sent to this block. + + [session setConnectionLogger:^(void * connectionID, MCOConnectionLogType type, NSData * data) { + ... + }]; + */ +@property (nonatomic, copy) MCOConnectionLogger connectionLogger; + +/** This property provides some hints to MCOSMTPSession about where it's called from. + It will make MCOSMTPSession safe. It will also set all the callbacks of operations to run on this given queue. + Defaults to the main queue. + This property should be used only if there's performance issue using MCOSMTPSession in the main thread. */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, retain) dispatch_queue_t dispatchQueue; +#else +@property (nonatomic, assign) dispatch_queue_t dispatchQueue; +#endif + +/** + The value will be YES when asynchronous operations are running, else it will return NO. + */ +@property (nonatomic, assign, readonly, getter=isOperationQueueRunning) BOOL operationQueueRunning; + +/** + Sets operation running callback. It will be called when operations start or stop running. + + [session setOperationQueueRunningChangeBlock:^{ + if ([session isOperationQueueRunning]) { + ... + } + else { + ... + } + }]; + */ +@property (nonatomic, copy) MCOOperationQueueRunningChangeBlock operationQueueRunningChangeBlock; + +/** + Cancel all operations + */ +- (void) cancelAllOperations; + +/** @name Operations */ + +/** + Returns an operation that will perform a login. + + MCOSMTPOperation * op = [session loginOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOSMTPOperation *) loginOperation; + +/** + Returns an operation that will send the given message through SMTP. + It will use the recipient set in the message data (To, Cc and Bcc). + It will also filter out Bcc from the content of the message. + + Generate RFC 822 data using MCOMessageBuilder + + MCOSMTPOperation * op = [session sendOperationWithData:rfc822Data]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOSMTPSendOperation *) sendOperationWithData:(NSData *)messageData; + +/** + Returns an operation that will send the given message through SMTP. + It will use the sender and recipient set from the parameters. + It will also filter out Bcc from the content of the message. + + Generate RFC 822 data using MCOMessageBuilder + + MCOSMTPOperation * op = [session sendOperationWithData:rfc822Data + from:[MCOAddress addressWithMailbox:@"hoa@etpan.org"] + recipients:[NSArray arrayWithObject:[MCOAddress addressWithMailbox:@"laura@etpan.org"]]]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOSMTPSendOperation *) sendOperationWithData:(NSData *)messageData + from:(MCOAddress *)from + recipients:(NSArray *)recipients; + +/** + Returns an operation that will check whether the SMTP account is valid. + + MCOSMTPOperation * op = [session checkAccountOperationWithFrom:[MCOAddress addressWithMailbox:@"hoa@etpan.org"]]; + [op start:^(NSError * error) { + ... + }]; +*/ +- (MCOSMTPOperation *) checkAccountOperationWithFrom:(MCOAddress *)from; + +/** + Returns an operation that will perform a No-Op. + + MCOSMTPOperation * op = [session noopOperation]; + [op start:^(NSError * error) { + ... + }]; + */ +- (MCOSMTPOperation *) noopOperation; + +@end + +#endif diff --git a/MailCore.framework/Headers/MCOUtils.h b/MailCore.framework/Headers/MCOUtils.h new file mode 100644 index 000000000..3c36a6abb --- /dev/null +++ b/MailCore.framework/Headers/MCOUtils.h @@ -0,0 +1,27 @@ +// +// MCOUtils.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/22/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOUTILS_H + +#define MAILCORE_MCOUTILS_H + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#endif diff --git a/MailCore.framework/Headers/MCObjC.h b/MailCore.framework/Headers/MCObjC.h new file mode 100644 index 000000000..68d35f1e6 --- /dev/null +++ b/MailCore.framework/Headers/MCObjC.h @@ -0,0 +1,26 @@ +// +// MCObjC.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/27/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCOBJC_H + +#define MAILCORE_MCOBJC_H + +#ifdef __OBJC__ + +#import +#import +#import +#import +#import +#import +#import +#import + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCObject.h b/MailCore.framework/Headers/MCObject.h new file mode 100644 index 000000000..83d6c1a7c --- /dev/null +++ b/MailCore.framework/Headers/MCObject.h @@ -0,0 +1,74 @@ +#ifndef MAILCORE_MCOBJECT_H + +#define MAILCORE_MCOBJECT_H + +#include +#if __APPLE__ +#include +#include +#endif + +#include + +#ifdef __cplusplus + +namespace mailcore { + + extern bool zombieEnabled; + + class String; + class HashMap; + + class MAILCORE_EXPORT Object { + public: + Object(); + virtual ~Object(); + + virtual int retainCount(); + virtual Object * retain(); + virtual void release(); + virtual Object * autorelease(); + virtual String * description(); + virtual String * className(); + + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + + // optional + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + typedef void (Object::*Method) (void *); + virtual void performMethod(Method method, void * context); + virtual void performMethodOnMainThread(Method method, void * context, bool waitUntilDone = false); + virtual void performMethodAfterDelay(Method method, void * context, double delay); +#if __APPLE__ + virtual void performMethodOnDispatchQueue(Method method, void * context, void * targetDispatchQueue, bool waitUntilDone = false); + virtual void performMethodOnDispatchQueueAfterDelay(Method method, void * context, void * targetDispatchQueue, double delay); + virtual void cancelDelayedPerformMethodOnDispatchQueue(Method method, void * context, void * targetDispatchQueue); +#endif + virtual void cancelDelayedPerformMethod(Method method, void * context); + + // serialization utils + static void registerObjectConstructor(const char * className, void * (* objectConstructor)(void)); + static Object * objectWithSerializable(HashMap * serializable); + + public: // private + + private: +#if __APPLE__ + OSSpinLock mLock; +#else + pthread_mutex_t mLock; +#endif + int mCounter; + void init(); + static void initObjectConstructors(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCOperation.h b/MailCore.framework/Headers/MCOperation.h new file mode 100644 index 000000000..5ee8b2f4c --- /dev/null +++ b/MailCore.framework/Headers/MCOperation.h @@ -0,0 +1,59 @@ +#ifndef MAILCORE_MCOPERATION_H + +#define MAILCORE_MCOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class OperationCallback; + + class MAILCORE_EXPORT Operation : public Object { + public: + Operation(); + virtual ~Operation(); + + virtual void setCallback(OperationCallback * callback); + virtual OperationCallback * callback(); + + virtual void cancel(); + virtual bool isCancelled(); + + // Will be called on main thread. + virtual void beforeMain(); + + virtual void main(); + + // Will be called on main thread. + virtual void afterMain(); + + virtual void start(); + +#ifdef __APPLE__ + virtual void setCallbackDispatchQueue(dispatch_queue_t callbackDispatchQueue); + virtual dispatch_queue_t callbackDispatchQueue(); +#endif + void performMethodOnCallbackThread(Method method, void * context, bool waitUntilDone = false); + + virtual bool shouldRunWhenCancelled(); + virtual void setShouldRunWhenCancelled(bool shouldRunWhenCancelled); + + private: + OperationCallback * mCallback; + bool mCancelled; + bool mShouldRunWhenCancelled; + pthread_mutex_t mLock; +#ifdef __APPLE__ + dispatch_queue_t mCallbackDispatchQueue; +#endif + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCOperationCallback.h b/MailCore.framework/Headers/MCOperationCallback.h new file mode 100644 index 000000000..425b1e995 --- /dev/null +++ b/MailCore.framework/Headers/MCOperationCallback.h @@ -0,0 +1,22 @@ +#ifndef MAILCORE_MCOPERATIONCALLBACK_H + +#define MAILCORE_MCOPERATIONCALLBACK_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Operation; + + class MAILCORE_EXPORT OperationCallback { + public: + virtual void operationFinished(Operation * op) {} + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCOperationQueue.h b/MailCore.framework/Headers/MCOperationQueue.h new file mode 100644 index 000000000..1e8e48445 --- /dev/null +++ b/MailCore.framework/Headers/MCOperationQueue.h @@ -0,0 +1,68 @@ +#ifndef MAILCORE_MCOPERATIONQUEUE_H + +#define MAILCORE_MCOPERATIONQUEUE_H + +#include +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Operation; + class OperationQueueCallback; + class Array; + + class MAILCORE_EXPORT OperationQueue : public Object { + public: + OperationQueue(); + virtual ~OperationQueue(); + + virtual void addOperation(Operation * op); + virtual void cancelAllOperations(); + + virtual unsigned int count(); + + virtual void setCallback(OperationQueueCallback * callback); + virtual OperationQueueCallback * callback(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + private: + Array * mOperations; + pthread_t mThreadID; + bool mStarted; + struct mailsem * mOperationSem; + struct mailsem * mStartSem; + struct mailsem * mStopSem; + pthread_mutex_t mLock; + bool mWaiting; + struct mailsem * mWaitingFinishedSem; + bool mQuitting; + OperationQueueCallback * mCallback; +#if __APPLE__ + dispatch_queue_t mDispatchQueue; +#endif + bool _pendingCheckRunning; + + void startThread(); + static void runOperationsOnThread(OperationQueue * queue); + void runOperations(); + void beforeMain(Operation * op); + void callbackOnMainThread(Operation * op); + void checkRunningOnMainThread(void * context); + void checkRunningAfterDelay(void * context); + void stoppedOnMainThread(void * context); + void performOnCallbackThread(Operation * op, Method method, void * context, bool waitUntilDone); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOP.h b/MailCore.framework/Headers/MCPOP.h new file mode 100644 index 000000000..db17430ac --- /dev/null +++ b/MailCore.framework/Headers/MCPOP.h @@ -0,0 +1,9 @@ +#ifndef MAILCORE_MCPOP_H + +#define MAILCORE_MCPOP_H + +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCPOPAsyncSession.h b/MailCore.framework/Headers/MCPOPAsyncSession.h new file mode 100644 index 000000000..7dfe79316 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPAsyncSession.h @@ -0,0 +1,104 @@ +// +// MCPopAsyncSession.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPASYNCSESSION_H + +#define MAILCORE_MCPOPASYNCSESSION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class POPOperation; + class POPSession; + class POPFetchHeaderOperation; + class POPFetchMessageOperation; + class POPDeleteMessagesOperation; + class POPFetchMessagesOperation; + class POPOperationQueueCallback; + class POPConnectionLogger; + + class MAILCORE_EXPORT POPAsyncSession : public Object { + public: + POPAsyncSession(); + virtual ~POPAsyncSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * login); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + virtual void setOperationQueueCallback(OperationQueueCallback * callback); + virtual OperationQueueCallback * operationQueueCallback(); + virtual bool isOperationQueueRunning(); + virtual void cancelAllOperations(); + + virtual POPFetchMessagesOperation * fetchMessagesOperation(); + + virtual POPFetchHeaderOperation * fetchHeaderOperation(unsigned int index); + + virtual POPFetchMessageOperation * fetchMessageOperation(unsigned int index); + + // Will disconnect. + virtual POPOperation * deleteMessagesOperation(IndexSet * indexes); + + virtual POPOperation * disconnectOperation(); + + virtual POPOperation * checkAccountOperation(); + + virtual POPOperation * noopOperation(); + + private: + POPSession * mSession; + OperationQueue * mQueue; + POPOperationQueueCallback * mQueueCallback; + ConnectionLogger * mConnectionLogger; + pthread_mutex_t mConnectionLoggerLock; + POPConnectionLogger * mInternalLogger; + OperationQueueCallback * mOperationQueueCallback; + + public: // private + virtual void runOperation(POPOperation * operation); + virtual POPSession * session(); + virtual void logConnection(ConnectionLogType logType, Data * buffer); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPFetchHeaderOperation.h b/MailCore.framework/Headers/MCPOPFetchHeaderOperation.h new file mode 100644 index 000000000..c2c3dee80 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPFetchHeaderOperation.h @@ -0,0 +1,44 @@ +// +// MCPOPFetchHeaderOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPFETCHHEADEROPERATION_H + +#define MAILCORE_MCPOPFETCHHEADEROPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessageHeader; + + class MAILCORE_EXPORT POPFetchHeaderOperation : public POPOperation { + public: + POPFetchHeaderOperation(); + virtual ~POPFetchHeaderOperation(); + + virtual void setMessageIndex(unsigned int messageIndex); + virtual unsigned int messageIndex(); + + virtual MessageHeader * header(); + + public: // subclass behavior + virtual void main(); + + private: + unsigned int mMessageIndex; + MessageHeader * mHeader; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPFetchMessageOperation.h b/MailCore.framework/Headers/MCPOPFetchMessageOperation.h new file mode 100644 index 000000000..23fa1e895 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPFetchMessageOperation.h @@ -0,0 +1,41 @@ +// +// MCPOPFetchMessageOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPFETCHMESSAGEOPERATION_H + +#define MAILCORE_MCPOPFETCHMESSAGEOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + class MAILCORE_EXPORT POPFetchMessageOperation : public POPOperation { + public: + POPFetchMessageOperation(); + virtual ~POPFetchMessageOperation(); + + virtual void setMessageIndex(unsigned int messageIndex); + virtual unsigned int messageIndex(); + + virtual Data * data(); + + public: // subclass behavior + virtual void main(); + + private: + unsigned int mMessageIndex; + Data * mData; + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPFetchMessagesOperation.h b/MailCore.framework/Headers/MCPOPFetchMessagesOperation.h new file mode 100644 index 000000000..7eb797b03 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPFetchMessagesOperation.h @@ -0,0 +1,37 @@ +// +// MCPOPFetchMessagesOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPFETCHMESSAGESOPERATION_H + +#define MAILCORE_MCPOPFETCHMESSAGESOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT POPFetchMessagesOperation : public POPOperation { + public: + POPFetchMessagesOperation(); + virtual ~POPFetchMessagesOperation(); + + virtual Array * /* POPMessageInfo */ messages(); + + public: // subclass behavior + virtual void main(); + + private: + Array * /* POPMessageInfo */ mMessages; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPMessageInfo.h b/MailCore.framework/Headers/MCPOPMessageInfo.h new file mode 100644 index 000000000..6d70fe301 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPMessageInfo.h @@ -0,0 +1,42 @@ +#ifndef MAILCORE_MCPOPMESSAGEINFO_H + +#define MAILCORE_MCPOPMESSAGEINFO_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT POPMessageInfo : public Object { + public: + POPMessageInfo(); + virtual ~POPMessageInfo(); + + virtual void setIndex(unsigned int index); + virtual unsigned int index(); + + virtual void setSize(unsigned int size); + virtual unsigned int size(); + + virtual void setUid(String * uid); + virtual String * uid(); + + public: // subclass behavior + POPMessageInfo(POPMessageInfo * other); + virtual String * description(); + virtual Object * copy(); + + private: + unsigned int mIndex; + unsigned int mSize; + String * mUid; + + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPNoopOperation.h b/MailCore.framework/Headers/MCPOPNoopOperation.h new file mode 100644 index 000000000..cc040c08a --- /dev/null +++ b/MailCore.framework/Headers/MCPOPNoopOperation.h @@ -0,0 +1,32 @@ +// +// MCPOPNoopOperation.h +// mailcore2 +// +// Created by Robert Widmann on 9/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPNOOPOPERATION_H + +#define MAILCORE_MCPOPNOOPOPERATION_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT POPNoopOperation : public POPOperation { + public: + POPNoopOperation(); + virtual ~POPNoopOperation(); + + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPOperation.h b/MailCore.framework/Headers/MCPOPOperation.h new file mode 100644 index 000000000..652e4a4bf --- /dev/null +++ b/MailCore.framework/Headers/MCPOPOperation.h @@ -0,0 +1,53 @@ +// +// MCPOPOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPOPERATION_H + +#define MAILCORE_MCPOPOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class POPAsyncSession; + class POPOperationCallback; + + class MAILCORE_EXPORT POPOperation : public Operation, public POPProgressCallback { + public: + POPOperation(); + virtual ~POPOperation(); + + virtual void setSession(POPAsyncSession * session); + virtual POPAsyncSession * session(); + + virtual void setPopCallback(POPOperationCallback * callback); + virtual POPOperationCallback * popCallback(); + + virtual void setError(ErrorCode error); + virtual ErrorCode error(); + + virtual void start(); + + private: + POPAsyncSession * mSession; + POPOperationCallback * mPopCallback; + ErrorCode mError; + private: + virtual void bodyProgress(POPSession * session, unsigned int current, unsigned int maximum); + virtual void bodyProgressOnMainThread(void * context); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPOperationCallback.h b/MailCore.framework/Headers/MCPOPOperationCallback.h new file mode 100644 index 000000000..60714b883 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPOperationCallback.h @@ -0,0 +1,30 @@ +// +// MCPOPOperationCallback.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/16/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPOPOPERATIONCALLBACK_H + +#define MAILCORE_MCPOPOPERATIONCALLBACK_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class POPOperation; + + class MAILCORE_EXPORT POPOperationCallback { + public: + virtual void bodyProgress(POPOperation * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPProgressCallback.h b/MailCore.framework/Headers/MCPOPProgressCallback.h new file mode 100644 index 000000000..cdee93325 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPProgressCallback.h @@ -0,0 +1,22 @@ +#ifndef MAILCORE_MCPOPPROGRESSCALLBACK_H + +#define MAILCORE_MCPOPPROGRESSCALLBACK_H + +#ifdef __cplusplus + +#include + +namespace mailcore { + + class POPSession; + + class MAILCORE_EXPORT POPProgressCallback { + public: + virtual void bodyProgress(POPSession * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCPOPSession.h b/MailCore.framework/Headers/MCPOPSession.h new file mode 100644 index 000000000..eda323c04 --- /dev/null +++ b/MailCore.framework/Headers/MCPOPSession.h @@ -0,0 +1,100 @@ +#ifndef MAILCORE_MCPOPSESSION_H + +#define MAILCORE_MCPOPSESSION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class POPMessageInfo; + class POPProgressCallback; + class MessageHeader; + + class MAILCORE_EXPORT POPSession : public Object { + public: + POPSession(); + virtual ~POPSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void connect(ErrorCode * pError); + virtual void disconnect(); + + virtual void login(ErrorCode * pError); + + virtual void checkAccount(ErrorCode * pError); + + virtual void noop(ErrorCode * pError); + + Array * /* POPMessageInfo */ fetchMessages(ErrorCode * pError); + + MessageHeader * fetchHeader(unsigned int index, ErrorCode * pError); + MessageHeader * fetchHeader(POPMessageInfo * msg, ErrorCode * pError); + + Data * fetchMessage(unsigned int index, POPProgressCallback * callback, ErrorCode * pError); + Data * fetchMessage(POPMessageInfo * msg, POPProgressCallback * callback, ErrorCode * pError); + + void deleteMessage(unsigned int index, ErrorCode * pError); + void deleteMessage(POPMessageInfo * msg, ErrorCode * pError); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + AuthType mAuthType; + ConnectionType mConnectionType; + bool mCheckCertificateEnabled; + time_t mTimeout; + + mailpop3 * mPop; + POPCapability mCapabilities; + POPProgressCallback * mProgressCallback; + int mState; + + ConnectionLogger * mConnectionLogger; + + void init(); + void bodyProgress(unsigned int current, unsigned int maximum); + bool checkCertificate(); + static void body_progress(size_t current, size_t maximum, void * context); + void setup(); + void unsetup(); + void connectIfNeeded(ErrorCode * pError); + void loginIfNeeded(ErrorCode * pError); + void listIfNeeded(ErrorCode * pError); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCProvider.h b/MailCore.framework/Headers/MCProvider.h new file mode 100644 index 000000000..ad8189b25 --- /dev/null +++ b/MailCore.framework/Headers/MCProvider.h @@ -0,0 +1,18 @@ +// +// MCProvider.h +// mailcore2 +// +// Created by Robert Widmann on 4/28/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCPROVIDER_H + +#define MAILCORE_MCPROVIDER_H + +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCRFC822.h b/MailCore.framework/Headers/MCRFC822.h new file mode 100644 index 000000000..66c4d4083 --- /dev/null +++ b/MailCore.framework/Headers/MCRFC822.h @@ -0,0 +1,11 @@ +#ifndef MAILCORE_MCRFC822_H + +#define MAILCORE_MCRFC822_H + +#include +#include +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCRange.h b/MailCore.framework/Headers/MCRange.h new file mode 100644 index 000000000..9ec4f5680 --- /dev/null +++ b/MailCore.framework/Headers/MCRange.h @@ -0,0 +1,60 @@ +#ifndef MAILCORE_MCRANGE_H + +#define MAILCORE_MCRANGE_H + +#ifdef __cplusplus + +#include + +#include + +#ifndef UINT64_MAX +# define UINT64_MAX 18446744073709551615ULL +#endif + +namespace mailcore { + + class IndexSet; + class String; + + // infinite length : UINT64_MAX + // empty range : location = UINT64_MAX + struct Range { + uint64_t location; + uint64_t length; + }; + + MAILCORE_EXPORT + extern Range RangeEmpty; + + MAILCORE_EXPORT + Range RangeMake(uint64_t location, uint64_t length); + + MAILCORE_EXPORT + IndexSet * RangeRemoveRange(Range range1, Range range2); + + MAILCORE_EXPORT + IndexSet * RangeUnion(Range range1, Range range2); + + MAILCORE_EXPORT + Range RangeIntersection(Range range1, Range range2); + + MAILCORE_EXPORT + bool RangeHasIntersection(Range range1, Range range2); + + MAILCORE_EXPORT + uint64_t RangeLeftBound(Range range); + + MAILCORE_EXPORT + uint64_t RangeRightBound(Range range); + + MAILCORE_EXPORT + String * RangeToString(Range range); + + MAILCORE_EXPORT + Range RangeFromString(String * rangeString); +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCRenderer.h b/MailCore.framework/Headers/MCRenderer.h new file mode 100644 index 000000000..441b63b4d --- /dev/null +++ b/MailCore.framework/Headers/MCRenderer.h @@ -0,0 +1,17 @@ +// +// MCRenderer.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 2/2/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCRENDERER_H + +#define MAILCORE_MCRENDERER_H + +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCSMTP.h b/MailCore.framework/Headers/MCSMTP.h new file mode 100644 index 000000000..452e024ff --- /dev/null +++ b/MailCore.framework/Headers/MCSMTP.h @@ -0,0 +1,8 @@ +#ifndef MAILCORE_MCSMTP_H + +#define MAILCORE_MCSMTP_H + +#include +#include + +#endif diff --git a/MailCore.framework/Headers/MCSMTPAsyncSession.h b/MailCore.framework/Headers/MCSMTPAsyncSession.h new file mode 100644 index 000000000..908497978 --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPAsyncSession.h @@ -0,0 +1,99 @@ +#ifndef MAILCORE_MCSMTPASYNCSESSION_H + +#define MAILCORE_MCSMTPASYNCSESSION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MessageBuilder; + class SMTPOperation; + class SMTPSession; + class Address; + class SMTPOperationQueueCallback; + class SMTPConnectionLogger; + + class MAILCORE_EXPORT SMTPAsyncSession : public Object { + public: + SMTPAsyncSession(); + virtual ~SMTPAsyncSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setOAuth2Token(String * token); + virtual String * OAuth2Token(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setUseHeloIPEnabled(bool enabled); + virtual bool useHeloIPEnabled(); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + virtual void setOperationQueueCallback(OperationQueueCallback * callback); + virtual OperationQueueCallback * operationQueueCallback(); + virtual bool isOperationQueueRunning(); + virtual void cancelAllOperations(); + + virtual SMTPOperation * loginOperation(); + virtual SMTPOperation * sendMessageOperation(Data * messageData); + virtual SMTPOperation * sendMessageOperation(Address * from, Array * recipients, + Data * messageData); + virtual SMTPOperation * checkAccountOperation(Address * from); + + virtual SMTPOperation * noopOperation(); + + virtual SMTPOperation * disconnectOperation(); + + public: // private + virtual void runOperation(SMTPOperation * operation); + virtual SMTPSession * session(); + virtual void tryAutomaticDisconnect(); + virtual void logConnection(ConnectionLogType logType, Data * buffer); + + private: + SMTPSession * mSession; + OperationQueue * mQueue; + SMTPOperationQueueCallback * mQueueCallback; + ConnectionLogger * mConnectionLogger; + pthread_mutex_t mConnectionLoggerLock; + SMTPConnectionLogger * mInternalLogger; + OperationQueueCallback * mOperationQueueCallback; + + virtual void tryAutomaticDisconnectAfterDelay(void * context); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSMTPNoopOperation.h b/MailCore.framework/Headers/MCSMTPNoopOperation.h new file mode 100644 index 000000000..ad194367d --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPNoopOperation.h @@ -0,0 +1,34 @@ +// +// MCSMTPNoopOperation.h +// mailcore2 +// +// Created by Robert Widmann on 9/24/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCSMTPNOOPOPERATION_H + +#define MAILCORE_MCSMTPNOOPOPERATION_H + +#include +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class MAILCORE_EXPORT SMTPNoopOperation : public SMTPOperation { + public: + SMTPNoopOperation(); + virtual ~SMTPNoopOperation(); + + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSMTPOperation.h b/MailCore.framework/Headers/MCSMTPOperation.h new file mode 100644 index 000000000..5978d3d6d --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPOperation.h @@ -0,0 +1,52 @@ +// +// MCSMTPOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCSMTPOPERATION_H + +#define MAILCORE_MCSMTPOPERATION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class SMTPAsyncSession; + class SMTPOperationCallback; + + class MAILCORE_EXPORT SMTPOperation : public Operation, public SMTPProgressCallback { + public: + SMTPOperation(); + virtual ~SMTPOperation(); + + virtual void setSession(SMTPAsyncSession * session); + virtual SMTPAsyncSession * session(); + + virtual void setSmtpCallback(SMTPOperationCallback * callback); + virtual SMTPOperationCallback * smtpCallback(); + + virtual void setError(ErrorCode error); + virtual ErrorCode error(); + + virtual void start(); + + private: + SMTPAsyncSession * mSession; + SMTPOperationCallback * mSmtpCallback; + ErrorCode mError; + private: + virtual void bodyProgress(SMTPSession * session, unsigned int current, unsigned int maximum); + virtual void bodyProgressOnMainThread(void * context); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSMTPOperationCallback.h b/MailCore.framework/Headers/MCSMTPOperationCallback.h new file mode 100644 index 000000000..a5cfdd84c --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPOperationCallback.h @@ -0,0 +1,30 @@ +// +// MCSMTPOperationCallback.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/11/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCSMTPOPERATIONCALLBACK_H + +#define MAILCORE_MCSMTPOPERATIONCALLBACK_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class SMTPOperation; + + class MAILCORE_EXPORT SMTPOperationCallback { + public: + virtual void bodyProgress(SMTPOperation * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSMTPProgressCallback.h b/MailCore.framework/Headers/MCSMTPProgressCallback.h new file mode 100644 index 000000000..7cc524a26 --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPProgressCallback.h @@ -0,0 +1,22 @@ +#ifndef MAILCORE_MCSMTPPROGRESSCALLBACK_H + +#define MAILCORE_MCSMTPPROGRESSCALLBACK_H + +#ifdef __cplusplus + +#include + +namespace mailcore { + + class SMTPSession; + + class MAILCORE_EXPORT SMTPProgressCallback { + public: + virtual void bodyProgress(SMTPSession * session, unsigned int current, unsigned int maximum) {}; + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSMTPSession.h b/MailCore.framework/Headers/MCSMTPSession.h new file mode 100644 index 000000000..05571bfb1 --- /dev/null +++ b/MailCore.framework/Headers/MCSMTPSession.h @@ -0,0 +1,111 @@ +#ifndef MAILCORE_MCSMTPSESSION_H + +#define MAILCORE_MCSMTPSESSION_H + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Address; + class SMTPProgressCallback; + class MessageBuilder; + + class MAILCORE_EXPORT SMTPSession : public Object { + public: + SMTPSession(); + virtual ~SMTPSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * username); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + // To authenticate using OAuth2, username and oauth2token should be set. + // auth type to use is AuthTypeOAuth2. + virtual void setOAuth2Token(String * token); + virtual String * OAuth2Token(); + + virtual void setAuthType(AuthType authType); + virtual AuthType authType(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setUseHeloIPEnabled(bool enabled); + virtual bool useHeloIPEnabled(); + + virtual void connect(ErrorCode * pError); + virtual void disconnect(); + + virtual void login(ErrorCode * pError); + + virtual void checkAccount(Address * from, ErrorCode * pError); + + virtual void sendMessage(Data * messageData, SMTPProgressCallback * callback, ErrorCode * pError); + virtual void sendMessage(Address * from, Array * /* Address */ recipients, Data * messageData, + SMTPProgressCallback * callback, ErrorCode * pError); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + + virtual void noop(ErrorCode * pError); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + String * mOAuth2Token; + AuthType mAuthType; + ConnectionType mConnectionType; + time_t mTimeout; + bool mCheckCertificateEnabled; + bool mUseHeloIPEnabled; + bool mShouldDisconnect; + + mailsmtp * mSmtp; + SMTPProgressCallback * mProgressCallback; + int mState; + String * mLastSMTPResponse; + int mLastLibetpanError; + int mLastSMTPResponseCode; + + ConnectionLogger * mConnectionLogger; + + void init(); + Data * dataWithFilteredBcc(Data * data); + static void body_progress(size_t current, size_t maximum, void * context); + void bodyProgress(unsigned int current, unsigned int maximum); + void setup(); + void unsetup(); + void connectIfNeeded(ErrorCode * pError); + bool checkCertificate(); + + void sendMessage(MessageBuilder * msg, SMTPProgressCallback * callback, ErrorCode * pError); + + public: // private + virtual bool isDisconnected(); + virtual void loginIfNeeded(ErrorCode * pError); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSet.h b/MailCore.framework/Headers/MCSet.h new file mode 100644 index 000000000..8b477cc11 --- /dev/null +++ b/MailCore.framework/Headers/MCSet.h @@ -0,0 +1,49 @@ +#ifndef MAILCORE_CSET_H + +#define MAILCORE_CSET_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class String; + class Array; + class HashMap; + + class MAILCORE_EXPORT Set : public Object { + public: + Set(); + Set(Set * o); + + static Set * set(); + static Set * setWithArray(Array * objects); + + virtual unsigned int count(); + virtual void addObject(Object * obj); + virtual void removeObject(Object * obj); + virtual bool containsObject(Object * obj); + virtual Object * member(Object * obj); + + virtual Array * allObjects(); + virtual void removeAllObjects(); + virtual void addObjectsFromArray(Array * objects); + + public: // subclass behavior + virtual ~Set(); + virtual String * description(); + virtual Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + HashMap * mHash; + void init(); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCSizeFormatter.h b/MailCore.framework/Headers/MCSizeFormatter.h new file mode 100644 index 000000000..cfc8090fd --- /dev/null +++ b/MailCore.framework/Headers/MCSizeFormatter.h @@ -0,0 +1,30 @@ +// +// MCSizeFormatter.h +// testUI +// +// Created by DINH Viêt Hoà on 1/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MCSIZEFORMATTER_H + +#define MAILCORE_MCSIZEFORMATTER_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class String; + + class MAILCORE_EXPORT SizeFormatter : public Object { + public: + static String * stringWithSize(unsigned int size); + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCString.h b/MailCore.framework/Headers/MCString.h new file mode 100644 index 000000000..5ee2ad651 --- /dev/null +++ b/MailCore.framework/Headers/MCString.h @@ -0,0 +1,152 @@ +#ifndef MAILCORE_MCSTR_H + +#define MAILCORE_MCSTR_H + +#include +#include +#include + +#include +#include + +#ifdef __cplusplus + +namespace mailcore { + + class Data; + class Array; + + class MAILCORE_EXPORT String : public Object { + public: + String(const UChar * unicodeChars = NULL); + String(const UChar * unicodeChars, unsigned int length); + String(const char * UTF8Characters); + String(Data * data, const char * charset); + String(const char * bytes, unsigned int length, const char * charset = NULL); + virtual ~String(); + + static String * string(); + static String * stringWithUTF8Format(const char * format, ...); + static String * stringWithVUTF8Format(const char * format, va_list ap); + static String * stringWithUTF8Characters(const char * UTF8Characters); + static String * stringWithCharacters(const UChar * characters); + static String * stringWithCharacters(const UChar * characters, unsigned int length); + static String * stringWithData(Data * data, const char * charset = NULL); + + virtual const UChar * unicodeCharacters(); + virtual const char * UTF8Characters(); + virtual unsigned int length(); + + virtual void appendString(String * otherString); + virtual void appendUTF8Format(const char * format, ...); + virtual void appendCharacters(const UChar * unicodeCharacters); + virtual void appendCharactersLength(const UChar * unicodeCharacters, unsigned int length); + virtual void appendUTF8Characters(const char * UTF8Characters); + virtual void setString(String * otherString); + virtual void setUTF8Characters(const char * UTF8Characters); + virtual void setCharacters(const UChar * unicodeCharacters); + + virtual String * stringByAppendingString(String * otherString); + virtual String * stringByAppendingUTF8Format(const char * format, ...); + virtual String * stringByAppendingUTF8Characters(const char * UTF8Characters); + virtual String * stringByAppendingCharacters(const UChar * unicodeCharacters); + virtual String * stringByAppendingPathComponent(String * component); + virtual String * stringByDeletingLastPathComponent(); + virtual String * stringByDeletingPathExtension(); + + virtual int compare(String * otherString); + virtual int caseInsensitiveCompare(String * otherString); + virtual String * lowercaseString(); + virtual String * uppercaseString(); + + virtual UChar characterAtIndex(unsigned int idx); + virtual void deleteCharactersInRange(Range range); + virtual unsigned int replaceOccurrencesOfString(String * occurrence, String * replacement); + virtual int locationOfString(String * occurrence); + virtual int lastLocationOfString(String * occurrence); + + virtual Array * componentsSeparatedByString(String * separator); + + virtual bool isEqualCaseInsensitive(String * otherString); + + // Additions + static String * stringByDecodingMIMEHeaderValue(const char * phrase); + virtual Data * encodedAddressDisplayNameValue(); + virtual Data * encodedMIMEHeaderValue(); + virtual Data * encodedMIMEHeaderValueForSubject(); + virtual String * extractedSubject(); + virtual String * extractedSubjectAndKeepBracket(bool keepBracket); + static String * uuidString(); + + virtual bool hasSuffix(String * suffix); + virtual bool hasPrefix(String * prefix); + + virtual String * substringFromIndex(unsigned int idx); + virtual String * substringToIndex(unsigned int idx); + virtual String * substringWithRange(Range range); + + virtual String * flattenHTML(); + virtual String * flattenHTMLAndShowBlockquote(bool showBlockquote); + virtual String * flattenHTMLAndShowBlockquoteAndLink(bool showBlockquote, bool showLink); + + virtual String * stripWhitespace(); + + virtual String * lastPathComponent(); + virtual String * pathExtension(); + virtual Data * dataUsingEncoding(const char * charset = NULL); + + virtual const char * fileSystemRepresentation(); + static String * stringWithFileSystemRepresentation(const char * filename); + + int intValue(); + unsigned int unsignedIntValue(); + long longValue(); + unsigned long unsignedLongValue(); + long long longLongValue(); + unsigned long long unsignedLongLongValue(); + double doubleValue(); + + virtual Data * mUTF7EncodedData(); + static String * stringWithMUTF7Data(Data * data); + virtual String * mUTF7EncodedString(); + virtual String * mUTF7DecodedString(); + + virtual String * htmlEncodedString(); + virtual String * cleanedHTMLString(); + virtual String * htmlMessageContent(); + + virtual Data * decodedBase64Data(); + + virtual String * urlDecodedString(); + virtual String * urlEncodedString(); + + public: // private + static String * uniquedStringWithUTF8Characters(const char * UTF8Characters); + + public: // subclass behavior + String(String * otherString); + virtual String * description(); + virtual Object * copy(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + private: + UChar * mUnicodeChars; + unsigned int mLength; + unsigned int mAllocated; + void allocate(unsigned int length, bool force = false); + void reset(); + int compareWithCaseSensitive(String * otherString, bool caseSensitive); + void appendBytes(const char * bytes, unsigned int length, const char * charset); + void appendUTF8CharactersLength(const char * UTF8Characters, unsigned int length); + }; + + MAILCORE_EXPORT + void setICUDataDirectory(String * directory); +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MCUtils.h b/MailCore.framework/Headers/MCUtils.h new file mode 100644 index 000000000..cbabe0b38 --- /dev/null +++ b/MailCore.framework/Headers/MCUtils.h @@ -0,0 +1,72 @@ +#ifndef MAILCORE_MCUTILS_H + +#define MAILCORE_MCUTILS_H + +#ifdef __cplusplus + +#define MC_SAFE_RETAIN(o) ((o) != NULL ? (o)->retain() : NULL) +#define MC_SAFE_COPY(o) ((o) != NULL ? (o)->copy() : NULL) + +#define MC_SAFE_RELEASE(o) \ + do { \ + if ((o) != NULL) { \ + (o)->release(); \ + (o) = NULL; \ + } \ + } while (0) + +#define MC_SAFE_REPLACE_RETAIN(type, mField, value) \ + do { \ + MC_SAFE_RELEASE(mField); \ + mField = (type *) MC_SAFE_RETAIN(value); \ + } while (0) + +#define MC_SAFE_REPLACE_COPY(type, mField, value) \ + do { \ + MC_SAFE_RELEASE(mField); \ + mField = (type *) MC_SAFE_COPY(value); \ + } while (0) + +#define MCSTR(str) mailcore::String::uniquedStringWithUTF8Characters("" str "") + +#define MCUTF8(str) MCUTF8DESC(str) +#define MCUTF8DESC(obj) ((obj) != NULL ? (obj)->description()->UTF8Characters() : NULL ) + +#define MCLOCALIZEDSTRING(key) key + +#define MCISKINDOFCLASS(instance, class) (dynamic_cast(instance) != NULL) + +#endif + +#ifdef _MSC_VER +# ifdef MAILCORE_DLL +# define MAILCORE_EXPORT __declspec(dllexport) +# else +# define MAILCORE_EXPORT __declspec(dllimport) +# endif +#else +# define MAILCORE_EXPORT +#endif + +#ifdef __clang__ + +#if __has_feature(attribute_analyzer_noreturn) +#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn)) +#else +#define CLANG_ANALYZER_NORETURN +#endif + +#define ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) + +#else + +#define CLANG_ANALYZER_NORETURN +#define ATTRIBUTE_RETURNS_NONNULL + +#endif + +#ifndef DEPRECATED_ATTRIBUTE +#define DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#endif + +#endif diff --git a/MailCore.framework/Headers/MCValue.h b/MailCore.framework/Headers/MCValue.h new file mode 100644 index 000000000..835cf6b6a --- /dev/null +++ b/MailCore.framework/Headers/MCValue.h @@ -0,0 +1,113 @@ +#ifndef MAILCORE_MCVALUE_H + +#define MAILCORE_MCVALUE_H + +#include + +#ifdef __cplusplus + +namespace mailcore { + + class String; + + enum { + ValueTypeNone, + ValueTypeBool, + ValueTypeChar, + ValueTypeUnsignedChar, + ValueTypeShort, + ValueTypeUnsignedShort, + ValueTypeInt, + ValueTypeUnsignedInt, + ValueTypeLong, + ValueTypeUnsignedLong, + ValueTypeLongLong, + ValueTypeUnsignedLongLong, + ValueTypeFloat, + ValueTypeDouble, + ValueTypePointer, + ValueTypeData, + }; + + class MAILCORE_EXPORT Value : public Object { + public: + virtual ~Value(); + + static Value * valueWithBoolValue(bool value); + static Value * valueWithCharValue(char value); + static Value * valueWithUnsignedCharValue(unsigned char value); + static Value * valueWithShortValue(short value); + static Value * valueWithUnsignedShortValue(unsigned short value); + static Value * valueWithIntValue(int value); + static Value * valueWithUnsignedIntValue(unsigned int value); + static Value * valueWithLongValue(long value); + static Value * valueWithUnsignedLongValue(unsigned long value); + static Value * valueWithLongLongValue(long long value); + static Value * valueWithUnsignedLongLongValue(unsigned long long value); + static Value * valueWithFloatValue(float value); + static Value * valueWithDoubleValue(double value); + static Value * valueWithPointerValue(void * value); + static Value * valueWithData(const char * value, int length); + + virtual bool boolValue(); + virtual char charValue(); + virtual unsigned char unsignedCharValue(); + virtual short shortValue(); + virtual unsigned short unsignedShortValue(); + virtual int intValue(); + virtual unsigned int unsignedIntValue(); + virtual long longValue(); + virtual unsigned long unsignedLongValue(); + virtual long long longLongValue(); + virtual unsigned long long unsignedLongLongValue(); + virtual float floatValue(); + virtual double doubleValue(); + virtual void * pointerValue(); + virtual void dataValue(const char ** p_value, int * p_length); + + public: // subclass behavior + Value(Value * other); + virtual String * description(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + Object * copy(); + virtual HashMap * serializable(); + virtual void importSerializable(HashMap * serializable); + + public: // private + static void * createObject(); + + private: + int mType; + union { + bool boolValue; + char charValue; + unsigned char unsignedCharValue; + short shortValue; + unsigned short unsignedShortValue; + int intValue; + unsigned int unsignedIntValue; + long longValue; + unsigned long unsignedLongValue; + long long longLongValue; + unsigned long long unsignedLongLongValue; + float floatValue; + double doubleValue; + void * pointerValue; + struct { + char * data; + int length; + } dataValue; + } mValue; + Value(); + + public: // private + virtual int type(); + + }; + +} + +#endif + +#endif diff --git a/MailCore.framework/Headers/MailCore.h b/MailCore.framework/Headers/MailCore.h new file mode 100644 index 000000000..8b0897f01 --- /dev/null +++ b/MailCore.framework/Headers/MailCore.h @@ -0,0 +1,17 @@ +// +// mailcore.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_MAILCORE_H + +#define MAILCORE_MAILCORE_H + +#include +#include +#include + +#endif diff --git a/MailCore.framework/Headers/NSArray+MCO.h b/MailCore.framework/Headers/NSArray+MCO.h new file mode 100644 index 000000000..fd0cc6ad2 --- /dev/null +++ b/MailCore.framework/Headers/NSArray+MCO.h @@ -0,0 +1,31 @@ +// +// NSArray+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSARRAY_MCO_H + +#define MAILCORE_NSARRAY_MCO_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class Array; +} +#endif + +@interface NSArray (MCO) + +#ifdef __cplusplus ++ (NSArray *) mco_arrayWithMCArray:(mailcore::Array *)array; + +- (mailcore::Array *) mco_mcArray; +#endif + +@end + +#endif diff --git a/MailCore.framework/Headers/NSData+MCO.h b/MailCore.framework/Headers/NSData+MCO.h new file mode 100644 index 000000000..ddb09595d --- /dev/null +++ b/MailCore.framework/Headers/NSData+MCO.h @@ -0,0 +1,31 @@ +// +// NSData+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/21/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSDATA_MCO_H + +#define MAILCORE_NSDATA_MCO_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class Data; +} +#endif + +@interface NSData (MCO) + +#ifdef __cplusplus ++ (NSData *) mco_dataWithMCData:(mailcore::Data *)cppData; + +- (mailcore::Data *) mco_mcData; +#endif + +@end + +#endif diff --git a/MailCore.framework/Headers/NSDictionary+MCO.h b/MailCore.framework/Headers/NSDictionary+MCO.h new file mode 100644 index 000000000..34798305d --- /dev/null +++ b/MailCore.framework/Headers/NSDictionary+MCO.h @@ -0,0 +1,31 @@ +// +// NSDictionary+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSDICTIONARY_MCO_H + +#define MAILCORE_NSDICTIONARY_MCO_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class HashMap; +} +#endif + +@interface NSDictionary (MCO) + +#ifdef __cplusplus ++ (NSDictionary *) mco_dictionaryWithMCHashMap:(mailcore::HashMap *)hashmap; + +- (mailcore::HashMap *) mco_mcHashMap; +#endif + +@end + +#endif \ No newline at end of file diff --git a/MailCore.framework/Headers/NSError+MCO.h b/MailCore.framework/Headers/NSError+MCO.h new file mode 100644 index 000000000..027796ea8 --- /dev/null +++ b/MailCore.framework/Headers/NSError+MCO.h @@ -0,0 +1,19 @@ +// +// Created by mronge on 1/31/13. +// + +#ifndef MAILCORE_NSERROR_MCO_H + +#define MAILCORE_NSERROR_MCO_H + +#import + +#import + +@interface NSError (MCO) +#ifdef __cplusplus ++ (NSError *) mco_errorWithErrorCode:(mailcore::ErrorCode)code; +#endif +@end + +#endif diff --git a/MailCore.framework/Headers/NSIndexSet+MCO.h b/MailCore.framework/Headers/NSIndexSet+MCO.h new file mode 100644 index 000000000..66aa5229c --- /dev/null +++ b/MailCore.framework/Headers/NSIndexSet+MCO.h @@ -0,0 +1,18 @@ +// +// NSIndexSet+MCO.h +// mailcore2 +// +// Created by Hoa V. DINH on 9/10/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import + +@class MCOIndexSet; + +@interface NSIndexSet (MCO) + +/** Returns a MCOIndexSet from an NSIndexSet */ +- (MCOIndexSet *) mcoIndexSet; + +@end diff --git a/MailCore.framework/Headers/NSObject+MCO.h b/MailCore.framework/Headers/NSObject+MCO.h new file mode 100644 index 000000000..923cc2632 --- /dev/null +++ b/MailCore.framework/Headers/NSObject+MCO.h @@ -0,0 +1,109 @@ +// +// NSObject+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSOBJECT_MCO_H + +#define MAILCORE_NSOBJECT_MCO_H + +#import + +#ifdef __cplusplus +#include +#endif + +#ifdef __cplusplus +namespace mailcore { + class Object; +} +#endif + +#define MCO_NATIVE_INSTANCE ((nativeType *) [self mco_mcObject]) + +#define MCO_TO_OBJC(mcValue) \ + [NSObject mco_objectWithMCObject:((mailcore::Object *) (mcValue))] + +#define MCO_FROM_OBJC(type, objcValue) \ + ((type *) [(objcValue) mco_mcObject]) + +#define MCO_OBJC_BRIDGE_SET(setter, mcValueType, objcValue) \ + MCO_NATIVE_INSTANCE->setter((mcValueType *) [(objcValue) mco_mcObject]) + +#define MCO_OBJC_BRIDGE_GET(getter) \ + [NSObject mco_objectWithMCObject:MCO_NATIVE_INSTANCE->getter()] + +#define MCO_OBJC_SYNTHESIZE_TYPE(objcType, mcType, setter, getter) \ +- (objcType *) getter \ +{ \ +return MCO_OBJC_BRIDGE_GET(getter); \ +} \ +\ +- (void) setter:(objcType *)getter \ +{ \ +MCO_OBJC_BRIDGE_SET(setter, mcType, getter); \ +} + +#define MCO_OBJC_SYNTHESIZE(type, setter, getter) \ + MCO_OBJC_SYNTHESIZE_TYPE(MCO ## type, mailcore::type, setter, getter) + +#define MCO_OBJC_SYNTHESIZE_SCALAR(objcType, mcType, setter, getter) \ +- (objcType) getter \ +{ \ +return (objcType) MCO_NATIVE_INSTANCE->getter(); \ +} \ +\ +- (void) setter:(objcType)getter \ +{ \ +MCO_NATIVE_INSTANCE->setter((mcType) getter); \ +} + +#define MCO_OBJC_SYNTHESIZE_STRING(setter, getter) MCO_OBJC_SYNTHESIZE_TYPE(NSString, mailcore::String, setter, getter) +#define MCO_OBJC_SYNTHESIZE_ARRAY(setter, getter) MCO_OBJC_SYNTHESIZE_TYPE(NSArray, mailcore::Array, setter, getter) +#define MCO_OBJC_SYNTHESIZE_DATA(setter, getter) MCO_OBJC_SYNTHESIZE_TYPE(NSData, mailcore::Data, setter, getter) +#define MCO_OBJC_SYNTHESIZE_HASHMAP(setter, getter) MCO_OBJC_SYNTHESIZE_TYPE(NSDictionary, mailcore::HashMap, setter, getter) +#define MCO_OBJC_SYNTHESIZE_BOOL(setter, getter) MCO_OBJC_SYNTHESIZE_SCALAR(BOOL, bool, setter, getter) + +#define MCO_OBJC_SYNTHESIZE_DATE(setter, getter) \ +- (NSDate *) getter \ +{ \ + return [NSDate dateWithTimeIntervalSince1970:MCO_NATIVE_INSTANCE->getter()]; \ +} \ +\ +- (void) setter:(NSDate *)getter \ +{ \ + MCO_NATIVE_INSTANCE->setter([getter timeIntervalSince1970]); \ +} + +#define MCO_SYNTHESIZE_NSCODING \ +- (id) initWithCoder:(NSCoder *)coder \ +{ \ + mailcore::HashMap * serializable = MCO_FROM_OBJC(mailcore::HashMap, [coder decodeObjectForKey:@"info"]); \ + self = MCO_TO_OBJC(mailcore::Object::objectWithSerializable(serializable)); \ + [self retain]; \ + return self; \ +} \ +\ +- (void) encodeWithCoder:(NSCoder *)coder \ +{ \ + [coder encodeObject:MCO_TO_OBJC(MCO_FROM_OBJC(nativeType, self)->serializable()) forKey:@"info"]; \ +} + +@interface NSObject (MCO) + +#ifdef __cplusplus ++ (id) mco_objectWithMCObject:(mailcore::Object *)object; + +- (mailcore::Object *) mco_mcObject; +#endif + +@end + +#ifdef __cplusplus +extern void MCORegisterClass(Class aClass, const std::type_info * info); +#endif + +#endif diff --git a/MailCore.framework/Headers/NSString+MCO.h b/MailCore.framework/Headers/NSString+MCO.h new file mode 100644 index 000000000..71e99a440 --- /dev/null +++ b/MailCore.framework/Headers/NSString+MCO.h @@ -0,0 +1,41 @@ +// +// NSString+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/21/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSSTRING_MCO_H + +#define MAILCORE_NSSTRING_MCO_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class String; + class Object; +} +#endif + +@interface NSString (MCO) + +#ifdef __cplusplus ++ (NSString *) mco_stringWithMCString:(mailcore::String *)cppString; ++ (NSString *) mco_stringWithMCObject:(mailcore::Object *)object; + +- (mailcore::String *) mco_mcString; +#endif + +- (NSString *) mco_flattenHTML; +- (NSString *) mco_flattenHTMLAndShowBlockquote:(BOOL)showBlockquote; +- (NSString *) mco_flattenHTMLAndShowBlockquote:(BOOL)showBlockquote showLink:(BOOL)showLink; + +- (NSString *) mco_htmlEncodedString; +- (NSString *) mco_cleanedHTMLString; +- (NSString *) mco_strippedWhitespace; + +@end + +#endif diff --git a/MailCore.framework/Headers/NSValue+MCO.h b/MailCore.framework/Headers/NSValue+MCO.h new file mode 100644 index 000000000..007662b7b --- /dev/null +++ b/MailCore.framework/Headers/NSValue+MCO.h @@ -0,0 +1,31 @@ +// +// NSValue+MCO.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/21/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef MAILCORE_NSVALUE_MCO_H + +#define MAILCORE_NSVALUE_MCO_H + +#import + +#ifdef __cplusplus +namespace mailcore { + class Value; +} +#endif + +@interface NSValue (MCO) + +#ifdef __cplusplus ++ (NSValue *) mco_valueWithMCValue:(mailcore::Value *)value; + +- (mailcore::Value *) mco_mcValue; +#endif + +@end + +#endif diff --git a/MailCore.framework/Info.plist b/MailCore.framework/Info.plist new file mode 100644 index 000000000..12b7acf33 Binary files /dev/null and b/MailCore.framework/Info.plist differ diff --git a/MailCore.framework/MailCore b/MailCore.framework/MailCore new file mode 100755 index 000000000..674af3c9b Binary files /dev/null and b/MailCore.framework/MailCore differ diff --git a/MailCore.framework/_CodeSignature/CodeResources b/MailCore.framework/_CodeSignature/CodeResources new file mode 100644 index 000000000..6342d5265 --- /dev/null +++ b/MailCore.framework/_CodeSignature/CodeResources @@ -0,0 +1,3370 @@ + + + + + files + + .DS_Store + + IX9RM5G+aOkDsst2ewLHKix4ka8= + + Headers/MCAbstract.h + + 701dlU8YygBYpfASJEVBy/htYAY= + + Headers/MCAbstractMessage.h + + eujN1pKQGbvIcNORUvN+2Mot/Hw= + + Headers/MCAbstractMessagePart.h + + JUGeaDs2PnvPu+L5GcPVeqGgqQc= + + Headers/MCAbstractMultipart.h + + j3xbQgj1ERQ1141DNvqUUVfTQ1k= + + Headers/MCAbstractPart.h + + OeWFo8lJtPFF/ml+aBln4qvQkK4= + + Headers/MCAccountValidator.h + + 8ys5+yAKVLCmNsF7oGSTsD0u58s= + + Headers/MCAddress.h + + ycCBrToNGEiNwBn7mvhF2d4is90= + + Headers/MCAddressDisplay.h + + J1uzuMHE0LbuK0CmjqX+XQlRUFs= + + Headers/MCArray.h + + rb0fBkLa2QuuxytDjkJNeh03ngQ= + + Headers/MCAssert.h + + jIy3/Rtze7Owvw2bm/9DJgTVTcI= + + Headers/MCAsync.h + + lzE4UCoRwxBdwq6YUMRCW6ISoNc= + + Headers/MCAsyncIMAP.h + + CcaUwBx6zl21e5quuG/K6yS1XqM= + + Headers/MCAsyncNNTP.h + + Zk+jrbGC0ozvZPDU+Ixveh3i3jc= + + Headers/MCAsyncPOP.h + + kz8dRQKAGUA18U+oh/lEBC0TvAM= + + Headers/MCAsyncSMTP.h + + 82a+1hrrDvp98buJnvZHIIdTeRw= + + Headers/MCAttachment.h + + 7SA3xHaHj5FXbiMqCF/pWAN7I1w= + + Headers/MCAutoreleasePool.h + + YHcYnFk5oKZAHd14xZWcTRm+HZw= + + Headers/MCBaseTypes.h + + BD8MPBLiar8H4yaXI+MiiFpG8zY= + + Headers/MCConnectionLogger.h + + YbwFnfK1wsyP0medyWNxmii9HM8= + + Headers/MCCore.h + + mcHuWUUEH0KLQ2/zTvnyz7MyP/k= + + Headers/MCData.h + + 8RSJRazfPrHi3nKEMnmMb4tiOU0= + + Headers/MCDateFormatter.h + + JyoIyLaUkWqtuJVEQhv0o6U34KU= + + Headers/MCHTMLCleaner.h + + mw3/R0uAfiwkzpxEnpSXQH1n3IU= + + Headers/MCHTMLRendererCallback.h + + kSnTslfH1AFwc3IRWQgsyzP4tcM= + + Headers/MCHash.h + + GpgFP/zRccOqFVLCWS4B3qWYOD4= + + Headers/MCHashMap.h + + gL2uY70ksrsUv0BT5COiHD0DwD4= + + Headers/MCICUTypes.h + + QvJB/mxTKv3ozJ4sPiz/Kp7EBBQ= + + Headers/MCIMAP.h + + evxSjRTK7kxaWDl4GBcIPESv2Hs= + + Headers/MCIMAPAppendMessageOperation.h + + yB6zlBdWWisM27lCObPDg+RAmzg= + + Headers/MCIMAPAsyncSession.h + + +ZIklxuQ5PBe20fQdQWFlYs0Zds= + + Headers/MCIMAPCapabilityOperation.h + + wbxR6HdZM2Nu0UCLC0jm6A1Z8X8= + + Headers/MCIMAPConnectOperation.h + + ymyfW+Pd17mjuaEQ8ehZDbw71tQ= + + Headers/MCIMAPCopyMessagesOperation.h + + J7lPHmFKHG+CXuGYhRD4dto3u/c= + + Headers/MCIMAPFetchContentOperation.h + + HNCx1Ei2aGVJzl09K9cZdeB2oa4= + + Headers/MCIMAPFetchFoldersOperation.h + + D2PATp/MKvSFaUcw8zJWz2X5VKw= + + Headers/MCIMAPFetchMessagesOperation.h + + sT+it383tSCSiJWsm0ggoKRYCik= + + Headers/MCIMAPFetchNamespaceOperation.h + + a0gVsf95wUCd8wO8/IuULAJVmS8= + + Headers/MCIMAPFetchParsedContentOperation.h + + TiVqaGWtzRYIOh4Ri9xNPKjGlno= + + Headers/MCIMAPFolder.h + + YOZ0iQJ08O9j8pUAwFncFwLGz5E= + + Headers/MCIMAPFolderInfo.h + + 3TBUvvwEm/HMTBZJe6A1AygTO4w= + + Headers/MCIMAPFolderInfoOperation.h + + /KbRn3NHQEU6PLiHUlPPhdxcfWk= + + Headers/MCIMAPFolderStatus.h + + XqWDojLB8NQ5V6gUUxLQPCpLbRo= + + Headers/MCIMAPFolderStatusOperation.h + + fouMlsOkgC7ei94F6uEQ3itYZK8= + + Headers/MCIMAPIdentity.h + + WeMR4l9bon6puhuP5JuVJb8oKEM= + + Headers/MCIMAPIdentityOperation.h + + chp6gdDAiMaQbvqL4Klso9VdA8E= + + Headers/MCIMAPIdleOperation.h + + B77sywNH1MC74O5CloksWic6A1A= + + Headers/MCIMAPMessage.h + + lcwyoi5SGK4LAzTN9H6kaejs/qE= + + Headers/MCIMAPMessagePart.h + + E4GrYyqa7cPH6UJAGsnTn3I662g= + + Headers/MCIMAPMessageRenderingOperation.h + + IbDPMvR/fuvtD2D142KevUXI4tk= + + Headers/MCIMAPMultipart.h + + LtZHKuIaXSNTKLFZzipxLOPNWhE= + + Headers/MCIMAPNamespace.h + + r2PIxFEd8ZQWkLXn09LlGWJ19FQ= + + Headers/MCIMAPNamespaceItem.h + + d9UCPlGEWpqAOCEqwEQmCS6g+6c= + + Headers/MCIMAPNoopOperation.h + + njDRti/tbaZeWXa6g96KSevkmik= + + Headers/MCIMAPOperation.h + + 0OoB6c4YvJC/xUCKBCvH3S6RKLU= + + Headers/MCIMAPOperationCallback.h + + Wc5uHcviyktOzXD+b7d6x1trmT4= + + Headers/MCIMAPPart.h + + PzB3/mddA02C+3e4rZNaGPujBJY= + + Headers/MCIMAPProgressCallback.h + + QU4cptqf6zr3QUD8f9HxxVfqOOE= + + Headers/MCIMAPQuotaOperation.h + + rW3qWkVZGTSoI8d6HcQ/zCWzi80= + + Headers/MCIMAPSearchExpression.h + + svohp1hNEhAPo+/zJqmzYnbirkc= + + Headers/MCIMAPSearchOperation.h + + QtpGsZPrIsn7wWw4VpTaZ3+ISwM= + + Headers/MCIMAPSession.h + + ih3NUfRInDwV/n2/L0DloAdBjwE= + + Headers/MCIMAPSyncResult.h + + 60JkH4u1t1Xj4hhGslmSA9Q7D/E= + + Headers/MCIndexSet.h + + dzQVuBpxb5im+NE9GZep0x/lluA= + + Headers/MCIterator.h + + KYCN191gwN8ZkBopVRyae9g8Sls= + + Headers/MCJSON.h + + CkUkQ/OhtEK92T0+x/WpyfnRX04= + + Headers/MCLibetpanTypes.h + + 1Vc7py+WBX/+fxofQB5DTkfh85c= + + Headers/MCLog.h + + ijJIeXPzxEusGL/qE/chrHudHow= + + Headers/MCMD5.h + + y7AoVrbv6pR7B2sFKkZSXEfT/84= + + Headers/MCMXRecordResolverOperation.h + + SAar+RoRYN1JmLpBYxpsx3/wKrU= + + Headers/MCMailProvider.h + + p+9Ox59knuHvtdbgIguKvK1qZro= + + Headers/MCMailProvidersManager.h + + cYCfbhKRLgyoj8P1CTctXDlkf5I= + + Headers/MCMainThread.h + + P+1GdUZe3gf48drCmH1nOzT56dg= + + Headers/MCMessageBuilder.h + + NuKDSkvZNv5YH8f3siGiFeRe2WA= + + Headers/MCMessageConstants.h + + qz8KjFad9mEUZPkVrdkD6DDEI6g= + + Headers/MCMessageHeader.h + + LLkxg38F6ybg7F0hzX22M0lCPTA= + + Headers/MCMessageParser.h + + 6hg6hscSqBNMys52GPprEaA5IOw= + + Headers/MCMessagePart.h + + IABN45neH/RF27d9Efr2aNU1KAM= + + Headers/MCMultipart.h + + ESwUVb5OgBgNlq8wppn8CJMS+Bg= + + Headers/MCNNTP.h + + afRA7GF1etD/s2AiTTM/mhDy7FA= + + Headers/MCNNTPAsyncSession.h + + N8ApQMOp6UrCrYTrwusKB4acaa4= + + Headers/MCNNTPCheckAccountOperation.h + + pgXiM3z7KDMDIw6iLjmVviPdHI4= + + Headers/MCNNTPFetchAllArticlesOperation.h + + VJIvhpZJEoqRGxeRQzM8VArlo60= + + Headers/MCNNTPFetchArticleOperation.h + + 9Mtcaa0E6jbQweDp/Fc5hjZx/1Y= + + Headers/MCNNTPFetchHeaderOperation.h + + AHGw7eu5JKtltbHfUyqzJhSwus0= + + Headers/MCNNTPFetchOverviewOperation.h + + eWYc50rexwQNSsvRSLbOJ5tBOGQ= + + Headers/MCNNTPFetchServerTimeOperation.h + + VZ4evN2+nR/nOBco3gX6kr5q3iA= + + Headers/MCNNTPGroupInfo.h + + V4aSG8qit6LwQiVVioLhNgJSKSs= + + Headers/MCNNTPListNewsgroupsOperation.h + + KA29+8kkgF45rIdL6LIJnKh0KdE= + + Headers/MCNNTPOperation.h + + lhtH6wIy8iZ+T2lSYBfPoYV/Qi8= + + Headers/MCNNTPOperationCallback.h + + 80eOeqITNdMBPCvXutrsRBbtzoE= + + Headers/MCNNTPProgressCallback.h + + yI5Hp5tNuHWsdHeTvbL4wtLQLXc= + + Headers/MCNNTPSession.h + + +Izovy+yN9d6IWIfLg3AgHgQNis= + + Headers/MCNetService.h + + KeYFe23CgDO4RDBDd6jymF6R0R4= + + Headers/MCNull.h + + 53hsiss3VXg2dHktf6NMpClsGSc= + + Headers/MCOAbstract.h + + +TJ8HnxrTA9i+5GAOkZa6aDdapw= + + Headers/MCOAbstractMessage.h + + WqaLmkQGz5ifPG1TfpPMTQLTCKk= + + Headers/MCOAbstractMessagePart.h + + p1kCksADjuHYGWlJzS5kBNlWn4Y= + + Headers/MCOAbstractMultipart.h + + v69cg60PIDirJmbs+ZTri13pJ80= + + Headers/MCOAbstractPart.h + + kJ4iTB2X/8RvINTPfHY8KQ0cG7k= + + Headers/MCOAccountValidator.h + + 3Nt+HkxPTIBmli81LyaQ40Ivlfg= + + Headers/MCOAddress.h + + oylidtDR0iwmNp0f5Y+d/ucrce8= + + Headers/MCOAttachment.h + + EDJ5IL/nTeKz0S82oAf9aIxeloc= + + Headers/MCOConstants.h + + 8p88dykDjtqbaP5rkDQFbhpVjQU= + + Headers/MCOHTMLRendererDelegate.h + + kFFhSkSDM7q0HtRABVk4GCqTO/w= + + Headers/MCOHTMLRendererIMAPDelegate.h + + 9jRkUxQjlC/mNu90acA6ibIWBec= + + Headers/MCOIMAP.h + + MRKwGfVSgQwQGV4/9zolInRPBL0= + + Headers/MCOIMAPAppendMessageOperation.h + + mEZx3/YgQF6qrGrsbbsGwIxuOjs= + + Headers/MCOIMAPBaseOperation.h + + +u9grEVJ4IfSKfauPKjKgWORULI= + + Headers/MCOIMAPCapabilityOperation.h + + dLN710vOwnISegj1s4DxwauHOhc= + + Headers/MCOIMAPCopyMessagesOperation.h + + uR+MOFqvD/4BNYZ8yRr2hFzg8wA= + + Headers/MCOIMAPFetchContentOperation.h + + sBpVhFQMqT3O3HOqsfuoQyF7mIg= + + Headers/MCOIMAPFetchFoldersOperation.h + + SrYxJKBdf6BKedz+K20Y1HHr0IM= + + Headers/MCOIMAPFetchMessagesOperation.h + + E4fVcJnLFwLvKrbW/+BWCw4+MIk= + + Headers/MCOIMAPFetchNamespaceOperation.h + + KmPLKCHz1bhw2aF9HCjxGUclWwA= + + Headers/MCOIMAPFetchParsedContentOperation.h + + DZ+kLZDwCRpUZmrOfSdreuMMiR4= + + Headers/MCOIMAPFolder.h + + IL5Z7D9q7bm0XEQELzNkhrUbFUg= + + Headers/MCOIMAPFolderInfo.h + + ZyCCulbHZ1vPoLzlY6BHdmeOzK0= + + Headers/MCOIMAPFolderInfoOperation.h + + al20I2lZYeVvpz0g3IUlUxFufhI= + + Headers/MCOIMAPFolderStatus.h + + YFja/PY3dDhT4jIvF8MjT8vKaCQ= + + Headers/MCOIMAPFolderStatusOperation.h + + YVG7yyYhEuIz5cN9+Le+3Jxn/cg= + + Headers/MCOIMAPIdentity.h + + XzZCpQzTOxuG/A2RFendP2obmog= + + Headers/MCOIMAPIdentityOperation.h + + 2ABeHhCKgRVmcCSvhOuLIPWTCrk= + + Headers/MCOIMAPIdleOperation.h + + a13PvDURIIXPKubho5e2/q70IUg= + + Headers/MCOIMAPMessage.h + + WZ++rp3TPPWlvZkmVIaO3gTWiEg= + + Headers/MCOIMAPMessagePart.h + + buR4PjmM/AkuSLQlVyVrq2g5Lh0= + + Headers/MCOIMAPMessageRenderingOperation.h + + cZUTh5YoyPudHQb6SA+dV5xz+I8= + + Headers/MCOIMAPMultipart.h + + mpif7e8os102BUsf/6I5Gpvqv6M= + + Headers/MCOIMAPNamespace.h + + +SaMMrtl6zhwwOnUopY6JBHlkd0= + + Headers/MCOIMAPNamespaceItem.h + + F1Qmt2uEM3zgEAP78gGa9HVQ7eY= + + Headers/MCOIMAPOperation.h + + dTrJU/LepMEAvib6IxeDlcJov8w= + + Headers/MCOIMAPPart.h + + fs/5C4e28tgEmEerJkR0h2ifgpU= + + Headers/MCOIMAPQuotaOperation.h + + psH8U7BVZ50ISeO8BbkMLsf/Emc= + + Headers/MCOIMAPSearchExpression.h + + 4wAa5PUZIhvRd89WFLrimTrHXM0= + + Headers/MCOIMAPSearchOperation.h + + 9vlUh/Hp2kJrtk/T9HLzibDV9d4= + + Headers/MCOIMAPSession.h + + LrWKftfFK5EMxVAlq+yNHeGvin4= + + Headers/MCOIndexSet.h + + uS1EAc5ltZk5APmmES/s289hBL4= + + Headers/MCOMailProvider.h + + w4SyEHxhfrFmelYDH60NF46HT6M= + + Headers/MCOMailProvidersManager.h + + T6ZtUiOVtGthatQgJqU+HQy8Tio= + + Headers/MCOMessageBuilder.h + + voN15O0GHqUQDNtwJ6KlnGcDtXY= + + Headers/MCOMessageHeader.h + + fqxIR7SDo9/Tv7WL4VqTju5uT8k= + + Headers/MCOMessageParser.h + + Ue8Dgg66+f0+KYic4T0jt2+iQqI= + + Headers/MCOMessagePart.h + + LJiu4l1KfH1+7SAWXtntTqSpx8k= + + Headers/MCOMultipart.h + + uKZlHi3zJxfRitzoMcf4EgIXo7U= + + Headers/MCONNTP.h + + 7X5pc78+B7aeUBlCz8X9Er8kPOI= + + Headers/MCONNTPDisconnectOperation.h + + juTjFbas6KnfVd7rnoUZACLVyGo= + + Headers/MCONNTPFetchAllArticlesOperation.h + + sKKHUptJ4E5qmQWooiNMkoYizXA= + + Headers/MCONNTPFetchArticleOperation.h + + 9XmsUe1euVPWgU2xJ7kAD4VSr7E= + + Headers/MCONNTPFetchHeaderOperation.h + + X/wh41IAsML98kIDEhpiilt+HBQ= + + Headers/MCONNTPFetchOverviewOperation.h + + ifAQZqvAf9ewUU35kvGpdNaQ8cA= + + Headers/MCONNTPFetchServerTimeOperation.h + + pklhczNSFiZ21VYNpSfXss5bN3A= + + Headers/MCONNTPGroupInfo.h + + Iia2q5gjAQ1sc+GCng3VTZZ3KUg= + + Headers/MCONNTPListNewsgroupsOperation.h + + ANlHhaiLnfFIQQVMABmIqipxmQg= + + Headers/MCONNTPOperation.h + + 5wjqsH0WuSvZe6YgtbK7rVlyM20= + + Headers/MCONNTPSession.h + + ytGlkncZO/PDN6xbvY6ISpN4Joo= + + Headers/MCONetService.h + + mnsDUFTQxcHVZB5r8YIGwskwG28= + + Headers/MCOObjectWrapper.h + + nCnuhlg+OsLyRBjOnyGsb40hbmw= + + Headers/MCOOperation.h + + JA07dh1gJMD5tQMsSDwgu7f0rJw= + + Headers/MCOPOP.h + + c2wZSI1kq5e4HgySZug9GcgaL6o= + + Headers/MCOPOPFetchHeaderOperation.h + + VpnWQF2K99Lji16CoH4dHEJU/cg= + + Headers/MCOPOPFetchMessageOperation.h + + IelvkxMBejuWBFDq4wmsVHBeLjc= + + Headers/MCOPOPFetchMessagesOperation.h + + A92oJJ1xCV965sO7bE5x0OQyDds= + + Headers/MCOPOPMessageInfo.h + + Dg37s++OzwRC3/pEBdlWxALAqLw= + + Headers/MCOPOPNoopOperation.h + + J3dLrXDcEk/JFwP0vzIe+QxJZdA= + + Headers/MCOPOPOperation.h + + BoV7M4/nolLgRXkJF/SBE1My9Vo= + + Headers/MCOPOPSession.h + + MSh6Ybc5l7x7BRe0f0aAWqKi5uo= + + Headers/MCOProvider.h + + 6pvcB2O9GZvpcEYqwCw4FWM9fgY= + + Headers/MCORFC822.h + + x6qVjHOwTvZbIRBHblYUv1i7PMg= + + Headers/MCORange.h + + //OFDbWdLYuwevSi1CIV/BEfNaE= + + Headers/MCOSMTP.h + + 9JlBEK9pqbJSVEDPB4GGjATtWO4= + + Headers/MCOSMTPLoginOperation.h + + 4MYVy/nAoZ1Vlu0/P9xAXQnCTQI= + + Headers/MCOSMTPOperation.h + + lcjqEeaAPvnK9MUPGI0UsdggLLc= + + Headers/MCOSMTPSendOperation.h + + x3ztUZGc2RJkTPA1Fy8KR6AeNPs= + + Headers/MCOSMTPSession.h + + fte/8vVpqxlYq80NbPF2oKBV/sY= + + Headers/MCOUtils.h + + 5w4csq6Qt/D9vKUTRD9xb/r4bIM= + + Headers/MCObjC.h + + y5cmZbXgrNr9Koa4P2dxwkKPsW4= + + Headers/MCObject.h + + TPUDAWt4CHLd0bbJAurn45lRdlo= + + Headers/MCOperation.h + + dWv1vxwoWhVrxzNxPWIM9CqWHjg= + + Headers/MCOperationCallback.h + + OMp+EMvH9p2S2EfrPdXyWJdh13Q= + + Headers/MCOperationQueue.h + + FnoCONAHJ1TA1KvnsiMD+xZ59Lw= + + Headers/MCPOP.h + + swIZfPk8uCXwLHRCJyiI7OFqJ+8= + + Headers/MCPOPAsyncSession.h + + 08jCNDNXqBA3KOs6ykBISzJ/ioY= + + Headers/MCPOPFetchHeaderOperation.h + + OG5qb71+0LRhlQFk5jFLIh6+RJw= + + Headers/MCPOPFetchMessageOperation.h + + hFXXpuMHAg67baG8jUDzbJHvpIY= + + Headers/MCPOPFetchMessagesOperation.h + + tbjwbUOFCqDay8Pe7AG0BR0OIjE= + + Headers/MCPOPMessageInfo.h + + ACgXDQV1EwWEe2L7kDXb2C367LA= + + Headers/MCPOPNoopOperation.h + + CtJ1FtMm8f/taAfJOPF+w31RdzE= + + Headers/MCPOPOperation.h + + 09mBdeRDFPMPiOpz67w74QN5ev4= + + Headers/MCPOPOperationCallback.h + + pNYgsmmfQr7EuLpMSQvRugn4ZMQ= + + Headers/MCPOPProgressCallback.h + + UXT4btWseJK79je5ljQ009BTjeo= + + Headers/MCPOPSession.h + + SsvylEYaO4SfOrSDuQkYRfM4NOc= + + Headers/MCProvider.h + + +Y/f2lh3OnlohLAw3TQ+FiVNSBk= + + Headers/MCRFC822.h + + +8zSbQVk0Dz2gvfmoiKZEJFHTo8= + + Headers/MCRange.h + + w6fWFhI56nvwuYofykxNX/nZZKM= + + Headers/MCRenderer.h + + 4upxHZFwamhWV8H7S3y5wO3C7zM= + + Headers/MCSMTP.h + + FpX3CX6VVJY+cWr1Gv0AYHr9mv8= + + Headers/MCSMTPAsyncSession.h + + fvROrYNJN2lCFQfbp86BRLHeu5Y= + + Headers/MCSMTPNoopOperation.h + + pNBHv/6DPqFHchKPoNk8GXxMh24= + + Headers/MCSMTPOperation.h + + WocelxX+HT4oAdQemaYho9Fu6JI= + + Headers/MCSMTPOperationCallback.h + + bITCDkkaa+HztIqdiryI14Pz+M8= + + Headers/MCSMTPProgressCallback.h + + hKDpezZzHYYw7RK6ngbCBsy+llQ= + + Headers/MCSMTPSession.h + + Nq26XqGzFFVfYjN/VRGRYmqnfso= + + Headers/MCSet.h + + UXOciRQOPbXon72NxNcF6+PjtRM= + + Headers/MCSizeFormatter.h + + PfLH/2rE/xYhvKtyswJhhQFU898= + + Headers/MCString.h + + 8Z3+rBN9we2cJlVDqT7MzWWEcSs= + + Headers/MCUtils.h + + ilGX+mynG6v0AmYu0e0gIJtAqrw= + + Headers/MCValue.h + + pg4c8ZtS3nPKHa7ppCas9tASOM0= + + Headers/MailCore.h + + 1H59Ohf6h7kCG7twvFyIcWhwiGc= + + Headers/NSArray+MCO.h + + 2QFFVpe1NycPYtFsCiU1HmmP3zw= + + Headers/NSData+MCO.h + + eIdAZYId+yJzTsPE0r3X93pNmT8= + + Headers/NSDictionary+MCO.h + + QIpiGQsYL8qjduw8L8ju4Mbv18U= + + Headers/NSError+MCO.h + + Gzy1mYevqFT+SasXyMdGg0eNS2w= + + Headers/NSIndexSet+MCO.h + + dsB3fKJDraf/Id3tZ9nJZ0kfcQw= + + Headers/NSObject+MCO.h + + ZMijcq8fseV38inegXfTr4VH/jI= + + Headers/NSString+MCO.h + + 4imNvGg2PvVG2y6ln8Fcp4mQCW4= + + Headers/NSValue+MCO.h + + CR4M2YnM9b9GT1w1m8Ue/KcdxjA= + + Info.plist + + NzC7Geh3UGGhYgR5Hc3zlqnRJpY= + + providers.json + + y4KncsIUbQX5DSizZ3HfqRo51mo= + + + files2 + + Headers/Headers + + symlink + Versions/Current/Headers + + Headers/MCAbstract.h + + hash + + 701dlU8YygBYpfASJEVBy/htYAY= + + hash2 + + MI18/RVO8QNAGQOV2/R+dp7JS9opAqawiB+aSHUx43E= + + + Headers/MCAbstractMessage.h + + hash + + eujN1pKQGbvIcNORUvN+2Mot/Hw= + + hash2 + + iy2neQgjNxFOorGAgIJHR9JqF898MxJI5ieD5n1GTjU= + + + Headers/MCAbstractMessagePart.h + + hash + + JUGeaDs2PnvPu+L5GcPVeqGgqQc= + + hash2 + + 78qKa1eb0tKjpRcK8RBIWYnRWV+8+E/My01DwLWV9II= + + + Headers/MCAbstractMultipart.h + + hash + + j3xbQgj1ERQ1141DNvqUUVfTQ1k= + + hash2 + + pgCRF52MWUBFwxZIwFk7iCTIsyq6sB/QrhXsi43jBWs= + + + Headers/MCAbstractPart.h + + hash + + OeWFo8lJtPFF/ml+aBln4qvQkK4= + + hash2 + + NrN3I/gk3beH8Ew6bszZ26SIQFX47hs3wNkhfk5mNqk= + + + Headers/MCAccountValidator.h + + hash + + 8ys5+yAKVLCmNsF7oGSTsD0u58s= + + hash2 + + FkOe/GNlh5FNGcVzJSUhm9lGMp4FYBpVbvq4HMpjebM= + + + Headers/MCAddress.h + + hash + + ycCBrToNGEiNwBn7mvhF2d4is90= + + hash2 + + gs7s8zKn3Hi/A3vxXmn44Q/h0lrpFzm1nr5KyipmP4U= + + + Headers/MCAddressDisplay.h + + hash + + J1uzuMHE0LbuK0CmjqX+XQlRUFs= + + hash2 + + +uDP8CIR7NTA+1Zy4GOjr1tAa1HZa9RJyQQ66UkkYl4= + + + Headers/MCArray.h + + hash + + rb0fBkLa2QuuxytDjkJNeh03ngQ= + + hash2 + + m2JGd8YyjgVfUxWH6ciLUvDIqcMv4VzV3NYaluWMZvY= + + + Headers/MCAssert.h + + hash + + jIy3/Rtze7Owvw2bm/9DJgTVTcI= + + hash2 + + 3t4J3JUxKB+Vho6zE6DrwtaYO8owWpm94jXcUmxk2LE= + + + Headers/MCAsync.h + + hash + + lzE4UCoRwxBdwq6YUMRCW6ISoNc= + + hash2 + + DvdQ/CmcjlW5Ja/+7wrtRHaqkxvLc5Nb8Doct0fDaqI= + + + Headers/MCAsyncIMAP.h + + hash + + CcaUwBx6zl21e5quuG/K6yS1XqM= + + hash2 + + Ix/uWqN5M9yzoJBl2WtH/94ESd+6dQJUjcAEXmidDyk= + + + Headers/MCAsyncNNTP.h + + hash + + Zk+jrbGC0ozvZPDU+Ixveh3i3jc= + + hash2 + + geKafrQ4ydufptH/W9PkPt8Bz2zx3nNgU41eVmKFb3c= + + + Headers/MCAsyncPOP.h + + hash + + kz8dRQKAGUA18U+oh/lEBC0TvAM= + + hash2 + + /KNVkQNHz3/qB9nzIp3ntavExqrDaj/+T4x7AO6I+O8= + + + Headers/MCAsyncSMTP.h + + hash + + 82a+1hrrDvp98buJnvZHIIdTeRw= + + hash2 + + XhU0N6Y4GK+8J20v6tWzQQWYhOsaguZIT6ZOqW5fxTc= + + + Headers/MCAttachment.h + + hash + + 7SA3xHaHj5FXbiMqCF/pWAN7I1w= + + hash2 + + wDImxaIWgSQHFGf4jpxXacGPo3vGKXnELY2U1LTCMO0= + + + Headers/MCAutoreleasePool.h + + hash + + YHcYnFk5oKZAHd14xZWcTRm+HZw= + + hash2 + + 8d4/8UPmijM9ZVYwE26Hvs6E+awx0InLQ7pfmmGYltg= + + + Headers/MCBaseTypes.h + + hash + + BD8MPBLiar8H4yaXI+MiiFpG8zY= + + hash2 + + XI0owxHcFJAl/LtQ4Fr8YA7oIfLRJOb9mjAQrSe0SOQ= + + + Headers/MCConnectionLogger.h + + hash + + YbwFnfK1wsyP0medyWNxmii9HM8= + + hash2 + + Nhpmyo6w11ATN/ox+l+gM3sH9Hhhxso52MYtXaqkRow= + + + Headers/MCCore.h + + hash + + mcHuWUUEH0KLQ2/zTvnyz7MyP/k= + + hash2 + + cqnIAbaz9LprdPIGpj9mMonCD4MrfwMAolT6dICGP9k= + + + Headers/MCData.h + + hash + + 8RSJRazfPrHi3nKEMnmMb4tiOU0= + + hash2 + + Vf/Jsn0tAQaImfns4eRKi+qeqoZcUE7txqdhi/adyIM= + + + Headers/MCDateFormatter.h + + hash + + JyoIyLaUkWqtuJVEQhv0o6U34KU= + + hash2 + + wrxRg2Lk/gBMu5P9aEWiVlCPuV/Jffb0uV49bcBw4oc= + + + Headers/MCHTMLCleaner.h + + hash + + mw3/R0uAfiwkzpxEnpSXQH1n3IU= + + hash2 + + 1Hsrih0e7yan6mdy2I+TAnQLT0f2bYW/GfnSPXWzvMg= + + + Headers/MCHTMLRendererCallback.h + + hash + + kSnTslfH1AFwc3IRWQgsyzP4tcM= + + hash2 + + L0bqdDZi9HcVFTRXS6DcEBF+b7MC/c7mwToefR6hZZg= + + + Headers/MCHash.h + + hash + + GpgFP/zRccOqFVLCWS4B3qWYOD4= + + hash2 + + 3quQG97iI+1k053gznjEoGehy5k587qoSDs5D+ogK3o= + + + Headers/MCHashMap.h + + hash + + gL2uY70ksrsUv0BT5COiHD0DwD4= + + hash2 + + +Mh+Bd4bhGwK0rg04PdHv4K7XxHLaEAV49w1xT6bDuo= + + + Headers/MCICUTypes.h + + hash + + QvJB/mxTKv3ozJ4sPiz/Kp7EBBQ= + + hash2 + + imkQvplSoOxs7E+5jJDrQmknX636x2nHOonLTygk30Y= + + + Headers/MCIMAP.h + + hash + + evxSjRTK7kxaWDl4GBcIPESv2Hs= + + hash2 + + dRlP0wmj/pegPhuzcfvLD+9dqx4EIpo7tFkilmb5JBk= + + + Headers/MCIMAPAppendMessageOperation.h + + hash + + yB6zlBdWWisM27lCObPDg+RAmzg= + + hash2 + + jigjKbYK5T+r8BtlmpvKMVLPzT4ap0484FV5wkK+Ub0= + + + Headers/MCIMAPAsyncSession.h + + hash + + +ZIklxuQ5PBe20fQdQWFlYs0Zds= + + hash2 + + EsKZFrUxhypuzvQSGUPSV6yNlDL3qoIExY71nV40LLs= + + + Headers/MCIMAPCapabilityOperation.h + + hash + + wbxR6HdZM2Nu0UCLC0jm6A1Z8X8= + + hash2 + + EJ6L+CJPHXovPua6B8IUDF84BhFcBpoCm8XAl5QCoWs= + + + Headers/MCIMAPConnectOperation.h + + hash + + ymyfW+Pd17mjuaEQ8ehZDbw71tQ= + + hash2 + + vYaqpYg0k3fn1f4WkSeZ5zfSoAQRzJw1Vhh3CTqORZk= + + + Headers/MCIMAPCopyMessagesOperation.h + + hash + + J7lPHmFKHG+CXuGYhRD4dto3u/c= + + hash2 + + mnc+BMFe2NZdBu3zTcIcJulQg540xHwCv+r6L7Iisso= + + + Headers/MCIMAPFetchContentOperation.h + + hash + + HNCx1Ei2aGVJzl09K9cZdeB2oa4= + + hash2 + + k19M8G/Dg+cyVwEiLAjSLPU2YDTT57SjUYyvL+6/0cg= + + + Headers/MCIMAPFetchFoldersOperation.h + + hash + + D2PATp/MKvSFaUcw8zJWz2X5VKw= + + hash2 + + J/idjQJpuQ27IrKLNyvzoM2cqiCSo+8HZS2lSqM458Y= + + + Headers/MCIMAPFetchMessagesOperation.h + + hash + + sT+it383tSCSiJWsm0ggoKRYCik= + + hash2 + + ksWrzPLLv83i/OGwOYkO51/XNnPU3jN7/G1jMuRqJl4= + + + Headers/MCIMAPFetchNamespaceOperation.h + + hash + + a0gVsf95wUCd8wO8/IuULAJVmS8= + + hash2 + + A59Nse5yBI5yWJItG6C6FC2A9qrwa8tJdwoEPQ0B0lc= + + + Headers/MCIMAPFetchParsedContentOperation.h + + hash + + TiVqaGWtzRYIOh4Ri9xNPKjGlno= + + hash2 + + ocl3uqYdoeZ8lqiH50l25GkAYHEqjHFnASW7xU+U+0o= + + + Headers/MCIMAPFolder.h + + hash + + YOZ0iQJ08O9j8pUAwFncFwLGz5E= + + hash2 + + 2KFR2j5V64JzTfANnBGkIwBOjyUHOOK197KvfIKqipU= + + + Headers/MCIMAPFolderInfo.h + + hash + + 3TBUvvwEm/HMTBZJe6A1AygTO4w= + + hash2 + + ZVGUtAwwP5OeLVFQtk96LkyE9jzFJYlj1ruWenGlSfY= + + + Headers/MCIMAPFolderInfoOperation.h + + hash + + /KbRn3NHQEU6PLiHUlPPhdxcfWk= + + hash2 + + jBqlG1h27B56Me9C0YY+qpMLgh0FP8HYZuQsWiIXv0Y= + + + Headers/MCIMAPFolderStatus.h + + hash + + XqWDojLB8NQ5V6gUUxLQPCpLbRo= + + hash2 + + p0x4MmSf94nXb4DfOpbemu7vxsh+XUhoP/xxX7Z9KTg= + + + Headers/MCIMAPFolderStatusOperation.h + + hash + + fouMlsOkgC7ei94F6uEQ3itYZK8= + + hash2 + + 2lvmDPWVqz9g1Fxmvw5ebDG+7lswz6B9R91l//jZ/90= + + + Headers/MCIMAPIdentity.h + + hash + + WeMR4l9bon6puhuP5JuVJb8oKEM= + + hash2 + + rBkDHSdRojoTgGxk3bl4uaJLQKECs9sXdx7zr5i2/B8= + + + Headers/MCIMAPIdentityOperation.h + + hash + + chp6gdDAiMaQbvqL4Klso9VdA8E= + + hash2 + + avJ0GH3sg7Bzj7bPhOv4LglJv0/naB4hKEBHg/bamcQ= + + + Headers/MCIMAPIdleOperation.h + + hash + + B77sywNH1MC74O5CloksWic6A1A= + + hash2 + + Hr/gNkvWsEO59w0v6Nnl65BHUajeI6coZJ6NFnmMzfA= + + + Headers/MCIMAPMessage.h + + hash + + lcwyoi5SGK4LAzTN9H6kaejs/qE= + + hash2 + + Nkf1Y48J5zdDN0mE9iRq9PPCPKbTtv1QmSDHesRvthQ= + + + Headers/MCIMAPMessagePart.h + + hash + + E4GrYyqa7cPH6UJAGsnTn3I662g= + + hash2 + + ss4ninwJMlXmoZbTUcccxN8gmP4UyxfDcpzdVvc7ohY= + + + Headers/MCIMAPMessageRenderingOperation.h + + hash + + IbDPMvR/fuvtD2D142KevUXI4tk= + + hash2 + + 8zvO2zDydoK2p7m1OSUOisgNC0JKElTR5EI1UStgw/k= + + + Headers/MCIMAPMultipart.h + + hash + + LtZHKuIaXSNTKLFZzipxLOPNWhE= + + hash2 + + fTYXK+6aba5UEMneauB/q35vA8C22PMuUxODCjgMEyA= + + + Headers/MCIMAPNamespace.h + + hash + + r2PIxFEd8ZQWkLXn09LlGWJ19FQ= + + hash2 + + NvopZuuMEOX8QUkr1Hm/d0zD6/7BjP8OduNpSV7UCpo= + + + Headers/MCIMAPNamespaceItem.h + + hash + + d9UCPlGEWpqAOCEqwEQmCS6g+6c= + + hash2 + + nq/PytMXuOyR1CnK/f81db2IiIYQrnxeftG7NZFIROo= + + + Headers/MCIMAPNoopOperation.h + + hash + + njDRti/tbaZeWXa6g96KSevkmik= + + hash2 + + wzicB/LRjJOVlXyLhg92C7SltV6nwlWDPmpnWvpJkY4= + + + Headers/MCIMAPOperation.h + + hash + + 0OoB6c4YvJC/xUCKBCvH3S6RKLU= + + hash2 + + oxpBmQkJMtI4yDvi04ksnB4tlNHM2EF1JEyxz119FME= + + + Headers/MCIMAPOperationCallback.h + + hash + + Wc5uHcviyktOzXD+b7d6x1trmT4= + + hash2 + + sptWWTx91ZhWTTP/jOEh6kHReWl64130IGBrLxbCHns= + + + Headers/MCIMAPPart.h + + hash + + PzB3/mddA02C+3e4rZNaGPujBJY= + + hash2 + + dtMfpD31w3zN9oMCr483F2J5wOJ6pILR53/v56N0q44= + + + Headers/MCIMAPProgressCallback.h + + hash + + QU4cptqf6zr3QUD8f9HxxVfqOOE= + + hash2 + + cSqQ/BD8XcNX4uLI5fgN8/G0BGu8knd9290D5ClN3Ms= + + + Headers/MCIMAPQuotaOperation.h + + hash + + rW3qWkVZGTSoI8d6HcQ/zCWzi80= + + hash2 + + lvxJZv0MVWL/R+oJf1fvtH1EfM/bCX/kBwZtNw11Iwo= + + + Headers/MCIMAPSearchExpression.h + + hash + + svohp1hNEhAPo+/zJqmzYnbirkc= + + hash2 + + o0MI+4Cr1BMPmyjiRmFyslBdwU5bZqMtohFJyr5HG4I= + + + Headers/MCIMAPSearchOperation.h + + hash + + QtpGsZPrIsn7wWw4VpTaZ3+ISwM= + + hash2 + + snhRYStVMdZ2NlZF0jJuYsgCsiV09Mseac9voVn1KKU= + + + Headers/MCIMAPSession.h + + hash + + ih3NUfRInDwV/n2/L0DloAdBjwE= + + hash2 + + 8Z1OBiCRezGxWD1fpmVinWUFh9ixSVt1Q8QZQgwVg0U= + + + Headers/MCIMAPSyncResult.h + + hash + + 60JkH4u1t1Xj4hhGslmSA9Q7D/E= + + hash2 + + NuumyG9wtdg8TfxGJF/gFPZhQqnqtaLp8Fq2oZHVMgg= + + + Headers/MCIndexSet.h + + hash + + dzQVuBpxb5im+NE9GZep0x/lluA= + + hash2 + + tNZQpvRrpV9bi4n2qjq8pWFIid/K6nOSFrdOD7RLexc= + + + Headers/MCIterator.h + + hash + + KYCN191gwN8ZkBopVRyae9g8Sls= + + hash2 + + bDdKUBrLjH0d33pvgHsFWCRZ3kcQeO5j4Npg5ZrsX00= + + + Headers/MCJSON.h + + hash + + CkUkQ/OhtEK92T0+x/WpyfnRX04= + + hash2 + + YAjVkCIijjYBDG+GgSt9Bc0uUocWPKE7MlKBxDk9bRw= + + + Headers/MCLibetpanTypes.h + + hash + + 1Vc7py+WBX/+fxofQB5DTkfh85c= + + hash2 + + TOvEKqwxMDYAVK0TVcEUhVo7ivQFO5bve5sZ9KHwNDs= + + + Headers/MCLog.h + + hash + + ijJIeXPzxEusGL/qE/chrHudHow= + + hash2 + + qCMEziYgpVGvCGEwwuXKtwDuqaXuwtvFr/wfqFbXwZ4= + + + Headers/MCMD5.h + + hash + + y7AoVrbv6pR7B2sFKkZSXEfT/84= + + hash2 + + Oa90j7UKMXUM9bzYaP09g+HPS2dX6iIL2S7Sp8tMEGU= + + + Headers/MCMXRecordResolverOperation.h + + hash + + SAar+RoRYN1JmLpBYxpsx3/wKrU= + + hash2 + + DuJPv3j7G8S3fxY+KxE/DWsxid0uk7ABGuODZjKFglE= + + + Headers/MCMailProvider.h + + hash + + p+9Ox59knuHvtdbgIguKvK1qZro= + + hash2 + + Cx0FaBgGiJb6YIQzSG+9S+Zk1gn+afjHZXV0oq6l/ho= + + + Headers/MCMailProvidersManager.h + + hash + + cYCfbhKRLgyoj8P1CTctXDlkf5I= + + hash2 + + X0Q4VL0vdnyoTmKtH0L3kEwFtbViNkDU6xyxhyT6y1A= + + + Headers/MCMainThread.h + + hash + + P+1GdUZe3gf48drCmH1nOzT56dg= + + hash2 + + WuFLJQvQww3NH98W8AK6Hufo7rLz3LkD3vTNRqdh3Jw= + + + Headers/MCMessageBuilder.h + + hash + + NuKDSkvZNv5YH8f3siGiFeRe2WA= + + hash2 + + 4kfJyw+HDFohNdOdWeW9+B+bUuS243AsIDge3e8Q+qQ= + + + Headers/MCMessageConstants.h + + hash + + qz8KjFad9mEUZPkVrdkD6DDEI6g= + + hash2 + + UDt3at8U+kFsUSW3tJenBwK0cKdR8p0beFQ1Or6B/hs= + + + Headers/MCMessageHeader.h + + hash + + LLkxg38F6ybg7F0hzX22M0lCPTA= + + hash2 + + gZLIPW6SmDKDUs3W26G3rL3tHi5u/KPKrTz7XcTyGNg= + + + Headers/MCMessageParser.h + + hash + + 6hg6hscSqBNMys52GPprEaA5IOw= + + hash2 + + KElXMTjaAPgvSG3Wnba0CCp9M6M6Sui5LmKT5f7OxU8= + + + Headers/MCMessagePart.h + + hash + + IABN45neH/RF27d9Efr2aNU1KAM= + + hash2 + + dgGsfxK+QB7t7tQf7Fen1gD7hOhYYS7pqo/+NS46yr4= + + + Headers/MCMultipart.h + + hash + + ESwUVb5OgBgNlq8wppn8CJMS+Bg= + + hash2 + + CxnmfyiAQ4EBSUoq6Dmnw7JAh2a0d6akcKh6JkmQU80= + + + Headers/MCNNTP.h + + hash + + afRA7GF1etD/s2AiTTM/mhDy7FA= + + hash2 + + fzSQrLnunu2aqFSKxC3uD/qt5USB5v9vHnL9cs1VWp4= + + + Headers/MCNNTPAsyncSession.h + + hash + + N8ApQMOp6UrCrYTrwusKB4acaa4= + + hash2 + + XAao5Bm+t8SRgOfo+Cp9CJGaLlKiQCcYr0fOqZdgec8= + + + Headers/MCNNTPCheckAccountOperation.h + + hash + + pgXiM3z7KDMDIw6iLjmVviPdHI4= + + hash2 + + u4F1nWCnuN1Wnpri46vl4mz2l9ankuWgaJCPhFT4NKQ= + + + Headers/MCNNTPFetchAllArticlesOperation.h + + hash + + VJIvhpZJEoqRGxeRQzM8VArlo60= + + hash2 + + ieCu87ok9VlwuwpEnJaqAKlM4CHajv2KWce9Lj8YlaU= + + + Headers/MCNNTPFetchArticleOperation.h + + hash + + 9Mtcaa0E6jbQweDp/Fc5hjZx/1Y= + + hash2 + + MnMpUiYg4LBJsXxckBDNBJMEA1ggAMwXdsHbVQ0H9tk= + + + Headers/MCNNTPFetchHeaderOperation.h + + hash + + AHGw7eu5JKtltbHfUyqzJhSwus0= + + hash2 + + bkCwcNDpzh7YTsyUqZ6RbDLYIssiaNyRXQWUcN2o7ME= + + + Headers/MCNNTPFetchOverviewOperation.h + + hash + + eWYc50rexwQNSsvRSLbOJ5tBOGQ= + + hash2 + + nDv5YxMqBoGDyC+s4smWfgz1IpTs1lbGEkhuhOjl04Y= + + + Headers/MCNNTPFetchServerTimeOperation.h + + hash + + VZ4evN2+nR/nOBco3gX6kr5q3iA= + + hash2 + + onAhxzYZIOgIzzzdNmb8fgOP9X4sBZyeFRlHPt4hDBs= + + + Headers/MCNNTPGroupInfo.h + + hash + + V4aSG8qit6LwQiVVioLhNgJSKSs= + + hash2 + + 5o9QB5Ik6nrREtLpNg33BPdobSEYt4QGVbLJ5NIhcyg= + + + Headers/MCNNTPListNewsgroupsOperation.h + + hash + + KA29+8kkgF45rIdL6LIJnKh0KdE= + + hash2 + + M/Wjw5B6pTfkiRI6pkJxQ486Dn8Gb6iS4haoCve3ouo= + + + Headers/MCNNTPOperation.h + + hash + + lhtH6wIy8iZ+T2lSYBfPoYV/Qi8= + + hash2 + + DYBWF71fzF0WDeV01hZqlfZUFda7FVZRd3wzHhlsTtQ= + + + Headers/MCNNTPOperationCallback.h + + hash + + 80eOeqITNdMBPCvXutrsRBbtzoE= + + hash2 + + fEQYR8UIC+XAGk1jtKW4N6NrpwzIZQFZvwczBztyzcg= + + + Headers/MCNNTPProgressCallback.h + + hash + + yI5Hp5tNuHWsdHeTvbL4wtLQLXc= + + hash2 + + f6XI5WtvwZSVlDhjf9RxMFkgxo+EM3iAWJP2+5pQYtY= + + + Headers/MCNNTPSession.h + + hash + + +Izovy+yN9d6IWIfLg3AgHgQNis= + + hash2 + + Gu9Y7JAetXM3lOLDCTpFZu+4oshaqttT8yLeraRgX2Y= + + + Headers/MCNetService.h + + hash + + KeYFe23CgDO4RDBDd6jymF6R0R4= + + hash2 + + yXf9SdC/0Obb2B+3+OPVEGx/f/xm6p6xadLny7GE9s4= + + + Headers/MCNull.h + + hash + + 53hsiss3VXg2dHktf6NMpClsGSc= + + hash2 + + MSIN0qDEQc3ob/QXfvacFYwHdSmdZKk5CTx9fMhO4NE= + + + Headers/MCOAbstract.h + + hash + + +TJ8HnxrTA9i+5GAOkZa6aDdapw= + + hash2 + + 5pXd+S5yqVxL9/XMHUais2vdjc805Vf+QBGe8qdzdPI= + + + Headers/MCOAbstractMessage.h + + hash + + WqaLmkQGz5ifPG1TfpPMTQLTCKk= + + hash2 + + ZJxZQMS+GBd91kcvnz6WokPHYZmDW1X1W89s+VEey1k= + + + Headers/MCOAbstractMessagePart.h + + hash + + p1kCksADjuHYGWlJzS5kBNlWn4Y= + + hash2 + + M/E1vTC+5joqwRAzsIz8A3qotR55mhPvmiMBdSmE/RA= + + + Headers/MCOAbstractMultipart.h + + hash + + v69cg60PIDirJmbs+ZTri13pJ80= + + hash2 + + LLOD0Rfs5zZrQNOWnGNlBXGSwGAerSgpxbfD8cJDEz4= + + + Headers/MCOAbstractPart.h + + hash + + kJ4iTB2X/8RvINTPfHY8KQ0cG7k= + + hash2 + + cvzZ0aSAwP0ECAHqqXOO0MCwe7OyqtgzANbd8xI3krk= + + + Headers/MCOAccountValidator.h + + hash + + 3Nt+HkxPTIBmli81LyaQ40Ivlfg= + + hash2 + + ShdVB3phaUiDwn/HlnO2g7UK5nZGOinBJfcmuFkYCIE= + + + Headers/MCOAddress.h + + hash + + oylidtDR0iwmNp0f5Y+d/ucrce8= + + hash2 + + ni96/omzGzDsqu0WUFGvwZy3xcLNcTWzxhrmLpFRDp4= + + + Headers/MCOAttachment.h + + hash + + EDJ5IL/nTeKz0S82oAf9aIxeloc= + + hash2 + + nYgyy6kNK3JMgWQ3XcOEzEsFRto6xFvZkGR5a1BlAHg= + + + Headers/MCOConstants.h + + hash + + 8p88dykDjtqbaP5rkDQFbhpVjQU= + + hash2 + + nj2Tf8vqJfxRAdS4/Qvxc/HJGIwJb28we4BQ3+XquJE= + + + Headers/MCOHTMLRendererDelegate.h + + hash + + kFFhSkSDM7q0HtRABVk4GCqTO/w= + + hash2 + + eBF3UcgNXVCwNB/XdtQXlJsaZRBLwUA1PMdmONBnZBA= + + + Headers/MCOHTMLRendererIMAPDelegate.h + + hash + + 9jRkUxQjlC/mNu90acA6ibIWBec= + + hash2 + + 16SaUQsVuAI71xdfxSk56eTeM4AWPw31/cJpZeb40Sk= + + + Headers/MCOIMAP.h + + hash + + MRKwGfVSgQwQGV4/9zolInRPBL0= + + hash2 + + eGR6Lr0YklUOyxMpvZbGEl+JW33612zl7jYoRVqjPIo= + + + Headers/MCOIMAPAppendMessageOperation.h + + hash + + mEZx3/YgQF6qrGrsbbsGwIxuOjs= + + hash2 + + AQ92zOfvf8zDqxp4JHyNyLmenu3/EtZwRmOHyRQ6vX0= + + + Headers/MCOIMAPBaseOperation.h + + hash + + +u9grEVJ4IfSKfauPKjKgWORULI= + + hash2 + + Auky8LHWYuHsSxbDIR3CLpcmvBcZttkAThI/9uo4GvQ= + + + Headers/MCOIMAPCapabilityOperation.h + + hash + + dLN710vOwnISegj1s4DxwauHOhc= + + hash2 + + rSa1u6TjH+VYEB9CSRBH8KR5Buqtoh0z0JdZp/FzaVs= + + + Headers/MCOIMAPCopyMessagesOperation.h + + hash + + uR+MOFqvD/4BNYZ8yRr2hFzg8wA= + + hash2 + + bwM2StgYlxyf4sYrYTSK5r/Dv83kJa4fF3VAavAoPHQ= + + + Headers/MCOIMAPFetchContentOperation.h + + hash + + sBpVhFQMqT3O3HOqsfuoQyF7mIg= + + hash2 + + AXLCEk8TsXN6tzMpiX1PPXFNWbmXpaCR3H2M4mo9S8Y= + + + Headers/MCOIMAPFetchFoldersOperation.h + + hash + + SrYxJKBdf6BKedz+K20Y1HHr0IM= + + hash2 + + l5cKg9MP6LAlCIS2gccKJrzZwZ4NOkavhLBdyubDF6Y= + + + Headers/MCOIMAPFetchMessagesOperation.h + + hash + + E4fVcJnLFwLvKrbW/+BWCw4+MIk= + + hash2 + + 7WRReMXgb1BFZEpmf+ZLxYsL6DJarWHAXE/qvYquHwY= + + + Headers/MCOIMAPFetchNamespaceOperation.h + + hash + + KmPLKCHz1bhw2aF9HCjxGUclWwA= + + hash2 + + Lb59GlhNqDNy56Q67RruBpXyMw9QcLjBZDjAyDQMqPY= + + + Headers/MCOIMAPFetchParsedContentOperation.h + + hash + + DZ+kLZDwCRpUZmrOfSdreuMMiR4= + + hash2 + + UN0R1wDd74wtRo4hQ5G6/M/EOUe7U9JNnGSLLzHy6Xs= + + + Headers/MCOIMAPFolder.h + + hash + + IL5Z7D9q7bm0XEQELzNkhrUbFUg= + + hash2 + + meKD9mX5rYvlM3LNZ+fxXhS6lL14H7brsdGu1Sm4XMo= + + + Headers/MCOIMAPFolderInfo.h + + hash + + ZyCCulbHZ1vPoLzlY6BHdmeOzK0= + + hash2 + + bSsMpBjrpiOxeaCVgGmx6k2qlepIrchfiiXDaqu41f8= + + + Headers/MCOIMAPFolderInfoOperation.h + + hash + + al20I2lZYeVvpz0g3IUlUxFufhI= + + hash2 + + wSjLgBqaRamTVz6xch8Vwj0V2VsIfHgdTmTVcvbz+cM= + + + Headers/MCOIMAPFolderStatus.h + + hash + + YFja/PY3dDhT4jIvF8MjT8vKaCQ= + + hash2 + + lCsrefSDOpqy1m0fTR+218awdzHravbhGCkYg0n7LJI= + + + Headers/MCOIMAPFolderStatusOperation.h + + hash + + YVG7yyYhEuIz5cN9+Le+3Jxn/cg= + + hash2 + + /iZRMyXDuehf6+1g6D60lnqJG+uLDuAcD5fPvK06Myk= + + + Headers/MCOIMAPIdentity.h + + hash + + XzZCpQzTOxuG/A2RFendP2obmog= + + hash2 + + bE6+7glFDF+c6bIeO0QHsclMzJKoLl4ZpJ142dh/0kE= + + + Headers/MCOIMAPIdentityOperation.h + + hash + + 2ABeHhCKgRVmcCSvhOuLIPWTCrk= + + hash2 + + M2wqTrYHj/1fVGZ0vhvE2KVO2fOJmaebhtdzQep0QmY= + + + Headers/MCOIMAPIdleOperation.h + + hash + + a13PvDURIIXPKubho5e2/q70IUg= + + hash2 + + jE6KR4pPy8+9AWkaIgPDGMnAcThAQZmaWUNJyGvmXZA= + + + Headers/MCOIMAPMessage.h + + hash + + WZ++rp3TPPWlvZkmVIaO3gTWiEg= + + hash2 + + 2VZVOoeeSV+b516Mr6JODLSWn+85hWiLWVu9nUaLCH8= + + + Headers/MCOIMAPMessagePart.h + + hash + + buR4PjmM/AkuSLQlVyVrq2g5Lh0= + + hash2 + + SE24r4zra+mqwkeMEzFcFrFkpd86dbJoEeUgRngcSgY= + + + Headers/MCOIMAPMessageRenderingOperation.h + + hash + + cZUTh5YoyPudHQb6SA+dV5xz+I8= + + hash2 + + ukGOeqMgCN9SzuZGWB9f0nAsveAxw/gmYbC041rHNaw= + + + Headers/MCOIMAPMultipart.h + + hash + + mpif7e8os102BUsf/6I5Gpvqv6M= + + hash2 + + btv1gX2/5Q3I6HheRJ+1JBJMuPFxN+51iL+gzvD5Cx0= + + + Headers/MCOIMAPNamespace.h + + hash + + +SaMMrtl6zhwwOnUopY6JBHlkd0= + + hash2 + + hOW8dxVJKvUbBl9w/Of0BIlxeo3deajpAYkOhITeDWg= + + + Headers/MCOIMAPNamespaceItem.h + + hash + + F1Qmt2uEM3zgEAP78gGa9HVQ7eY= + + hash2 + + 05HowR9Yi7fEhk8YuYKnHhzIZVeVx1KG13zBRU7Rn8Y= + + + Headers/MCOIMAPOperation.h + + hash + + dTrJU/LepMEAvib6IxeDlcJov8w= + + hash2 + + LMuH9mpiB5wOpg8cC6rePqK6M8F0zND6SiybniARJfQ= + + + Headers/MCOIMAPPart.h + + hash + + fs/5C4e28tgEmEerJkR0h2ifgpU= + + hash2 + + Wx9Sobut+OxR/ecHd21TODurViXJyb44WnQLVHwDkFU= + + + Headers/MCOIMAPQuotaOperation.h + + hash + + psH8U7BVZ50ISeO8BbkMLsf/Emc= + + hash2 + + lvPAL5a3HAJTh4wyI6+1v040c3yY/mQJi9Ct830Vv38= + + + Headers/MCOIMAPSearchExpression.h + + hash + + 4wAa5PUZIhvRd89WFLrimTrHXM0= + + hash2 + + 4M+ORsOmBn3nt4+EkGysbWP2Gm0oYK7LSXVVMa+BDj0= + + + Headers/MCOIMAPSearchOperation.h + + hash + + 9vlUh/Hp2kJrtk/T9HLzibDV9d4= + + hash2 + + dabQnUdvMJRXDlKO97BhwXGX+qprzhW3TkNwT2zHvp8= + + + Headers/MCOIMAPSession.h + + hash + + LrWKftfFK5EMxVAlq+yNHeGvin4= + + hash2 + + p+3E41fgc+U/hCSTepvSRMkg5Wu2KqPUoGNGXyryrDo= + + + Headers/MCOIndexSet.h + + hash + + uS1EAc5ltZk5APmmES/s289hBL4= + + hash2 + + JVGZWldFuq61oGfuVjwt8rOaFbJXzq9gtW2BWa3Kopw= + + + Headers/MCOMailProvider.h + + hash + + w4SyEHxhfrFmelYDH60NF46HT6M= + + hash2 + + OGJnIsfVMnuChZyRqJvYuxf0mGRWP/2lT2qRrdfQ8FE= + + + Headers/MCOMailProvidersManager.h + + hash + + T6ZtUiOVtGthatQgJqU+HQy8Tio= + + hash2 + + vF/wVPmR6Jx1cVptNaGxI4DZQtSCQ2mw67vji4pKzUU= + + + Headers/MCOMessageBuilder.h + + hash + + voN15O0GHqUQDNtwJ6KlnGcDtXY= + + hash2 + + O86teRPup0szu7QoiUxcU0A+4/rH+l+eCeQczdYA+Wg= + + + Headers/MCOMessageHeader.h + + hash + + fqxIR7SDo9/Tv7WL4VqTju5uT8k= + + hash2 + + RpL1UKQOdLHx0E2bmcvSY2clJGjkAV3ladqYxZoRagM= + + + Headers/MCOMessageParser.h + + hash + + Ue8Dgg66+f0+KYic4T0jt2+iQqI= + + hash2 + + +PtB19WoqTl0QsGHTv870uFEWnVeBHmj7UzoTcr9A18= + + + Headers/MCOMessagePart.h + + hash + + LJiu4l1KfH1+7SAWXtntTqSpx8k= + + hash2 + + TeDqFL+OVqkI8GgtNHQzsWaQycn0/u15pibyClSufTY= + + + Headers/MCOMultipart.h + + hash + + uKZlHi3zJxfRitzoMcf4EgIXo7U= + + hash2 + + AOcE0bHrHcS8UwVHPFOPtDK0toqC6WdUjItQmF6E2Bs= + + + Headers/MCONNTP.h + + hash + + 7X5pc78+B7aeUBlCz8X9Er8kPOI= + + hash2 + + nDaSAiylypGUvwtfrF7I3hB5o/FKQq/QQNSIcKwK6X4= + + + Headers/MCONNTPDisconnectOperation.h + + hash + + juTjFbas6KnfVd7rnoUZACLVyGo= + + hash2 + + 5fex63B2ODaABo0VL+eDhjcMHV3bFrDXoHFKOfHZDYU= + + + Headers/MCONNTPFetchAllArticlesOperation.h + + hash + + sKKHUptJ4E5qmQWooiNMkoYizXA= + + hash2 + + p31qYyK/5d3+k8ItCaFtKsf22ddIxam3djaGxPyGwFQ= + + + Headers/MCONNTPFetchArticleOperation.h + + hash + + 9XmsUe1euVPWgU2xJ7kAD4VSr7E= + + hash2 + + s59zS2D/F161F0gGYx/WN4w3xlLKdVdfNNeyKx9G7R0= + + + Headers/MCONNTPFetchHeaderOperation.h + + hash + + X/wh41IAsML98kIDEhpiilt+HBQ= + + hash2 + + 5LhrI3hoA45kQc4XiYpZQLqlK02xbPLP0jHMUa1rI5E= + + + Headers/MCONNTPFetchOverviewOperation.h + + hash + + ifAQZqvAf9ewUU35kvGpdNaQ8cA= + + hash2 + + 52MJcj5So3GwR5ZNHLxZkyTg5WMWma85W28DZvkLLnE= + + + Headers/MCONNTPFetchServerTimeOperation.h + + hash + + pklhczNSFiZ21VYNpSfXss5bN3A= + + hash2 + + Lxc7G/Xtoeb/Kfv1zKyH7wGEtL1Mj4hO/6Aqgd/crMU= + + + Headers/MCONNTPGroupInfo.h + + hash + + Iia2q5gjAQ1sc+GCng3VTZZ3KUg= + + hash2 + + tqKis9Tl1g910TSKxhHukLhEBpndiBWCsxftlLX7ea8= + + + Headers/MCONNTPListNewsgroupsOperation.h + + hash + + ANlHhaiLnfFIQQVMABmIqipxmQg= + + hash2 + + XiCYJDJZdpVtnwJwkzy1eAAR0gpJZs5HitP1Gg9s/7c= + + + Headers/MCONNTPOperation.h + + hash + + 5wjqsH0WuSvZe6YgtbK7rVlyM20= + + hash2 + + p4xQ73ncsz784n+NmUEnYN+NIZqL0VQuxY2dpPk0e3o= + + + Headers/MCONNTPSession.h + + hash + + ytGlkncZO/PDN6xbvY6ISpN4Joo= + + hash2 + + 0d56OrutycddFi+LCtO7T1/la+r3T7rsTQCTVt6twic= + + + Headers/MCONetService.h + + hash + + mnsDUFTQxcHVZB5r8YIGwskwG28= + + hash2 + + jVkgRNXsp/xNvbBdUIhFZXZiEBktbbWDfRQhNVdxk/Y= + + + Headers/MCOObjectWrapper.h + + hash + + nCnuhlg+OsLyRBjOnyGsb40hbmw= + + hash2 + + NTnqXt4ydPZj3TG5riybQNMD8yG5UrRS+0ZcqTMxADY= + + + Headers/MCOOperation.h + + hash + + JA07dh1gJMD5tQMsSDwgu7f0rJw= + + hash2 + + BCLzU0BDPQOM5ZaiTaVn5o5XV1j1mTyX87zKrytvz6s= + + + Headers/MCOPOP.h + + hash + + c2wZSI1kq5e4HgySZug9GcgaL6o= + + hash2 + + fvyS3LbDksGbusgDelq4Cga3IlqZup4p/cF1fE9H67E= + + + Headers/MCOPOPFetchHeaderOperation.h + + hash + + VpnWQF2K99Lji16CoH4dHEJU/cg= + + hash2 + + bxd2uqo7aEYjqQDG5yXvSeZ566NjJFq8W7o8Xe2DtH4= + + + Headers/MCOPOPFetchMessageOperation.h + + hash + + IelvkxMBejuWBFDq4wmsVHBeLjc= + + hash2 + + t4YMxcgxqn/0/IkP0Av7Bi68iLcJ3sNvvV6x84C6nMo= + + + Headers/MCOPOPFetchMessagesOperation.h + + hash + + A92oJJ1xCV965sO7bE5x0OQyDds= + + hash2 + + jzDkr6YLbIv9+mZVrDgUDLHSIWY+WvgKdp45vEWBQIs= + + + Headers/MCOPOPMessageInfo.h + + hash + + Dg37s++OzwRC3/pEBdlWxALAqLw= + + hash2 + + v6lN0tGSoeNwE+SYcBMuAVPLwSDUdjVpWrldwS95dRY= + + + Headers/MCOPOPNoopOperation.h + + hash + + J3dLrXDcEk/JFwP0vzIe+QxJZdA= + + hash2 + + OilP04DbkIZI3/ZiYPx3X6Zv8g6ppGfnOI5/iVQzfOw= + + + Headers/MCOPOPOperation.h + + hash + + BoV7M4/nolLgRXkJF/SBE1My9Vo= + + hash2 + + YRaGh0iewIlBdrR8VITYM0cF9i/KT1hnyMWU5eDdh1E= + + + Headers/MCOPOPSession.h + + hash + + MSh6Ybc5l7x7BRe0f0aAWqKi5uo= + + hash2 + + BezULQ6mEQ5u0VRuimr4eAFmQxlFHPxmxjbcFKIbl7w= + + + Headers/MCOProvider.h + + hash + + 6pvcB2O9GZvpcEYqwCw4FWM9fgY= + + hash2 + + Nuc+YAghykzvOdjIdkPo8u+BeyO+9Xnk1hQvS9Ztq0A= + + + Headers/MCORFC822.h + + hash + + x6qVjHOwTvZbIRBHblYUv1i7PMg= + + hash2 + + n3jm6WZDJSCCu4m+VqZ5CmZJHl7ztJO7WBOnhns8mWw= + + + Headers/MCORange.h + + hash + + //OFDbWdLYuwevSi1CIV/BEfNaE= + + hash2 + + QMAl/QOWifGWpj6x5boMBiWxqxr1WFziHGhHJIzD4jg= + + + Headers/MCOSMTP.h + + hash + + 9JlBEK9pqbJSVEDPB4GGjATtWO4= + + hash2 + + k4KFCZZk+GCWY14024zF/u4zxsODqO2TZcplC4UrvRM= + + + Headers/MCOSMTPLoginOperation.h + + hash + + 4MYVy/nAoZ1Vlu0/P9xAXQnCTQI= + + hash2 + + Vgh+PnFF9fF1LBc0g1+CbMomKJ72fEqfSubLOxubnmU= + + + Headers/MCOSMTPOperation.h + + hash + + lcjqEeaAPvnK9MUPGI0UsdggLLc= + + hash2 + + xuTDZY7K4Fw34vbQgXbajQQOQpcS1yUzeoCN3lIBFlk= + + + Headers/MCOSMTPSendOperation.h + + hash + + x3ztUZGc2RJkTPA1Fy8KR6AeNPs= + + hash2 + + j6JV/jT1zxYR4/iWrtbf9OiTw8LZMKuyQvDaJUMY1M0= + + + Headers/MCOSMTPSession.h + + hash + + fte/8vVpqxlYq80NbPF2oKBV/sY= + + hash2 + + Xirqly4rM10PcydFiBJPKgeZMJGKpLOgg7A7Hgb8j3s= + + + Headers/MCOUtils.h + + hash + + 5w4csq6Qt/D9vKUTRD9xb/r4bIM= + + hash2 + + waO6ZK8acWYmLJAoQ/+zge/IBA2uN909xneKGOV/oW0= + + + Headers/MCObjC.h + + hash + + y5cmZbXgrNr9Koa4P2dxwkKPsW4= + + hash2 + + wJdZEdP+ZPu6usJIyYSDngmlDsDt+FxTkAYMOzHQzXs= + + + Headers/MCObject.h + + hash + + TPUDAWt4CHLd0bbJAurn45lRdlo= + + hash2 + + bk2pw32i4ItLW8JlAb1IUjAB1jvEeOWhc9YbGWsrbkw= + + + Headers/MCOperation.h + + hash + + dWv1vxwoWhVrxzNxPWIM9CqWHjg= + + hash2 + + 8jkaxE3GoiJDW7V7sxeh4XBpIjh+yqF9BRa2q6OyEvM= + + + Headers/MCOperationCallback.h + + hash + + OMp+EMvH9p2S2EfrPdXyWJdh13Q= + + hash2 + + wSJG05+OEnISHgkGLJaPMyNPylp80WyUA3IvEqd1Rqk= + + + Headers/MCOperationQueue.h + + hash + + FnoCONAHJ1TA1KvnsiMD+xZ59Lw= + + hash2 + + OaZPRoM0jEleh0GIHdTiIqE3qXFAGPghiHLJlKHvCWo= + + + Headers/MCPOP.h + + hash + + swIZfPk8uCXwLHRCJyiI7OFqJ+8= + + hash2 + + iaWlhbokY9FkkiJn8aWaQFhnMzPlDMQc4GBAQv0iGhM= + + + Headers/MCPOPAsyncSession.h + + hash + + 08jCNDNXqBA3KOs6ykBISzJ/ioY= + + hash2 + + 7onU6KgVaApMRpdPaQI/syzxVGSDJZmeeXSUey55Dp4= + + + Headers/MCPOPFetchHeaderOperation.h + + hash + + OG5qb71+0LRhlQFk5jFLIh6+RJw= + + hash2 + + j6Hj4p/YP/OfzgdowtoWeLNfrdb1g3WOARiobcG1U8E= + + + Headers/MCPOPFetchMessageOperation.h + + hash + + hFXXpuMHAg67baG8jUDzbJHvpIY= + + hash2 + + IxTej2BksS0m7rJaRdrevmiw8bZ0itOsiGcH2Xj2uUw= + + + Headers/MCPOPFetchMessagesOperation.h + + hash + + tbjwbUOFCqDay8Pe7AG0BR0OIjE= + + hash2 + + F7E5OTGpsgW7CW6pTn4NfjKuwLEhfdndRU/JVyAP8KU= + + + Headers/MCPOPMessageInfo.h + + hash + + ACgXDQV1EwWEe2L7kDXb2C367LA= + + hash2 + + lAVkNeuOhi2kR2aHdDGUExXqW9sUU9w2QI6rqhavju0= + + + Headers/MCPOPNoopOperation.h + + hash + + CtJ1FtMm8f/taAfJOPF+w31RdzE= + + hash2 + + ZZ5l171rW0coJEQBcvg7S5kDtNWVW7fVtQGBIeSBLTs= + + + Headers/MCPOPOperation.h + + hash + + 09mBdeRDFPMPiOpz67w74QN5ev4= + + hash2 + + FAWjeFS7HoAoxNpaJU1d5ILCmOlWsueXXYP7JpPeHZ0= + + + Headers/MCPOPOperationCallback.h + + hash + + pNYgsmmfQr7EuLpMSQvRugn4ZMQ= + + hash2 + + 6vj5RL4Hfdzgy0cuaJOZ6PrHWd4ZOP6BVnDCWnL36bs= + + + Headers/MCPOPProgressCallback.h + + hash + + UXT4btWseJK79je5ljQ009BTjeo= + + hash2 + + fBGnj8S9sioPUH92xNkC6GO55P6rmSj/BYIb6U0jl+4= + + + Headers/MCPOPSession.h + + hash + + SsvylEYaO4SfOrSDuQkYRfM4NOc= + + hash2 + + mcTe270spiSCJYmExkAjNQf3UbDFpI6x7NfEhWfsoRo= + + + Headers/MCProvider.h + + hash + + +Y/f2lh3OnlohLAw3TQ+FiVNSBk= + + hash2 + + wfZJ0WFCq6/QqtgLGFygUgHPTJSfh/bJl5nP7KxY4jI= + + + Headers/MCRFC822.h + + hash + + +8zSbQVk0Dz2gvfmoiKZEJFHTo8= + + hash2 + + DkoiCzHgQbq7KrO18SKKqj3rhI79Fm+nJrYtbTFTOXk= + + + Headers/MCRange.h + + hash + + w6fWFhI56nvwuYofykxNX/nZZKM= + + hash2 + + e2R3gT77cYA3NAMmVjuGgQF4pgffPujLnJXwqcM3+H8= + + + Headers/MCRenderer.h + + hash + + 4upxHZFwamhWV8H7S3y5wO3C7zM= + + hash2 + + /ikRLa3H2vmEC9afWzQISe6xty1tl7WyIQ2yTEkxVRA= + + + Headers/MCSMTP.h + + hash + + FpX3CX6VVJY+cWr1Gv0AYHr9mv8= + + hash2 + + EHLP5LLjMh9C6XxKXQh/al3W8s7lnDP8gyFlTZRkUwA= + + + Headers/MCSMTPAsyncSession.h + + hash + + fvROrYNJN2lCFQfbp86BRLHeu5Y= + + hash2 + + 3KwJy8UObsTEVCQiuUk4I0RKHBfE1NZ8OyvCA9qd4X4= + + + Headers/MCSMTPNoopOperation.h + + hash + + pNBHv/6DPqFHchKPoNk8GXxMh24= + + hash2 + + mCwcnS0ZC/5NmBigHbfc31tdvI0A5m4/raDwpELXp5w= + + + Headers/MCSMTPOperation.h + + hash + + WocelxX+HT4oAdQemaYho9Fu6JI= + + hash2 + + EqpbSHI7uDJstdjxw89d0+ba75CJ5ySQNtyB3Rh0PEQ= + + + Headers/MCSMTPOperationCallback.h + + hash + + bITCDkkaa+HztIqdiryI14Pz+M8= + + hash2 + + R44Png9IEMBeC8fhkdqV0uFizaxFSwAU7VYzWK58ftQ= + + + Headers/MCSMTPProgressCallback.h + + hash + + hKDpezZzHYYw7RK6ngbCBsy+llQ= + + hash2 + + VMxsxFmMtVpH4pFcOo2vGBY5i9i9JvsRV1jxBT67rJU= + + + Headers/MCSMTPSession.h + + hash + + Nq26XqGzFFVfYjN/VRGRYmqnfso= + + hash2 + + vQufEogX/rbUuP1PC4B4RvqhgEM8Ew6taiySMKnp8zU= + + + Headers/MCSet.h + + hash + + UXOciRQOPbXon72NxNcF6+PjtRM= + + hash2 + + iGK+nt9rtEAn2GA4LXQyMRjk+HC57qqUMcxsmiWTLFs= + + + Headers/MCSizeFormatter.h + + hash + + PfLH/2rE/xYhvKtyswJhhQFU898= + + hash2 + + cKiN36XzHLMqeRe3CDSpV8YPkuq2k/nDr6L6lwPc49c= + + + Headers/MCString.h + + hash + + 8Z3+rBN9we2cJlVDqT7MzWWEcSs= + + hash2 + + tJnll/eWvOhwp2yWIdD5mBPcIzjyJ5Yh2BJFRdue8rI= + + + Headers/MCUtils.h + + hash + + ilGX+mynG6v0AmYu0e0gIJtAqrw= + + hash2 + + sFW26IcKpnRd5HlxqhDd4TZNK0LyuDX2RknW8fPFydY= + + + Headers/MCValue.h + + hash + + pg4c8ZtS3nPKHa7ppCas9tASOM0= + + hash2 + + 13G2myTSMolLwWGdOYSZfOmvC/pgGOnJPcttEqOXaB0= + + + Headers/MailCore.h + + hash + + 1H59Ohf6h7kCG7twvFyIcWhwiGc= + + hash2 + + lMFacOiJkjwHn4RjvCE96qVvtTvh5T610r6lHEVcFQM= + + + Headers/NSArray+MCO.h + + hash + + 2QFFVpe1NycPYtFsCiU1HmmP3zw= + + hash2 + + y3izUjzsDqyhuhmpxmqd1jx6oTqovtt9RsoOBFBQydc= + + + Headers/NSData+MCO.h + + hash + + eIdAZYId+yJzTsPE0r3X93pNmT8= + + hash2 + + c9vfnmGJyuoM9SucKetaHEpU+xOU0dBwX2W5hLPqXK4= + + + Headers/NSDictionary+MCO.h + + hash + + QIpiGQsYL8qjduw8L8ju4Mbv18U= + + hash2 + + uQDYkZ0sdC9XyST5esJOSTA1eu83JR+Q97omOcOuZQs= + + + Headers/NSError+MCO.h + + hash + + Gzy1mYevqFT+SasXyMdGg0eNS2w= + + hash2 + + Bd1jcI4ZTDkeoN0U0yFJvFMDzC9bwJnqH/cVrT8znYQ= + + + Headers/NSIndexSet+MCO.h + + hash + + dsB3fKJDraf/Id3tZ9nJZ0kfcQw= + + hash2 + + Gr4KuSP6zLe5qzzefF76l7siZmCQ4f415KFq+EWxogM= + + + Headers/NSObject+MCO.h + + hash + + ZMijcq8fseV38inegXfTr4VH/jI= + + hash2 + + gZz95bOV+CjsqRMdtao1X0q8pxRtuoXZeJ5Hrtaub3M= + + + Headers/NSString+MCO.h + + hash + + 4imNvGg2PvVG2y6ln8Fcp4mQCW4= + + hash2 + + A9dXS2wc326r4IYp5Kf4/ZWNWIM5BXj8ceW7sO6lIeI= + + + Headers/NSValue+MCO.h + + hash + + CR4M2YnM9b9GT1w1m8Ue/KcdxjA= + + hash2 + + NJWHzZcClQP21YV5YgVVxpyruyMPo9VY1GSaba2/LKs= + + + providers.json + + hash + + y4KncsIUbQX5DSizZ3HfqRo51mo= + + hash2 + + +qwUafjevpr69uoZDLd9bFssEeARcV3dlomfBvqx12g= + + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/MailCore.framework/providers.json b/MailCore.framework/providers.json new file mode 100644 index 000000000..31a51c38f --- /dev/null +++ b/MailCore.framework/providers.json @@ -0,0 +1,1277 @@ +{ + "hushmail":{ + "servers":{ + "imap":[ + { + "port": 993, + "hostname":"imap.hushmail.com", + "ssl":true + } + ], + "pop":[ + { + "port": 995, + "hostname":"pop.hushmail.com", + "ssl":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"smtp.hushmail.com", + "ssl":true + }, + { + "port":465, + "hostname":"smtp.hushmail.com", + "ssl":true + }, + { + "port":25, + "hostname":"smtp.hushmail.com", + "starttls":true + } + ] + }, + "domain-match":[ + "hushmail\\.com" + ] + }, + "mail":{ + "servers":{ + "imap":[ + { + "port": 993, + "hostname":"imap.mail.com", + "ssl":true + } + ], + "pop":[ + { + "port": 995, + "hostname":"pop.mail.com", + "ssl":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"smtp.mail.com", + "ssl":true + }, + { + "port":465, + "hostname":"smtp.mail.com", + "ssl":true + }, + { + "port":25, + "hostname":"smtp.mail.com", + "ssl":true + } + ] + }, + "domain-match":[ + "mail\\.com" + ] + }, + "zoho":{ + "servers":{ + "imap":[ + { + "port": 993, + "hostname":"imap.zoho.com", + "ssl":true + } + ], + "pop":[ + { + "port": 995, + "hostname":"pop.zoho.com", + "ssl":true + } + ], + "smtp":[ + { + "port":465, + "hostname":"smtp.zoho.com", + "ssl":true + }, + { + "port":587, + "hostname":"smtp.zoho.com", + "starttls":true + } + ] + }, + "domain-match":[ + "zoho\\.com" + ] + }, + "juno":{ + "servers":{ + "pop":[ + { + "port": 995, + "hostname":"pop.juno.com", + "ssl":true + } + ], + "smtp":[ + { + "port":465, + "hostname":"smtp.juno.com", + "starttls":true + } + ] + }, + "domain-match":[ + "juno\\.com" + ] + }, + "mobileme":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.mail.me.com", + "ssl":true + }, + { + "port":143, + "hostname":"imap.mail.me.com", + "starttls":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"smtp.mail.me.com", + "starttls":true + } + ] + }, + "domain-match":[ + "me\\.com", + "mac\\.com", + "icloud\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "dreamhost":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"mail.{domain}", + "ssl":true + }, + { + "port":143, + "hostname":"mail.{domain}", + "starttls":true + } + ], + "smtp":[ + { + "port":465, + "hostname":"mail.{domain}", + "ssl":true + }, + { + "port":587, + "hostname":"mail.{domain}", + "starttls":true + }, + { + "port":25, + "hostname":"mail.{domain}", + "starttls":true + } + ] + }, + "mx-match":[ + "mx1\\.sub3\\.homie\\.mail\\.dreamhost\\.com", + "mx2\\.sub3\\.homie\\.mail\\.dreamhost\\.com", + "mx1\\.sub4\\.homie\\.mail\\.dreamhost\\.com", + "mx2\\.sub4\\.homie\\.mail\\.dreamhost\\.com", + "mx1\\.sub5\\.homie\\.mail\\.dreamhost\\.com", + "mx2\\.sub5\\.homie\\.mail\\.dreamhost\\.com", + "mx1\\.balanced\\.homie\\.mail\\.dreamhost\\.com", + "mx2\\.balanced\\.homie\\.mail\\.dreamhost\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "insecure-default":{ + "servers":{ + "imap":[ + { + "port":143, + "starttls":true + }, + { + "port":143 + } + ], + "smtp":[ + { + "port":587, + "starttls":true + }, + { + "port":25, + "starttls":true + }, + { + "port":587 + }, + { + "port":25 + } + ] + }, + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "euro-apple":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"phonehome.euro.apple.com", + "ssl":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"phonehome.apple.com", + "starttls":true + } + ] + }, + "domain-match":[ + "euro\\.apple\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "default":{ + "servers":{ + "imap":[ + { + "port":993, + "ssl":true + }, + { + "port":143, + "starttls":true + } + ], + "smtp":[ + { + "port":465, + "ssl":true + }, + { + "port":587, + "starttls":true + }, + { + "port":25, + "starttls":true + } + ] + }, + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "insecure-fixed-port":{ + "servers":{ + "imap":[ + { + "starttls":true + }, + { + + } + ], + "smtp":[ + { + "starttls":true + }, + { + + } + ] + }, + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "aol":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.aol.com", + "ssl":true + }, + { + "port":143, + "hostname":"imap.aol.com", + "starttls":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"smtp.aol.com", + "starttls":true + }, + { + "port":465, + "hostname":"smtp.aol.com", + "ssl":true + }, + { + "port":25, + "hostname":"smtp.aol.com", + "starttls":true + } + ] + }, + "domain-match":[ + "aim\\.com", + "aol\\..*", + "jp\\.aol\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Saved", + "spam":"Spam", + "sentmail":"Sent", + "trash":"Trash" + } + }, + "yahoo.co.jp":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.mail.yahoo.co.jp", + "ssl":true + } + ], + "smtp":[ + { + "port":465, + "hostname":"smtp.mail.yahoo.co.jp", + "ssl":true + } + ] + }, + "domain-match":[ + "yahoo\\.co\\.jp" + ], + "mailboxes":{ + "drafts":"Draft", + "allmail":"Archive", + "spam":"Bulk Mail", + "sentmail":"Sent", + "trash":"Trash" + } + }, + "yahoo":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.mail.yahoo.com", + "ssl":true + }, + { + "port":143, + "hostname":"imap.mail.yahoo.com", + "starttls":true + } + ], + "smtp":[ + { + "port":465, + "hostname":"smtp.mail.yahoo.com", + "ssl":true + } + ] + }, + "mx-match":[ + "mta5\\.am0\\.yahoodns\\.net", + "mta6\\.am0\\.yahoodns\\.net", + "mta7\\.am0\\.yahoodns\\.net" + ], + "domain-match":[ + "yahoo\\..*", + "ymail\\.com", + "rocketmail\\.com", + "xtra\\.co\\.nz" + ], + "domain-exclude":[ + "yahoo\\.co\\.jp" + ], + "mailboxes":{ + "drafts":"Draft", + "allmail":"Archive", + "spam":"Bulk Mail", + "sentmail":"Sent", + "trash":"Trash" + } + }, + "gmail":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.gmail.com", + "ssl":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"smtp.gmail.com", + "starttls":true + }, + { + "port":465, + "hostname":"smtp.gmail.com", + "ssl":true + }, + { + "port":25, + "hostname":"smtp.gmail.com", + "starttls":true + } + ] + }, + "mx-match":[ + "aspmx2\\.googlemail\\.com", + "aspmx\\.l\\.google\\.com", + "aspmx3\\.googlemail\\.com", + "alt1\\.aspmx\\.l\\.google\\.com", + "alt2\\.aspmx\\.l\\.google\\.com", + "alt1\\.gmail-smtp-in\\.l\\.google\\.com", + "alt2\\.gmail-smtp-in\\.l\\.google\\.com", + "alt3\\.gmail-smtp-in\\.l\\.google\\.com", + "alt4\\.gmail-smtp-in\\.l\\.google\\.com", + "gmail-smtp-in\\.l\\.google\\.com" + ], + "domain-match":[ + "googlemail\\.com", + "gmail\\.com" + ], + "mailboxes":{ + "sentmail":"[Gmail]/Sent Mail", + "allmail":"[Gmail]/All Mail", + "starred":"[Gmail]/Starred", + "trash":"[Gmail]/Trash", + "drafts":"[Gmail]/Drafts", + "spam":"[Gmail]/Spam", + "important":"[Gmail]/Important" + } + }, + "gmx":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap.gmx.com", + "ssl":true + }, + { + "port":143, + "hostname":"imap.gmx.com", + "starttls":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"mail.gmx.com", + "starttls":true + }, + { + "port":465, + "hostname":"mail.gmx.com", + "ssl":true + }, + { + "port":25, + "hostname":"mail.gmx.com", + "starttls":true + } + ] + }, + "domain-match":[ + "gmx\\..*", + "caramail\\..*" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Spam", + "sentmail":"Sent", + "trash":"Trash" + } + }, + "fastmail":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"mail.messagingengine.com", + "ssl":true + }, + { + "port":143, + "hostname":"mail.messagingengine.com", + "starttls":true + } + ], + "smtp":[ + { + "port":587, + "hostname":"mail.messagingengine.com", + "starttls":true + }, + { + "port":465, + "hostname":"mail.messagingengine.com", + "ssl":true + }, + { + "port":25, + "hostname - 2":"mail.messagingengine.com", + "starttls":true + } + ] + }, + "domain-match":[ + "123mail\\.org", + "fastmail\\..*", + "airpost\\.net", + "eml\\.cc", + "fmail\\.co\\.uk", + "fmgirl\\.com", + "fmguy\\.com", + "mailbolt\\.com", + "mailcan\\.com", + "mailhaven\\.com", + "mailmight\\.com", + "ml1\\.net", + "mm\\.st", + "myfastmail\\.com", + "proinbox\\.com", + "promessage\\.com", + "rushpost\\.com", + "sent\\.as", + "sent\\.at", + "sent\\.com", + "speedymail\\.org", + "warpmail\\.net", + "xsmail\\.com", + "150mail\\.com", + "150ml\\.com", + "16mail\\.com", + "2-mail\\.com", + "4email\\.net", + "50mail\\.com", + "allmail\\.net", + "bestmail\\.us", + "cluemail\\.com", + "elitemail\\.org", + "emailcorner\\.net", + "emailengine\\.net", + "emailengine\\.org", + "emailgroups\\.net", + "emailplus\\.org", + "emailuser\\.net", + "f-m\\.fm", + "fast-email\\.com", + "fast-mail\\.org", + "fastem\\.com", + "fastemail\\.us", + "fastemailer\\.com", + "fastest\\.cc", + "fastimap\\.com", + "fastmailbox\\.net", + "fastmessaging\\.com", + "fea\\.st", + "fmailbox\\.com", + "ftml\\.net", + "h-mail\\.us", + "hailmail\\.net", + "imap-mail\\.com", + "imap\\.cc", + "imapmail\\.org", + "inoutbox\\.com", + "internet-e-mail\\.com", + "internet-mail\\.org", + "internetemails\\.net", + "internetmailing\\.net", + "jetemail\\.net", + "justemail\\.net", + "letterboxes\\.org", + "mail-central\\.com", + "mail-page\\.com", + "mailandftp\\.com", + "mailas\\.com", + "mailc\\.net", + "mailforce\\.net", + "mailftp\\.com", + "mailingaddress\\.org", + "mailite\\.com", + "mailnew\\.com", + "mailsent\\.net", + "mailservice\\.ms", + "mailup\\.net", + "mailworks\\.org", + "mymacmail\\.com", + "nospammail\\.net", + "ownmail\\.net", + "petml\\.com", + "postinbox\\.com", + "postpro\\.net", + "realemail\\.net", + "reallyfast\\.biz", + "reallyfast\\.info", + "speedpost\\.net", + "ssl-mail\\.com", + "swift-mail\\.com", + "the-fastest\\.net", + "the-quickest\\.com", + "theinternetemail\\.com", + "veryfast\\.biz", + "veryspeedy\\.net", + "yepmail\\.net", + "your-mail\\.com", + "operamail\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk Mail", + "sentmail":"Sent Items", + "trash":"Trash" + }, + "mx-match":[ + "in1.smtp.messagingengine.com", + "in2.smtp.messagingengine.com", + "in1-smtp.messagingengine.com", + "in2-smtp.messagingengine.com" + ] + }, + "apple":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"phonehome.apple.com", + "ssl":true + } + ], + "smtp":[ + { + "port":465, + "tls":true, + "hostname":"phonehome.apple.com" + }, + { + "port":587, + "hostname":"phonehome.apple.com", + "starttls":true + } + ] + }, + "domain-match":[ + "apple\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "asia-apple":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"phonehome.asia.apple.com", + "ssl":true + } + ], + "smtp":[ + { + "port":465, + "tls":true, + "hostname":"phonehome.asia.apple.com" + }, + { + "port":587, + "hostname":"phonehome.asia.apple.com", + "starttls":true + } + ] + }, + "domain-match":[ + "asia\\.apple\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "rackspace":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"secure.emailsrvr.com", + "ssl":true + }, + { + "port":143, + "hostname":"secure.emailsrvr.com", + "starttls":true + }, + { + "port":143, + "hostname":"secure.emailsrvr.com" + } + ], + "smtp":[ + { + "port":465, + "hostname":"secure.emailsrvr.com", + "ssl":true + }, + { + "port":587, + "hostname":"secure.emailsrvr.com", + "starttls":true + }, + { + "port":25, + "hostname":"secure.emailsrvr.com", + "starttls":true + }, + { + "port":587, + "hostname":"secure.emailsrvr.com" + }, + { + "port":25, + "hostname":"secure.emailsrvr.com" + } + ] + }, + "mx-match":[ + "mx1\\.emailsrvr\\.com", + "mx2\\.emailsrvr\\.com" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "zimbra":{ + "servers":{ + "imap":[ + { + "port":993, + "ssl":true + }, + { + "port":143, + "starttls":true + } + ], + "smtp":[ + { + "port":587, + "starttls":true + }, + { + "port":465, + "ssl":true + }, + { + "port":25, + "starttls":true + } + ] + }, + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent", + "trash":"Trash" + } + }, + "ovh":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"mail.{domain}", + "ssl":true + }, + { + "port":143, + "hostname":"mail.{domain}" + } + ], + "smtp":[ + { + "port":465, + "hostname":"mail.{domain}", + "ssl":true + }, + { + "port":587, + "hostname":"mail.{domain}" + }, + { + "port":25, + "hostname":"mail.{domain}" + } + ] + }, + "mx-match":[ + "mx\\d\\.ovh\\.net" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "fixed-port":{ + "servers":{ + "imap":[ + { + "ssl":true + }, + { + "starttls":true + } + ], + "smtp":[ + { + "starttls":true + }, + { + "ssl":true + } + ] + }, + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "outlook":{ + "servers":{ + "imap":[ + { + "port":993, + "hostname":"imap-mail.outlook.com", + "ssl":true + } + ], + "smtp":[ + { + "port":25, + "hostname":"smtp-mail.outlook.com", + "starttls":true + } + ] + }, + "mx-match":[ + ".*\\.mail\\.outlook\\.com" + ], + "domain-match":[ + "outlook\\.com", + "outlook\\.com\\.ar", + "outlook\\.com\\.au", + "outlook\\.at", + "outlook\\.be", + "outlook\\.com\\.br", + "outlook\\.cl", + "outlook\\.cz", + "outlook\\.dk", + "outlook\\.fr", + "outlook\\.de", + "outlook\\.com\\.gr", + "outlook\\.co\\.id", + "outlook\\.ie", + "outlook\\.it", + "outlook\\.hu", + "outlook\\.jp", + "outlook\\.kr", + "outlook\\.lv", + "outlook\\.my", + "outlook\\.co\\.nz", + "outlook\\.com\\.pe", + "outlook\\.ph", + "outlook\\.pt", + "outlook\\.sa", + "outlook\\.sg", + "outlook\\.sk", + "outlook\\.es", + "outlook\\.co\\.th", + "outlook\\.com\\.tr", + "outlook\\.com\\.vn", + "hotmail\\.com", + "hotmail\\.co\\.uk", + "hotmail\\.fr", + "hotmail\\.de", + "hotmail\\.be", + "hotmail\\.com\\.ar", + "hotmail\\.es", + "hotmail\\.com\\.mx", + "hotmail\\.com", + "live\\.com", + "live\\.fr", + "live\\.de", + "live\\.be", + "live\\.com\\.ar", + "live\\.com\\.mx", + "live\\.co\\.uk" + ], + "mailboxes":{ + "drafts":"Drafts", + "allmail":"Archive", + "spam":"Junk", + "sentmail":"Sent Messages", + "trash":"Deleted Messages" + } + }, + "qq": { + "servers": { + "imap": [ + { + "port": 993, + "hostname": "imap.exmail.qq.com", + "ssl": true + } + ], + "smtp": [ + { + "port": 465, + "hostname": "smtp.exmail.qq.com", + "ssl": true + } + ] + }, + "domain-match": [ + "qq\\.com" + ], + "mailboxes": { + "drafts": "Drafts", + "spam": "Junk", + "sentmail": "Sent Messages", + "trash": "Deleted Messages" + } + }, + "openmailbox": { + "servers": { + "imap": [ + { + "port": 143, + "hostname": "imap.openmailbox.org", + "starttls": true + } + ], + "smtp": [ + { + "port": 587, + "hostname": "smtp.openmailbox.org", + "starttls": true + } + ] + }, + "domain-match": [ + "openmailbox\\.org" + ], + "mailboxes": { + "drafts": "Drafts", + "allmail": "Archive", + "spam": "Spam", + "sentmail": "Sent", + "trash": "Trash" + } + }, + "mailru": { + "servers": { + "imap": [ + { + "port": 143, + "hostname": "imap.mail.ru", + "starttls": true + }, + { + "port": 993, + "hostname": "imap.mail.ru", + "ssl": true + } + ], + "smtp": [ + { + "port": 465, + "hostname": "smtp.mail.ru", + "ssl": true + } + ] + + }, + "domain-match": [ + "mail\\.ru", + "inbox\\.ru", + "list\\.ru", + "bk\\.ru", + "mail\\.ua" + ], + "mailboxes": { + "drafts": "Черновики", + "spam": "Спам", + "sentmail": "Отправленные", + "trash": "Корзина" + } + }, + "yandex": { + "servers": { + "imap": [ + { + "port": 993, + "hostname": "imap.yandex.com", + "ssl": true + } + ], + "smtp": [ + { + "port": 465, + "hostname": "smtp.yandex.com", + "ssl": true + } + ] + + }, + "domain-match": [ + "yandex\\.ru", + "yandex\\.ua", + "yandex\\.kz", + "yandex\\.by", + "yandex\\.com", + "yandex\\.com\\.tr" + ], + "mailboxes": { + "drafts": "Черновики", + "spam": "Спам", + "sentmail": "Отправленные", + "trash": "Удалённые" + } + }, + "comcast": { + "servers": { + "pop": [{ + "port": 995, + "hostname": "mail.comcast.net", + "ssl": true + }, { + "port": 110, + "hostname": "mail.comcast.net", + "ssl": true + }], + "smtp": [{ + "port": 587, + "hostname": "smtp.comcast.net", + "starttls": true + }, { + "port": 465, + "hostname": "smtp.comcast.net", + "ssl": true + }] + }, + "mx-match": [ + "mx1\\.comcast\\.net", + "mx2\\.comcast\\.net" + ] + }, + "verizon": { + "servers": { + "pop": [{ + "port": 995, + "hostname": "pop.verizon.net", + "ssl": true + }], + "smtp": [{ + "port": 465, + "hostname": "smtp.verizon.net", + "ssl": true + }] + + }, + "mx-match": [ + "relay\\.verizon\\.net" + ] + }, + "rcn": { + "servers": { + "pop": [{ + "port": 110, + "hostname": "pop.rcn.com", + "ssl": true + }], + "smtp": [{ + "port": 25, + "hostname": "smtp.rcn.com", + "ssl": true + }] + + }, + "mx-match": [ + "mx\\.rcn\\.com" + ] + }, + "ukrnet": { + "servers": { + "imap": [ + { + "port": 993, + "hostname": "imap.ukr.net", + "ssl": true + } + ], + "smtp": [ + { + "port": 465, + "hostname": "smtp.ukr.net", + "ssl": true + } + ] + + }, + "domain-match": [ + "ukr\\.net" + ], + "mailboxes": { + "drafts": "Черновики", + "spam": "Спам", + "sentmail": "Отправленные", + "trash": "Удаленные" + } + }, + "rambler": { + "servers": { + "imap": [ + { + "port": 993, + "hostname": "imap.rambler.ru", + "ssl": true + } + ], + "smtp": [ + { + "port": 465, + "hostname": "smtp.rambler.ru", + "ssl": true + } + ] + + }, + "domain-match": [ + "rambler\\.ru", + "lenta\\.ru", + "autorambler\\.ru", + "myrambler\\.ru", + "ro\\.ru", + "r0\\.ru" + ], + "mailboxes": { + "drafts": "DraftBox", + "spam": "Spam", + "sentmail": "SentBox", + "trash": "Trash" + } + }, + "office365": { + "servers": { + "imap": [ + { + "port": 993, + "hostname": "outlook.office365.com", + "ssl": true + } + ], + "smtp": [ + { + "port": 587, + "hostname": "smtp.office365.com", + "starttls": true + } + ] + }, + "mailboxes": { + "drafts": "Drafts", + "spam": "Junk Email", + "sentmail": "Sent Items", + "trash": "Deleted Items" + } + } +}