diff options
Diffstat (limited to 'src/core/imap')
-rw-r--r-- | src/core/imap/MCIMAPFolder.h | 22 | ||||
-rw-r--r-- | src/core/imap/MCIMAPMessage.h | 28 | ||||
-rw-r--r-- | src/core/imap/MCIMAPMessagePart.h | 10 | ||||
-rw-r--r-- | src/core/imap/MCIMAPMultipart.h | 9 | ||||
-rw-r--r-- | src/core/imap/MCIMAPNamespace.h | 24 | ||||
-rw-r--r-- | src/core/imap/MCIMAPNamespaceItem.h | 22 | ||||
-rw-r--r-- | src/core/imap/MCIMAPPart.h | 46 | ||||
-rw-r--r-- | src/core/imap/MCIMAPProgressCallback.h | 4 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSearchExpression.h | 29 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSession.h | 95 |
10 files changed, 169 insertions, 120 deletions
diff --git a/src/core/imap/MCIMAPFolder.h b/src/core/imap/MCIMAPFolder.h index cacd21bd..97259f1a 100644 --- a/src/core/imap/MCIMAPFolder.h +++ b/src/core/imap/MCIMAPFolder.h @@ -5,21 +5,15 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFolder : public Object { - private: - String * mPath; - char mDelimiter; - IMAPFolderFlag mFlags; - void init(); public: IMAPFolder(); - IMAPFolder(IMAPFolder * other); virtual ~IMAPFolder(); - virtual Object * copy(); - virtual void setPath(String * path); virtual String * path(); @@ -28,8 +22,20 @@ namespace mailcore { virtual void setFlags(IMAPFolderFlag flags); virtual IMAPFolderFlag flags(); + + public: // subclass behavior + IMAPFolder(IMAPFolder * other); + virtual Object * copy(); + + private: + String * mPath; + char mDelimiter; + IMAPFolderFlag mFlags; + void init(); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPMessage.h b/src/core/imap/MCIMAPMessage.h index 9aee0cdc..692ddc49 100644 --- a/src/core/imap/MCIMAPMessage.h +++ b/src/core/imap/MCIMAPMessage.h @@ -7,24 +7,15 @@ #include <mailcore/MCMessageConstants.h> #include <mailcore/MCAbstractPart.h> +#ifdef __cplusplus + namespace mailcore { class IMAPMessage : public AbstractMessage { - private: - uint32_t mUid; - MessageFlag mFlags; - MessageFlag mOriginalFlags; - AbstractPart * mMainPart; - Array * mLabels; - void init(); public: IMAPMessage(); - IMAPMessage(IMAPMessage * other); ~IMAPMessage(); - virtual Object * copy(); - virtual String * description(); - virtual uint32_t uid(); virtual void setUid(uint32_t uid); @@ -39,8 +30,23 @@ namespace mailcore { virtual void setGmailLabels(Array * labels); virtual Array * gmailLabels(); + + public: // subclass behavior + IMAPMessage(IMAPMessage * other); + virtual Object * copy(); + virtual String * description(); + + private: + uint32_t mUid; + MessageFlag mFlags; + MessageFlag mOriginalFlags; + AbstractPart * mMainPart; + Array * mLabels; + void init(); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPMessagePart.h b/src/core/imap/MCIMAPMessagePart.h index 99991390..03747ac0 100644 --- a/src/core/imap/MCIMAPMessagePart.h +++ b/src/core/imap/MCIMAPMessagePart.h @@ -4,19 +4,21 @@ #include <mailcore/MCAbstractMessagePart.h> +#ifdef __cplusplus + namespace mailcore { class IMAPMessagePart : public AbstractMessagePart { - private: - public: IMAPMessagePart(); - IMAPMessagePart(IMAPMessagePart * other); virtual ~IMAPMessagePart(); - + + public: // subclass behavior + IMAPMessagePart(IMAPMessagePart * other); virtual Object * copy(); }; } +#endif #endif diff --git a/src/core/imap/MCIMAPMultipart.h b/src/core/imap/MCIMAPMultipart.h index db46b583..9a768d0a 100644 --- a/src/core/imap/MCIMAPMultipart.h +++ b/src/core/imap/MCIMAPMultipart.h @@ -4,18 +4,21 @@ #include <mailcore/MCAbstractMultipart.h> +#ifdef __cplusplus + namespace mailcore { class IMAPMultipart : public AbstractMultipart { - private: - public: IMAPMultipart(); - IMAPMultipart(IMAPMultipart * other); virtual ~IMAPMultipart(); + public: // subclass behavior + IMAPMultipart(IMAPMultipart * other); virtual Object * copy(); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPNamespace.h b/src/core/imap/MCIMAPNamespace.h index 4909421c..c752685a 100644 --- a/src/core/imap/MCIMAPNamespace.h +++ b/src/core/imap/MCIMAPNamespace.h @@ -4,24 +4,17 @@ #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class IMAPNamespaceItem; class IMAPNamespace : public Object { - private: - Array * mItems; - void init(); - IMAPNamespaceItem * mainItem(); - IMAPNamespaceItem * itemForPath(String * path); public: IMAPNamespace(); - IMAPNamespace(IMAPNamespace * other); virtual ~IMAPNamespace(); - virtual String * description(); - virtual Object * copy(); - virtual String * mainPrefix(); virtual char mainDelimiter(); @@ -36,8 +29,21 @@ namespace mailcore { static IMAPNamespace * namespaceWithPrefix(String * prefix, char delimiter); virtual void importIMAPNamespace(struct mailimap_namespace_item * item); + + public: // subclass behavior + IMAPNamespace(IMAPNamespace * other); + virtual String * description(); + virtual Object * copy(); + + private: + Array * mItems; + void init(); + IMAPNamespaceItem * mainItem(); + IMAPNamespaceItem * itemForPath(String * path); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPNamespaceItem.h b/src/core/imap/MCIMAPNamespaceItem.h index f2831895..769490b6 100644 --- a/src/core/imap/MCIMAPNamespaceItem.h +++ b/src/core/imap/MCIMAPNamespaceItem.h @@ -4,21 +4,15 @@ #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class IMAPNamespaceItem : public Object { - private: - char mDelimiter; - String * mPrefix; - void init(); public: IMAPNamespaceItem(); - IMAPNamespaceItem(IMAPNamespaceItem * other); virtual ~IMAPNamespaceItem(); - virtual String * description(); - virtual Object * copy(); - virtual void setPrefix(String * prefix); virtual String * prefix(); @@ -31,8 +25,20 @@ namespace mailcore { virtual bool containsFolder(String * folder); virtual void importIMAPNamespaceInfo(struct mailimap_namespace_info * info); + + public: // subclass behavior + IMAPNamespaceItem(IMAPNamespaceItem * other); + virtual String * description(); + virtual Object * copy(); + + private: + char mDelimiter; + String * mPrefix; + void init(); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPPart.h b/src/core/imap/MCIMAPPart.h index 79c261fb..2749a0a0 100644 --- a/src/core/imap/MCIMAPPart.h +++ b/src/core/imap/MCIMAPPart.h @@ -6,35 +6,17 @@ #include <libetpan/libetpan.h> #include <mailcore/MCAbstractPart.h> +#ifdef __cplusplus + namespace mailcore { class IMAPMessagePart; class IMAPMultipart; class IMAPPart : public AbstractPart { - 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); public: IMAPPart(); - IMAPPart(IMAPPart * other); virtual ~IMAPPart(); - - virtual Object * copy(); virtual void setPartID(String * partID); virtual String * partID(); @@ -51,7 +33,31 @@ namespace mailcore { virtual void importIMAPFields(struct mailimap_body_fields * fields, struct mailimap_body_ext_1part * extension); + + public: // subclass behavior + IMAPPart(IMAPPart * other); + virtual Object * copy(); + + 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/src/core/imap/MCIMAPProgressCallback.h b/src/core/imap/MCIMAPProgressCallback.h index b39e0dbd..cb68ddd1 100644 --- a/src/core/imap/MCIMAPProgressCallback.h +++ b/src/core/imap/MCIMAPProgressCallback.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCIMAPPROGRESSCALLBACK_H_ +#ifdef __cplusplus + namespace mailcore { class IMAPSession; @@ -14,3 +16,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/imap/MCIMAPSearchExpression.h b/src/core/imap/MCIMAPSearchExpression.h index 184bff33..b6546507 100644 --- a/src/core/imap/MCIMAPSearchExpression.h +++ b/src/core/imap/MCIMAPSearchExpression.h @@ -5,25 +5,15 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPSearchExpression : public Object { - private: - IMAPSearchKind mKind; - String * mHeader; - String * mValue; - IMAPSearchExpression * mLeftExpression; - IMAPSearchExpression * mRightExpression; - void init(); - public: IMAPSearchExpression(); - IMAPSearchExpression(IMAPSearchExpression * other); virtual ~IMAPSearchExpression(); - virtual String * description(); - virtual Object * copy(); - virtual IMAPSearchKind kind(); virtual String * header(); virtual String * value(); @@ -37,8 +27,23 @@ namespace mailcore { static IMAPSearchExpression * searchHeader(String * header, String * value); static IMAPSearchExpression * searchAnd(IMAPSearchExpression * left, IMAPSearchExpression * right); static IMAPSearchExpression * searchOr(IMAPSearchExpression * left, IMAPSearchExpression * right); + + public: // subclass behavior + IMAPSearchExpression(IMAPSearchExpression * other); + virtual String * description(); + virtual Object * copy(); + + private: + IMAPSearchKind mKind; + String * mHeader; + String * mValue; + IMAPSearchExpression * mLeftExpression; + IMAPSearchExpression * mRightExpression; + void init(); }; } #endif + +#endif diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index 798e7c01..d114f0be 100644 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -6,6 +6,8 @@ #include <mailcore/MCMessageConstants.h> #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { extern String * IMAPNamespacePersonal; @@ -18,51 +20,6 @@ namespace mailcore { class IMAPProgressCallback; class IMAPSession : public Object { - private: - String * mHostname; - unsigned int mPort; - String * mUsername; - String * mPassword; - AuthType mAuthType; - ConnectionType mConnectionType; - bool mCheckCertificateEnabled; - bool mVoIPEnabled; - char mDelimiter; - IMAPNamespace * mDefaultNamespace; - time_t mTimeout; - - bool mBodyProgressEnabled; - bool mIdleEnabled; - bool mXListEnabled; - String * mWelcomeString; - bool mNeedsMboxMailWorkaround; - uint32_t mUIDValidity; - uint32_t mUIDNext; - unsigned int mFolderMsgCount; - unsigned int mLastFetchedSequenceNumber; - String * mCurrentFolder; - pthread_mutex_t mIdleLock; - int mState; - mailimap * mImap; - IMAPProgressCallback * mProgressCallback; - unsigned int mProgressItemsCount; - - 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(); - void connectIfNeeded(ErrorCode * pError); - void loginIfNeeded(ErrorCode * pError); - void selectIfNeeded(String * folder, ErrorCode * pError); - char fetchDelimiterIfNeeded(char defaultDelimiter, ErrorCode * pError); - Array * fetchMessages(String * folder, IMAPMessagesRequestKind requestKind, bool fetchByUID, - struct mailimap_set * imapset, HashMap * mapping, uint32_t startUid, - IMAPProgressCallback * progressCallback, ErrorCode * pError); - public: IMAPSession(); virtual ~IMAPSession(); @@ -160,7 +117,55 @@ namespace mailcore { virtual uint32_t uidValidity(); virtual uint32_t uidNext(); virtual unsigned int lastFolderMessageCount(); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + AuthType mAuthType; + ConnectionType mConnectionType; + bool mCheckCertificateEnabled; + bool mVoIPEnabled; + char mDelimiter; + IMAPNamespace * mDefaultNamespace; + time_t mTimeout; + + bool mBodyProgressEnabled; + bool mIdleEnabled; + bool mXListEnabled; + String * mWelcomeString; + bool mNeedsMboxMailWorkaround; + uint32_t mUIDValidity; + uint32_t mUIDNext; + unsigned int mFolderMsgCount; + unsigned int mLastFetchedSequenceNumber; + String * mCurrentFolder; + pthread_mutex_t mIdleLock; + int mState; + mailimap * mImap; + IMAPProgressCallback * mProgressCallback; + unsigned int mProgressItemsCount; + + 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(); + void connectIfNeeded(ErrorCode * pError); + void loginIfNeeded(ErrorCode * pError); + void selectIfNeeded(String * folder, ErrorCode * pError); + char fetchDelimiterIfNeeded(char defaultDelimiter, ErrorCode * pError); + Array * fetchMessages(String * folder, IMAPMessagesRequestKind requestKind, bool fetchByUID, + struct mailimap_set * imapset, HashMap * mapping, uint32_t startUid, + IMAPProgressCallback * progressCallback, ErrorCode * pError); + }; } #endif + +#endif |