diff options
author | 2013-01-21 15:06:46 -0800 | |
---|---|---|
committer | 2013-01-21 15:06:46 -0800 | |
commit | 119b654d35db873bb7dbc77e24649462eb1aa4e6 (patch) | |
tree | ae42d35a781f94d8fe6994963230b095a1b2340a /src | |
parent | d998016c04cb1e1dfc9fcf608639bfb5a4147439 (diff) |
headers show public API first. cleanup.
Diffstat (limited to 'src')
83 files changed, 945 insertions, 760 deletions
diff --git a/src/async/imap/MCIMAPAppendMessageOperation.h b/src/async/imap/MCIMAPAppendMessageOperation.h index 36217d2a..15b18e2f 100644 --- a/src/async/imap/MCIMAPAppendMessageOperation.h +++ b/src/async/imap/MCIMAPAppendMessageOperation.h @@ -12,14 +12,11 @@ #include <mailcore/MCIMAPOperation.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPAppendMessageOperation : public IMAPOperation { - private: - Data * mMessageData; - MessageFlag mFlags; - uint32_t mCreatedUID; - public: IMAPAppendMessageOperation(); virtual ~IMAPAppendMessageOperation(); @@ -32,8 +29,17 @@ namespace mailcore { virtual uint32_t createdUID(); + public: // subclass behavior virtual void main(); + + private: + Data * mMessageData; + MessageFlag mFlags; + uint32_t mCreatedUID; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPAppendMessageOperation__) */ diff --git a/src/async/imap/MCIMAPAsyncConnection.h b/src/async/imap/MCIMAPAsyncConnection.h index 5c64eb71..730c1614 100644 --- a/src/async/imap/MCIMAPAsyncConnection.h +++ b/src/async/imap/MCIMAPAsyncConnection.h @@ -5,6 +5,8 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPOperation; @@ -23,15 +25,6 @@ namespace mailcore { class IMAPIdentityOperation; class IMAPAsyncConnection : public Object { - private: - IMAPSession * mSession; - OperationQueue * mQueue; - char mDelimiter; - IMAPNamespace * mDefaultNamespace; - String * mLastFolder; - - void queue(IMAPOperation * op); - public: IMAPAsyncConnection(); virtual ~IMAPAsyncConnection(); @@ -113,7 +106,16 @@ namespace mailcore { virtual IMAPOperation * checkAccountOperation(); - // private + private: + IMAPSession * mSession; + OperationQueue * mQueue; + char mDelimiter; + IMAPNamespace * mDefaultNamespace; + String * mLastFolder; + + void queue(IMAPOperation * op); + + public: // private virtual void runOperation(IMAPOperation * operation); virtual IMAPSession * session(); @@ -121,7 +123,9 @@ namespace mailcore { virtual void setLastFolder(String * folder); virtual String * lastFolder(); - }; + }; } #endif + +#endif diff --git a/src/async/imap/MCIMAPAsyncSession.h b/src/async/imap/MCIMAPAsyncSession.h index 90489292..d17e0d4f 100644 --- a/src/async/imap/MCIMAPAsyncSession.h +++ b/src/async/imap/MCIMAPAsyncSession.h @@ -12,6 +12,8 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPOperation; @@ -30,28 +32,6 @@ namespace mailcore { class IMAPAsyncConnection; class IMAPAsyncSession : public Object { - private: - Array * mSessions; - - 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 mAllowsFolderConcurrentAccessEnabled; - unsigned int mMaximumConnections; - - IMAPAsyncConnection * sessionForFolder(String * folder, bool urgent = false); - IMAPAsyncConnection * session(); - IMAPAsyncConnection * matchingSessionForFolder(String * folder); - IMAPAsyncConnection * availableSession(); - public: IMAPAsyncSession(); virtual ~IMAPAsyncSession(); @@ -140,7 +120,32 @@ namespace mailcore { virtual IMAPIdentityOperation * identityOperation(String * vendor, String * name, String * version); virtual IMAPOperation * checkAccountOperation(); + + private: + Array * mSessions; + + 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 mAllowsFolderConcurrentAccessEnabled; + unsigned int mMaximumConnections; + + IMAPAsyncConnection * sessionForFolder(String * folder, bool urgent = false); + IMAPAsyncConnection * session(); + IMAPAsyncConnection * matchingSessionForFolder(String * folder); + IMAPAsyncConnection * availableSession(); + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPAccount__) */ diff --git a/src/async/imap/MCIMAPCheckAccountOperation.h b/src/async/imap/MCIMAPCheckAccountOperation.h index e69a9898..7d61645b 100644 --- a/src/async/imap/MCIMAPCheckAccountOperation.h +++ b/src/async/imap/MCIMAPCheckAccountOperation.h @@ -11,14 +11,16 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPCheckAccountOperation : public IMAPOperation { - private: - - public: + public: // subclass behavior virtual void main(); }; } +#endif + #endif /* defined(__mailcore2__MCIMAPCheckAccountOperation__) */ diff --git a/src/async/imap/MCIMAPCopyMessagesOperation.h b/src/async/imap/MCIMAPCopyMessagesOperation.h index e3f2bf55..58cbc301 100644 --- a/src/async/imap/MCIMAPCopyMessagesOperation.h +++ b/src/async/imap/MCIMAPCopyMessagesOperation.h @@ -11,14 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPCopyMessagesOperation : public IMAPOperation { - private: - Array * mUids; - String * mDestFolder; - Array * mDestUids; - public: IMAPCopyMessagesOperation(); virtual ~IMAPCopyMessagesOperation(); @@ -31,8 +28,16 @@ namespace mailcore { virtual Array * destUids(); + public: // subclass behavior virtual void main(); + + private: + Array * mUids; + String * mDestFolder; + Array * mDestUids; }; } +#endif + #endif /* defined(__mailcore2__MCIMAPCopyMessagesOperation__) */ diff --git a/src/async/imap/MCIMAPCreateFolderOperation.h b/src/async/imap/MCIMAPCreateFolderOperation.h index f2394297..d37abfba 100644 --- a/src/async/imap/MCIMAPCreateFolderOperation.h +++ b/src/async/imap/MCIMAPCreateFolderOperation.h @@ -11,17 +11,20 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPCreateFolderOperation : public IMAPOperation { - private: - public: IMAPCreateFolderOperation(); virtual ~IMAPCreateFolderOperation(); + public: // subclass behavior virtual void main(); }; } +#endif + #endif /* defined(__mailcore2__MCIMAPCreateFolderOperation__) */ diff --git a/src/async/imap/MCIMAPDeleteFolderOperation.h b/src/async/imap/MCIMAPDeleteFolderOperation.h index 521f1d30..99027456 100644 --- a/src/async/imap/MCIMAPDeleteFolderOperation.h +++ b/src/async/imap/MCIMAPDeleteFolderOperation.h @@ -11,17 +11,20 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPDeleteFolderOperation : public IMAPOperation { - private: - public: IMAPDeleteFolderOperation(); virtual ~IMAPDeleteFolderOperation(); + public: // subclass behavior virtual void main(); }; } +#endif + #endif /* defined(__mailcore2__MCIMAPDeleteFolderOperation__) */ diff --git a/src/async/imap/MCIMAPExpungeOperation.h b/src/async/imap/MCIMAPExpungeOperation.h index 68ca0776..fbdf8118 100644 --- a/src/async/imap/MCIMAPExpungeOperation.h +++ b/src/async/imap/MCIMAPExpungeOperation.h @@ -11,17 +11,20 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPExpungeOperation : public IMAPOperation { - private: - public: IMAPExpungeOperation(); virtual ~IMAPExpungeOperation(); + public: // subclass behavior virtual void main(); }; } +#endif + #endif /* defined(__mailcore2__MCIMAPExpungeOperation__) */ diff --git a/src/async/imap/MCIMAPFetchContentOperation.h b/src/async/imap/MCIMAPFetchContentOperation.h index 6c685e2b..0b61da23 100644 --- a/src/async/imap/MCIMAPFetchContentOperation.h +++ b/src/async/imap/MCIMAPFetchContentOperation.h @@ -11,15 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFetchContentOperation : public IMAPOperation { - private: - uint32_t mUid; - String * mPartID; - Encoding mEncoding; - Data * mData; - public: IMAPFetchContentOperation(); virtual ~IMAPFetchContentOperation(); @@ -35,8 +31,18 @@ namespace mailcore { virtual Data * data(); + public: // subclass behavior virtual void main(); + + private: + uint32_t mUid; + String * mPartID; + Encoding mEncoding; + Data * mData; + }; } +#endif + #endif /* defined(__mailcore2__IMAPFetchContentOperation__) */ diff --git a/src/async/imap/MCIMAPFetchFoldersOperation.h b/src/async/imap/MCIMAPFetchFoldersOperation.h index 8eb0f798..d067ded8 100644 --- a/src/async/imap/MCIMAPFetchFoldersOperation.h +++ b/src/async/imap/MCIMAPFetchFoldersOperation.h @@ -12,15 +12,11 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFetchFoldersOperation : public IMAPOperation { - private: - String * mFolder; - bool mFetchSubscribedEnabled; - Array * mFolders; - void setDelimiterDataOnMainThread(char * delimiterData); - public: IMAPFetchFoldersOperation(); virtual ~IMAPFetchFoldersOperation(); @@ -30,8 +26,18 @@ namespace mailcore { virtual Array * folders(); + public: // subclass behavior virtual void main(); + + private: + String * mFolder; + bool mFetchSubscribedEnabled; + Array * mFolders; + void setDelimiterDataOnMainThread(char * delimiterData); + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPFetchFoldersOperation__) */ diff --git a/src/async/imap/MCIMAPFetchMessagesOperation.h b/src/async/imap/MCIMAPFetchMessagesOperation.h index 2e955655..250ad8f3 100644 --- a/src/async/imap/MCIMAPFetchMessagesOperation.h +++ b/src/async/imap/MCIMAPFetchMessagesOperation.h @@ -11,18 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFetchMessagesOperation : public IMAPOperation { - private: - bool mFetchByUidEnabled; - uint32_t mFirst; - uint32_t mLast; - Array * mUids; - Array * mNumbers; - IMAPMessagesRequestKind mKind; - Array * mMessages; - public: IMAPFetchMessagesOperation(); virtual ~IMAPFetchMessagesOperation(); @@ -47,8 +40,21 @@ namespace mailcore { virtual Array * messages(); + public: // subclass behavior virtual void main(); + + private: + bool mFetchByUidEnabled; + uint32_t mFirst; + uint32_t mLast; + Array * mUids; + Array * mNumbers; + IMAPMessagesRequestKind mKind; + Array * mMessages; + }; } +#endif + #endif /* defined(__mailcore2__IMAPFetchMessagesOperation__) */ diff --git a/src/async/imap/MCIMAPFetchNamespaceOperation.h b/src/async/imap/MCIMAPFetchNamespaceOperation.h index c80d0830..bea2b840 100644 --- a/src/async/imap/MCIMAPFetchNamespaceOperation.h +++ b/src/async/imap/MCIMAPFetchNamespaceOperation.h @@ -11,18 +11,24 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFetchNamespaceOperation : public IMAPOperation { - HashMap * mNamespaces; - private: - public: IMAPFetchNamespaceOperation(); virtual ~IMAPFetchNamespaceOperation(); + public: // subclass behavior virtual void main(); + + private: + HashMap * mNamespaces; + }; } +#endif + #endif /* defined(__mailcore2__IMAPFetchNamespaceOperation__) */ diff --git a/src/async/imap/MCIMAPFolderInfoOperation.h b/src/async/imap/MCIMAPFolderInfoOperation.h index 78aa4db0..019e0f60 100644 --- a/src/async/imap/MCIMAPFolderInfoOperation.h +++ b/src/async/imap/MCIMAPFolderInfoOperation.h @@ -11,14 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPFolderInfoOperation : public IMAPOperation { - private: - uint32_t mUidNext; - uint32_t mUidValidity; - int mMessageCount; - public: IMAPFolderInfoOperation(); virtual ~IMAPFolderInfoOperation(); @@ -27,9 +24,18 @@ namespace mailcore { virtual uint32_t uidValidity(); virtual int messageCount(); + public: // subclass behavior virtual void main(); + + private: + uint32_t mUidNext; + uint32_t mUidValidity; + int mMessageCount; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPFolderInfoOperation__) */ diff --git a/src/async/imap/MCIMAPIdentityOperation.h b/src/async/imap/MCIMAPIdentityOperation.h index c0015472..17ff05c7 100644 --- a/src/async/imap/MCIMAPIdentityOperation.h +++ b/src/async/imap/MCIMAPIdentityOperation.h @@ -11,15 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPIdentityOperation : public IMAPOperation { - private: - String * mVendor; - String * mName; - String * mVersion; - HashMap * mServerIdentity; - public: IMAPIdentityOperation(); virtual ~IMAPIdentityOperation(); @@ -35,8 +31,18 @@ namespace mailcore { virtual HashMap * serverIdentity(); + public: // subclass behavior virtual void main(); + + private: + String * mVendor; + String * mName; + String * mVersion; + HashMap * mServerIdentity; + }; } +#endif + #endif /* defined(__mailcore2__IMAPIdentityOperation__) */ diff --git a/src/async/imap/MCIMAPIdleOperation.h b/src/async/imap/MCIMAPIdleOperation.h index bbd72285..fe8be29c 100644 --- a/src/async/imap/MCIMAPIdleOperation.h +++ b/src/async/imap/MCIMAPIdleOperation.h @@ -11,14 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPIdleOperation : public IMAPOperation { - private: - uint32_t mLastKnownUid; - void prepare(); - void unprepare(); - public: IMAPIdleOperation(); virtual ~IMAPIdleOperation(); @@ -28,8 +25,17 @@ namespace mailcore { virtual void cancel(); + public: // subclass behavior virtual void main(); + + private: + uint32_t mLastKnownUid; + void prepare(); + void unprepare(); + }; } +#endif + #endif /* defined(__mailcore2__IMAPIdleOperation__) */ diff --git a/src/async/imap/MCIMAPOperation.h b/src/async/imap/MCIMAPOperation.h index f0dcb2c9..e78c1291 100644 --- a/src/async/imap/MCIMAPOperation.h +++ b/src/async/imap/MCIMAPOperation.h @@ -12,22 +12,14 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCIMAPProgressCallback.h> +#ifdef __cplusplus + namespace mailcore { class IMAPAsyncConnection; class IMAPOperationCallback; class IMAPOperation : public Operation, public IMAPProgressCallback { - IMAPAsyncConnection * mSession; - String * mFolder; - IMAPOperationCallback * mImapCallback; - ErrorCode mError; - 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); - public: IMAPOperation(); virtual ~IMAPOperation(); @@ -45,8 +37,23 @@ namespace mailcore { virtual ErrorCode error(); virtual void start(); + + private: + IMAPAsyncConnection * mSession; + String * mFolder; + IMAPOperationCallback * mImapCallback; + ErrorCode mError; + + 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 /* defined(__mailcore2__MCIMAPOperation__) */ diff --git a/src/async/imap/MCIMAPOperationCallback.h b/src/async/imap/MCIMAPOperationCallback.h index 6274297a..4b0f166d 100644 --- a/src/async/imap/MCIMAPOperationCallback.h +++ b/src/async/imap/MCIMAPOperationCallback.h @@ -9,6 +9,8 @@ #ifndef __mailcore2__MCIMAPOperationCallback__ #define __mailcore2__MCIMAPOperationCallback__ +#ifdef __cplusplus + namespace mailcore { class IMAPOperation; @@ -21,4 +23,6 @@ namespace mailcore { } +#endif + #endif /* defined(__mailcore2__MCIMAPOperationCallback__) */ diff --git a/src/async/imap/MCIMAPRenameFolderOperation.h b/src/async/imap/MCIMAPRenameFolderOperation.h index e1bc5967..83f949bf 100644 --- a/src/async/imap/MCIMAPRenameFolderOperation.h +++ b/src/async/imap/MCIMAPRenameFolderOperation.h @@ -11,12 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPRenameFolderOperation : public IMAPOperation { - private: - String * mOtherName; - public: IMAPRenameFolderOperation(); ~IMAPRenameFolderOperation(); @@ -24,8 +23,15 @@ namespace mailcore { virtual void setOtherName(String * otherName); virtual String * otherName(); + public: // subclass behavior virtual void main(); + + private: + String * mOtherName; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPRenameFolderOperation__) */ diff --git a/src/async/imap/MCIMAPSearchOperation.h b/src/async/imap/MCIMAPSearchOperation.h index ecbc72c5..040eb333 100644 --- a/src/async/imap/MCIMAPSearchOperation.h +++ b/src/async/imap/MCIMAPSearchOperation.h @@ -12,17 +12,13 @@ #include <mailcore/MCIMAPOperation.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class IMAPSearchExpression; class IMAPSearchOperation : public IMAPOperation { - private: - IMAPSearchKind mKind; - String * mSearchString; - IMAPSearchExpression * mExpression; - Array * mUids; - public: IMAPSearchOperation(); virtual ~IMAPSearchOperation(); @@ -38,8 +34,18 @@ namespace mailcore { virtual Array * uids(); + public: // subclass behavior virtual void main(); + + private: + IMAPSearchKind mKind; + String * mSearchString; + IMAPSearchExpression * mExpression; + Array * mUids; + }; } +#endif + #endif /* defined(__mailcore2__IMAPSearchOperation__) */ diff --git a/src/async/imap/MCIMAPStoreFlagsOperation.h b/src/async/imap/MCIMAPStoreFlagsOperation.h index 232a5a02..112399fe 100644 --- a/src/async/imap/MCIMAPStoreFlagsOperation.h +++ b/src/async/imap/MCIMAPStoreFlagsOperation.h @@ -11,14 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPStoreFlagsOperation : public IMAPOperation { - private: - Array * mUids; - IMAPStoreFlagsRequestKind mKind; - MessageFlag mFlags; - public: IMAPStoreFlagsOperation(); virtual ~IMAPStoreFlagsOperation(); @@ -32,8 +29,17 @@ namespace mailcore { virtual void setFlags(MessageFlag flags); virtual MessageFlag flags(); + public: // subclass behavior virtual void main(); + + private: + Array * mUids; + IMAPStoreFlagsRequestKind mKind; + MessageFlag mFlags; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPStoreFlagsOperation__) */ diff --git a/src/async/imap/MCIMAPStoreLabelsOperation.h b/src/async/imap/MCIMAPStoreLabelsOperation.h index b87b650a..84097683 100644 --- a/src/async/imap/MCIMAPStoreLabelsOperation.h +++ b/src/async/imap/MCIMAPStoreLabelsOperation.h @@ -11,14 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPStoreLabelsOperation : public IMAPOperation { - private: - Array * mUids; - IMAPStoreFlagsRequestKind mKind; - Array * mLabels; - public: IMAPStoreLabelsOperation(); virtual ~IMAPStoreLabelsOperation(); @@ -32,8 +29,17 @@ namespace mailcore { virtual void setLabels(Array * labels); virtual Array * labels(); + public: // subclass behavior virtual void main(); + + private: + Array * mUids; + IMAPStoreFlagsRequestKind mKind; + Array * mLabels; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPStoreLabelsOperation__) */ diff --git a/src/async/imap/MCIMAPSubscribeFolderOperation.h b/src/async/imap/MCIMAPSubscribeFolderOperation.h index cc335362..277a87ad 100644 --- a/src/async/imap/MCIMAPSubscribeFolderOperation.h +++ b/src/async/imap/MCIMAPSubscribeFolderOperation.h @@ -11,12 +11,11 @@ #include <mailcore/MCIMAPOperation.h> +#ifdef __cplusplus + namespace mailcore { class IMAPSubscribeFolderOperation : public IMAPOperation { - private: - bool mUnsubscribeEnabled; - public: IMAPSubscribeFolderOperation(); virtual ~IMAPSubscribeFolderOperation(); @@ -24,8 +23,15 @@ namespace mailcore { virtual void setUnsubscribeEnabled(bool enabled); virtual bool isUnsubscribeEnabled(); + public: // subclass behavior virtual void main(); + + private: + bool mUnsubscribeEnabled; + }; } +#endif + #endif /* defined(__mailcore2__MCIMAPSubscribeFolderOperation__) */ diff --git a/src/async/pop/MCPOPAsyncSession.h b/src/async/pop/MCPOPAsyncSession.h index 606a277d..4732eefd 100644 --- a/src/async/pop/MCPOPAsyncSession.h +++ b/src/async/pop/MCPOPAsyncSession.h @@ -11,6 +11,8 @@ #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class POPOperation; @@ -21,10 +23,6 @@ namespace mailcore { class POPFetchMessagesOperation; class POPAsyncSession : public Object { - private: - POPSession * mSession; - OperationQueue * mQueue; - public: POPAsyncSession(); virtual ~POPAsyncSession(); @@ -62,10 +60,17 @@ namespace mailcore { // Will disconnect. virtual POPOperation * deleteMessages(Array * indexes); - // private + private: + POPSession * mSession; + OperationQueue * mQueue; + + public: // private virtual void runOperation(POPOperation * operation); virtual POPSession * session(); + }; } +#endif + #endif /* defined(__mailcore2__MCPopAsyncSession__) */ diff --git a/src/async/pop/MCPOPDeleteMessagesOperation.h b/src/async/pop/MCPOPDeleteMessagesOperation.h index 1eca422a..e5166e21 100644 --- a/src/async/pop/MCPOPDeleteMessagesOperation.h +++ b/src/async/pop/MCPOPDeleteMessagesOperation.h @@ -11,12 +11,11 @@ #include <mailcore/MCPOPOperation.h> +#ifdef __cplusplus + namespace mailcore { class POPDeleteMessagesOperation : public POPOperation { - private: - Array * mMessageIndexes; - public: POPDeleteMessagesOperation(); virtual ~POPDeleteMessagesOperation(); @@ -24,10 +23,16 @@ namespace mailcore { virtual void setMessageIndexes(Array * indexes); virtual Array * messageIndexes(); + public: // subclass behavior virtual void main(); + + private: + Array * mMessageIndexes; + }; } +#endif #endif /* defined(__mailcore2__MCPOPDeleteMessagesOperation__) */ diff --git a/src/async/pop/MCPOPFetchHeaderOperation.h b/src/async/pop/MCPOPFetchHeaderOperation.h index 2b48062d..1ad4a40b 100644 --- a/src/async/pop/MCPOPFetchHeaderOperation.h +++ b/src/async/pop/MCPOPFetchHeaderOperation.h @@ -11,15 +11,13 @@ #include <mailcore/MCPOPOperation.h> +#ifdef __cplusplus + namespace mailcore { class MessageHeader; class POPFetchHeaderOperation : public POPOperation { - private: - unsigned int mMessageIndex; - MessageHeader * mHeader; - public: POPFetchHeaderOperation(); virtual ~POPFetchHeaderOperation(); @@ -29,8 +27,16 @@ namespace mailcore { virtual MessageHeader * header(); + public: // subclass behavior virtual void main(); + + private: + unsigned int mMessageIndex; + MessageHeader * mHeader; + }; } +#endif + #endif /* defined(__mailcore2__MCPOPFetchHeaderOperation__) */ diff --git a/src/async/pop/MCPOPFetchMessageOperation.h b/src/async/pop/MCPOPFetchMessageOperation.h index d60841d7..7b61db8a 100644 --- a/src/async/pop/MCPOPFetchMessageOperation.h +++ b/src/async/pop/MCPOPFetchMessageOperation.h @@ -11,12 +11,10 @@ #include <mailcore/MCPOPOperation.h> +#ifdef __cplusplus + namespace mailcore { class POPFetchMessageOperation : public POPOperation { - private: - unsigned int mMessageIndex; - Data * mData; - public: POPFetchMessageOperation(); virtual ~POPFetchMessageOperation(); @@ -26,8 +24,16 @@ namespace mailcore { virtual Data * data(); + public: // subclass behavior virtual void main(); + + private: + unsigned int mMessageIndex; + Data * mData; + }; } +#endif + #endif /* defined(__mailcore2__MCPOPFetchMessageOperation__) */ diff --git a/src/async/pop/MCPOPFetchMessagesOperation.h b/src/async/pop/MCPOPFetchMessagesOperation.h index b8c3d703..f21afa94 100644 --- a/src/async/pop/MCPOPFetchMessagesOperation.h +++ b/src/async/pop/MCPOPFetchMessagesOperation.h @@ -11,17 +11,24 @@ #include <mailcore/MCPOPOperation.h> +#ifdef __cplusplus + namespace mailcore { class POPFetchMessagesOperation : public POPOperation { - Array * mMessages; public: POPFetchMessagesOperation(); virtual ~POPFetchMessagesOperation(); virtual Array * messages(); + public: // subclass behavior virtual void main(); + + private: + Array * mMessages; }; } +#endif + #endif /* defined(__mailcore2__MCPOPFetchMessagesOperation__) */ diff --git a/src/async/pop/MCPOPOperation.h b/src/async/pop/MCPOPOperation.h index 9fcc6af6..e621caa0 100644 --- a/src/async/pop/MCPOPOperation.h +++ b/src/async/pop/MCPOPOperation.h @@ -12,19 +12,14 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCPOPProgressCallback.h> +#ifdef __cplusplus + namespace mailcore { class POPAsyncSession; class POPOperationCallback; class POPOperation : public Operation, public POPProgressCallback { - POPAsyncSession * mSession; - POPOperationCallback * mPopCallback; - ErrorCode mError; - private: - virtual void bodyProgress(POPSession * session, unsigned int current, unsigned int maximum); - virtual void bodyProgressOnMainThread(void * context); - public: POPOperation(); virtual ~POPOperation(); @@ -39,8 +34,19 @@ namespace mailcore { 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 /* defined(__mailcore2__MCPOPOperation__) */ diff --git a/src/async/pop/MCPOPOperationCallback.h b/src/async/pop/MCPOPOperationCallback.h index a71bd008..48491215 100644 --- a/src/async/pop/MCPOPOperationCallback.h +++ b/src/async/pop/MCPOPOperationCallback.h @@ -9,6 +9,8 @@ #ifndef mailcore2_MCPOPOperationCallback_h #define mailcore2_MCPOPOperationCallback_h +#ifdef __cplusplus + namespace mailcore { class POPOperation; @@ -21,3 +23,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/async/smtp/MCSMTPAsyncSession.h b/src/async/smtp/MCSMTPAsyncSession.h index 40b1cfbb..3159809b 100644 --- a/src/async/smtp/MCSMTPAsyncSession.h +++ b/src/async/smtp/MCSMTPAsyncSession.h @@ -6,6 +6,8 @@ #include <mailcore/MCMessageConstants.h> #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { class MessageBuilder; @@ -14,12 +16,6 @@ namespace mailcore { class Address; class SMTPAsyncSession : public Object { - private: - SMTPSession * mSession; - OperationQueue * mQueue; - - void queue(SMTPOperation * op); - public: SMTPAsyncSession(); virtual ~SMTPAsyncSession(); @@ -54,11 +50,20 @@ namespace mailcore { virtual SMTPOperation * sendMessageOperation(Data * messageData); virtual SMTPOperation * checkAccountOperation(Address * from); - // private + public: // private virtual void runOperation(SMTPOperation * operation); virtual SMTPSession * session(); + + private: + SMTPSession * mSession; + OperationQueue * mQueue; + + void queue(SMTPOperation * op); + }; } #endif + +#endif diff --git a/src/async/smtp/MCSMTPCheckAccountOperation.h b/src/async/smtp/MCSMTPCheckAccountOperation.h index 67a97bb8..68850d15 100644 --- a/src/async/smtp/MCSMTPCheckAccountOperation.h +++ b/src/async/smtp/MCSMTPCheckAccountOperation.h @@ -12,12 +12,11 @@ #include <mailcore/MCSMTPOperation.h> #include <mailcore/MCAbstract.h> +#ifdef __cplusplus + namespace mailcore { class SMTPCheckAccountOperation : public SMTPOperation { - private: - Address * mFrom; - public: SMTPCheckAccountOperation(); virtual ~SMTPCheckAccountOperation(); @@ -25,9 +24,16 @@ namespace mailcore { virtual void setFrom(Address * from); virtual Address * from(); + public: // subclass behavior virtual void main(); + + private: + Address * mFrom; + }; } +#endif + #endif /* defined(__mailcore2__MCSMTPCheckAccountOperation__) */ diff --git a/src/async/smtp/MCSMTPOperation.h b/src/async/smtp/MCSMTPOperation.h index 841c845c..d41154d1 100644 --- a/src/async/smtp/MCSMTPOperation.h +++ b/src/async/smtp/MCSMTPOperation.h @@ -12,19 +12,14 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCSMTPProgressCallback.h> +#ifdef __cplusplus + namespace mailcore { class SMTPAsyncSession; class SMTPOperationCallback; class SMTPOperation : public Operation, public SMTPProgressCallback { - SMTPAsyncSession * mSession; - SMTPOperationCallback * mSmtpCallback; - ErrorCode mError; - private: - virtual void bodyProgress(SMTPSession * session, unsigned int current, unsigned int maximum); - virtual void bodyProgressOnMainThread(void * context); - public: SMTPOperation(); virtual ~SMTPOperation(); @@ -39,8 +34,18 @@ namespace mailcore { 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 /* defined(__mailcore2__MCSMTPOperation__) */ diff --git a/src/async/smtp/MCSMTPOperationCallback.h b/src/async/smtp/MCSMTPOperationCallback.h index fec52767..33b07d8c 100644 --- a/src/async/smtp/MCSMTPOperationCallback.h +++ b/src/async/smtp/MCSMTPOperationCallback.h @@ -9,6 +9,8 @@ #ifndef __mailcore2__MCSMTPOperationCallback__ #define __mailcore2__MCSMTPOperationCallback__ +#ifdef __cplusplus + namespace mailcore { class SMTPOperation; @@ -19,4 +21,6 @@ namespace mailcore { }; } +#endif + #endif /* defined(__mailcore2__MCSMTPOperationCallback__) */ diff --git a/src/async/smtp/MCSMTPSendWithBuilderOperation.cc b/src/async/smtp/MCSMTPSendWithBuilderOperation.cc deleted file mode 100644 index df19ee17..00000000 --- a/src/async/smtp/MCSMTPSendWithBuilderOperation.cc +++ /dev/null @@ -1,43 +0,0 @@ -// -// SMTPSendWithBuilderOperation.cc -// mailcore2 -// -// Created by DINH Viêt Hoà on 1/10/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#include "MCSMTPSendWithBuilderOperation.h" - -#include "MCSMTPAsyncSession.h" -#include "MCSMTPSession.h" -#include "MCMessageBuilder.h" - -using namespace mailcore; - -SMTPSendWithBuilderOperation::SMTPSendWithBuilderOperation() -{ - mBuilder = NULL; -} - -SMTPSendWithBuilderOperation::~SMTPSendWithBuilderOperation() -{ - MC_SAFE_RELEASE(mBuilder); -} - -void SMTPSendWithBuilderOperation::setBuilder(MessageBuilder * builder) -{ - MC_SAFE_REPLACE_RETAIN(MessageBuilder, mBuilder, builder); -} - -MessageBuilder * SMTPSendWithBuilderOperation::builder() -{ - return mBuilder; -} - -void SMTPSendWithBuilderOperation::main() -{ - ErrorCode error; - - session()->session()->sendMessage(mBuilder, this, &error); - setError(error); -} diff --git a/src/async/smtp/MCSMTPSendWithBuilderOperation.h b/src/async/smtp/MCSMTPSendWithBuilderOperation.h deleted file mode 100644 index 301bad52..00000000 --- a/src/async/smtp/MCSMTPSendWithBuilderOperation.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// SMTPSendWithBuilderOperation.h -// mailcore2 -// -// Created by DINH Viêt Hoà on 1/10/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#ifndef __mailcore2__MCSMTPSendWithBuilderOperation__ -#define __mailcore2__MCSMTPSendWithBuilderOperation__ - -#include <mailcore/MCBaseTypes.h> -#include <mailcore/MCAbstract.h> -#include <mailcore/MCSMTPOperation.h> - -namespace mailcore { - - class MessageBuilder; - - class SMTPSendWithBuilderOperation : public SMTPOperation { - MessageBuilder * mBuilder; - private: - - public: - SMTPSendWithBuilderOperation(); - virtual ~SMTPSendWithBuilderOperation(); - - virtual void setBuilder(MessageBuilder * builder); - virtual MessageBuilder * builder(); - - virtual void main(); - }; - -} - -#endif /* defined(__mailcore2__SMTPSendWithBuilderOperation__) */ diff --git a/src/async/smtp/MCSMTPSendWithDataOperation.h b/src/async/smtp/MCSMTPSendWithDataOperation.h index 0afd381b..105cb751 100644 --- a/src/async/smtp/MCSMTPSendWithDataOperation.h +++ b/src/async/smtp/MCSMTPSendWithDataOperation.h @@ -13,12 +13,11 @@ #include <mailcore/MCAbstract.h> #include <mailcore/MCSMTPOperation.h> +#ifdef __cplusplus + namespace mailcore { class SMTPSendWithDataOperation : public SMTPOperation { - private: - Data * mMessageData; - public: SMTPSendWithDataOperation(); virtual ~SMTPSendWithDataOperation(); @@ -26,8 +25,15 @@ namespace mailcore { virtual void setMessageData(Data * data); virtual Data * messageData(); + public: // subclass behavior virtual void main(); + + private: + Data * mMessageData; + }; } +#endif + #endif /* defined(__mailcore2__SMTPSendWithDataOperation__) */ diff --git a/src/async/smtp/MCSMTPSendWithRecipientOperation.cc b/src/async/smtp/MCSMTPSendWithRecipientOperation.cc deleted file mode 100644 index ca91ab63..00000000 --- a/src/async/smtp/MCSMTPSendWithRecipientOperation.cc +++ /dev/null @@ -1,71 +0,0 @@ -// -// SMTPSendWithRecipientOperation.cc -// mailcore2 -// -// Created by DINH Viêt Hoà on 1/10/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#include "MCSMTPSendWithRecipientOperation.h" - -#include "MCSMTPAsyncSession.h" -#include "MCSMTPSession.h" - -using namespace mailcore; - -void SMTPSendWithRecipientOperation::init() -{ - mRecipients = NULL; - mFrom = NULL; - mMessageData = NULL; -} - -SMTPSendWithRecipientOperation::SMTPSendWithRecipientOperation() -{ - init(); -} - -SMTPSendWithRecipientOperation::~SMTPSendWithRecipientOperation() -{ - MC_SAFE_RELEASE(mRecipients); - MC_SAFE_RELEASE(mFrom); - MC_SAFE_RELEASE(mMessageData); -} - -void SMTPSendWithRecipientOperation::setFrom(Address * from) -{ - MC_SAFE_REPLACE_RETAIN(Address, mFrom, from); -} - -Address * SMTPSendWithRecipientOperation::from() -{ - return mFrom; -} - -void SMTPSendWithRecipientOperation::setRecipients(Array * recipients) -{ - MC_SAFE_REPLACE_RETAIN(Array, mRecipients, recipients); -} - -Array * SMTPSendWithRecipientOperation::recipients() -{ - return mRecipients; -} - -void SMTPSendWithRecipientOperation::setMessageData(Data * data) -{ - MC_SAFE_REPLACE_RETAIN(Data, mMessageData, data); -} - -Data * SMTPSendWithRecipientOperation::messageData() -{ - return mMessageData; -} - -void SMTPSendWithRecipientOperation::main() -{ - ErrorCode error; - - session()->session()->sendMessage(mFrom, mRecipients, mMessageData, this, &error); - setError(error); -} diff --git a/src/async/smtp/MCSMTPSendWithRecipientOperation.h b/src/async/smtp/MCSMTPSendWithRecipientOperation.h deleted file mode 100644 index 936e8a51..00000000 --- a/src/async/smtp/MCSMTPSendWithRecipientOperation.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// SMTPSendWithRecipientOperation.h -// mailcore2 -// -// Created by DINH Viêt Hoà on 1/10/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#ifndef __mailcore2__MCSMTPSendWithRecipientOperation__ -#define __mailcore2__MCSMTPSendWithRecipientOperation__ - -#include <mailcore/MCBaseTypes.h> -#include <mailcore/MCAbstract.h> -#include <mailcore/MCSMTPOperation.h> - -namespace mailcore { - - class SMTPSendWithRecipientOperation : public SMTPOperation { - private: - Array * mRecipients; - Address * mFrom; - Data * mMessageData; - - void init(); - - public: - SMTPSendWithRecipientOperation(); - virtual ~SMTPSendWithRecipientOperation(); - - virtual void setFrom(Address * from); - virtual Address * from(); - - virtual void setRecipients(Array * recipients); - virtual Array * recipients(); - - virtual void setMessageData(Data * data); - virtual Data * messageData(); - - virtual void main(); - }; - -} - -#endif /* defined(__mailcore2__SMTPSendWithRecipientOperation__) */ diff --git a/src/core/abstract/MCAbstractMessage.h b/src/core/abstract/MCAbstractMessage.h index 59d0d75a..9f327cad 100644 --- a/src/core/abstract/MCAbstractMessage.h +++ b/src/core/abstract/MCAbstractMessage.h @@ -3,26 +3,32 @@ #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class MessageHeader; class AbstractMessage : public Object { - private: - MessageHeader * mHeader; - void init(); - public: AbstractMessage(); - AbstractMessage(AbstractMessage * other); virtual ~AbstractMessage(); - virtual String * description(); - virtual Object * copy(); - virtual MessageHeader * header(); virtual void setHeader(MessageHeader * header); + + public: //subclass behavior + AbstractMessage(AbstractMessage * other); + virtual String * description(); + virtual Object * copy(); + + private: + MessageHeader * mHeader; + void init(); + }; } #endif + +#endif diff --git a/src/core/abstract/MCAbstractMessagePart.h b/src/core/abstract/MCAbstractMessagePart.h index 4c61c326..bfbd00be 100644 --- a/src/core/abstract/MCAbstractMessagePart.h +++ b/src/core/abstract/MCAbstractMessagePart.h @@ -5,25 +5,17 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCAbstractPart.h> +#ifdef __cplusplus + namespace mailcore { class MessageHeader; class AbstractMessagePart : public AbstractPart { - private: - AbstractPart * mMainPart; - MessageHeader * mHeader; - void init(); - void applyMessage(); - public: AbstractMessagePart(); - AbstractMessagePart(AbstractMessagePart * other); virtual ~AbstractMessagePart(); - virtual String * description(); - virtual Object * copy(); - virtual MessageHeader * header(); virtual void setHeader(MessageHeader * header); @@ -31,8 +23,20 @@ namespace mailcore { virtual void setMainPart(AbstractPart * mainPart); virtual void setMessage(AbstractMessage * message); + + public: //subclass behavior + AbstractMessagePart(AbstractMessagePart * other); + virtual String * description(); + virtual Object * copy(); + + private: + AbstractPart * mMainPart; + MessageHeader * mHeader; + void init(); + void applyMessage(); }; } +#endif #endif diff --git a/src/core/abstract/MCAbstractMultipart.h b/src/core/abstract/MCAbstractMultipart.h index c2e827df..411e8af0 100644 --- a/src/core/abstract/MCAbstractMultipart.h +++ b/src/core/abstract/MCAbstractMultipart.h @@ -5,27 +5,32 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCAbstractPart.h> +#ifdef __cplusplus + namespace mailcore { class AbstractMultipart : public AbstractPart { - private: - Array * mParts; - void init(); - void applyMessage(); - public: AbstractMultipart(); - AbstractMultipart(AbstractMultipart * other); virtual ~AbstractMultipart(); - virtual String * description(); - virtual Object * copy(); - virtual Array * parts(); virtual void setParts(Array * parts); virtual void setMessage(AbstractMessage * message); + + public: //subclass behavior + AbstractMultipart(AbstractMultipart * other); + virtual String * description(); + virtual Object * copy(); + + private: + Array * mParts; + void init(); + void applyMessage(); }; } #endif + +#endif diff --git a/src/core/abstract/MCAbstractPart.h b/src/core/abstract/MCAbstractPart.h index 97d789fb..f7b29ced 100644 --- a/src/core/abstract/MCAbstractPart.h +++ b/src/core/abstract/MCAbstractPart.h @@ -5,30 +5,17 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class AbstractMessage; class AbstractPart : public Object { - private: - String * mFilename; - String * mMimeType; - String * mCharset; - String * mContentID; - String * mContentLocation; - bool mInlineAttachment; - PartType mPartType; - AbstractMessage * mMessage; // weak - void init(); - public: AbstractPart(); - AbstractPart(AbstractPart * other); virtual ~AbstractPart(); - virtual String * description(); - virtual Object * copy(); - virtual PartType partType(); virtual void setPartType(PartType type); @@ -55,8 +42,26 @@ namespace mailcore { virtual void importIMAPFields(struct mailimap_body_fields * fields, struct mailimap_body_ext_1part * extension); + + public: // subclass behavior + AbstractPart(AbstractPart * other); + virtual String * description(); + virtual Object * copy(); + + private: + String * mFilename; + String * mMimeType; + String * mCharset; + String * mContentID; + String * mContentLocation; + bool mInlineAttachment; + PartType mPartType; + AbstractMessage * mMessage; // weak + void init(); }; } #endif + +#endif diff --git a/src/core/abstract/MCAddress.h b/src/core/abstract/MCAddress.h index 58b2767c..49d74079 100644 --- a/src/core/abstract/MCAddress.h +++ b/src/core/abstract/MCAddress.h @@ -5,17 +5,13 @@ #include <libetpan/libetpan.h> #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class Address : public Object { - private: - String * mDisplayName; - String * mMailbox; - void init(); - public: Address(); - Address(Address * other); virtual ~Address(); static Address * addressWithDisplayName(String * displayName, String * mailbox); @@ -23,13 +19,6 @@ namespace mailcore { static Address * addressWithRFC822String(String * RFC822String); static Address * addressWithNonEncodedRFC822String(String * nonEncodedRFC822String); - virtual String * description(); - - virtual bool isEqual(Object * otherObject); - virtual unsigned int hash(); - - virtual Object * copy(); - virtual void setDisplayName(String * displayName); virtual String * displayName(); @@ -47,8 +36,22 @@ namespace mailcore { // Must be released virtual struct mailimf_address * createIMFAddress(); virtual struct mailimf_mailbox * createIMFMailbox(); + + public: // subclass behavior. + Address(Address * other); + virtual String * description(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + virtual Object * copy(); + + private: + String * mDisplayName; + String * mMailbox; + void init(); }; } #endif + +#endif diff --git a/src/core/abstract/MCMessageConstants.h b/src/core/abstract/MCMessageConstants.h index 1440bcf1..e3a7c3e3 100644 --- a/src/core/abstract/MCMessageConstants.h +++ b/src/core/abstract/MCMessageConstants.h @@ -1,6 +1,8 @@ #ifndef __MAILCORE_MCMESSAGECONSTANTS_H_ #define __MAILCORE_MCMESSAGECONSTANTS_H_ +#ifdef __cplusplus + namespace mailcore { enum ConnectionType { @@ -206,4 +208,6 @@ namespace mailcore { }; } +#endif + #endif
\ No newline at end of file diff --git a/src/core/abstract/MCMessageHeader.h b/src/core/abstract/MCMessageHeader.h index 54f906f4..045d91c5 100644 --- a/src/core/abstract/MCMessageHeader.h +++ b/src/core/abstract/MCMessageHeader.h @@ -5,35 +5,17 @@ #include <mailcore/MCBaseTypes.h> #include <time.h> +#ifdef __cplusplus + namespace mailcore { class Address; class MessageHeader : public Object { - private: - String * mMessageID; - 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; - String * mUserAgent; - void init(bool generateDate, bool generateMessageID); - public: MessageHeader(); - MessageHeader(MessageHeader * other); virtual ~MessageHeader(); - virtual String * description(); - virtual Object * copy(); - virtual void setMessageID(String * messageID); virtual String * messageID(); @@ -82,8 +64,31 @@ namespace mailcore { virtual struct mailimf_fields * createIMFFieldsAndFilterBcc(bool filterBcc); virtual void importIMFFields(struct mailimf_fields * fields); + + public: // subclass behavior + MessageHeader(MessageHeader * other); + virtual String * description(); + virtual Object * copy(); + + private: + String * mMessageID; + 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; + String * mUserAgent; + void init(bool generateDate, bool generateMessageID); }; } #endif + +#endif diff --git a/src/core/basetypes/MCArray.h b/src/core/basetypes/MCArray.h index 9e234b97..c6dd1090 100644 --- a/src/core/basetypes/MCArray.h +++ b/src/core/basetypes/MCArray.h @@ -6,25 +6,20 @@ #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { class String; class Array : public Object { - private: - carray * mArray; - void init(); public: Array(); - Array(Array * o); virtual ~Array(); static Array * array(); static Array * arrayWithObject(Object * obj); - virtual String * description(); - virtual Object * copy(); - virtual unsigned int count(); virtual void addObject(Object * obj); virtual void removeObjectAtIndex(unsigned int idx); @@ -41,8 +36,19 @@ namespace mailcore { virtual Array * sortedArray(int (* compare)(void *, void *, void *), void * context); virtual String * componentsJoinedByString(String * delimiter); + + public: // subclass behavior + Array(Array * o); + virtual String * description(); + virtual Object * copy(); + + private: + carray * mArray; + void init(); }; } #endif + +#endif diff --git a/src/core/basetypes/MCAssert.h b/src/core/basetypes/MCAssert.h index cc13aba8..f2e1f484 100644 --- a/src/core/basetypes/MCAssert.h +++ b/src/core/basetypes/MCAssert.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCASSERT_H_ +#ifdef __cplusplus + #define MCAssert(cond) mailcore::assertInteral(__FILE__, __LINE__, cond, #cond) namespace mailcore { @@ -11,3 +13,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCAutoreleasePool.cc b/src/core/basetypes/MCAutoreleasePool.cc index 6c38982d..38f9630c 100644 --- a/src/core/basetypes/MCAutoreleasePool.cc +++ b/src/core/basetypes/MCAutoreleasePool.cc @@ -99,11 +99,6 @@ void AutoreleasePool::autorelease(Object * obj) pool->add(obj); } -String * AutoreleasePool::className() -{ - return MCSTR("AutoreleasePool"); -} - String * AutoreleasePool::description() { String * result = String::string(); diff --git a/src/core/basetypes/MCAutoreleasePool.h b/src/core/basetypes/MCAutoreleasePool.h index ee30de87..583015c9 100644 --- a/src/core/basetypes/MCAutoreleasePool.h +++ b/src/core/basetypes/MCAutoreleasePool.h @@ -6,9 +6,20 @@ #include <libetpan/libetpan.h> #include <pthread.h> +#ifdef __cplusplus + namespace mailcore { class 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; @@ -18,17 +29,10 @@ namespace mailcore { static void initAutoreleasePoolStackKey(); static AutoreleasePool * currentAutoreleasePool(); virtual void add(Object * obj); - - public: - AutoreleasePool(); - virtual ~AutoreleasePool(); - - virtual String * className(); - virtual String * description(); - - static void autorelease(Object * obj); }; } #endif + +#endif diff --git a/src/core/basetypes/MCData.h b/src/core/basetypes/MCData.h index d92fa8a6..e14887f0 100644 --- a/src/core/basetypes/MCData.h +++ b/src/core/basetypes/MCData.h @@ -5,32 +5,19 @@ #include <mailcore/MCObject.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class String; class Data : public Object { - private: - char * mBytes; - unsigned int mLength; - unsigned int mAllocated; - void allocate(unsigned int length); - void reset(); - static String * normalizeCharset(String * charset); - String * charsetWithFilteredHTMLWithoutHint(bool filterHTML); - public: Data(); Data(int capacity); - Data(Data * otherData); Data(const char * bytes, unsigned int length); virtual ~Data(); - virtual String * description(); - virtual Object * copy(); - virtual bool isEqual(Object * otherObject); - virtual unsigned int hash(); - static Data * data(); static Data * dataWithCapacity(int capacity); static Data * dataWithContentsOfFile(String * filename); @@ -50,8 +37,27 @@ namespace mailcore { virtual String * stringWithCharset(const char * charset); virtual String * charsetWithFilteredHTML(bool filterHTML, String * hintCharset = NULL); virtual Data * decodedDataUsingEncoding(Encoding encoding); + + public: // subclass behavior + Data(Data * otherData); + virtual String * description(); + virtual Object * copy(); + virtual bool isEqual(Object * otherObject); + virtual unsigned int hash(); + + private: + char * mBytes; + unsigned int mLength; + unsigned int mAllocated; + void allocate(unsigned int length); + void reset(); + static String * normalizeCharset(String * charset); + String * charsetWithFilteredHTMLWithoutHint(bool filterHTML); + }; } #endif + +#endif diff --git a/src/core/basetypes/MCHash.h b/src/core/basetypes/MCHash.h index ecce9639..1ae547cd 100644 --- a/src/core/basetypes/MCHash.h +++ b/src/core/basetypes/MCHash.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCHASH_H_ +#ifdef __cplusplus + namespace mailcore { unsigned int hashCompute(const char * key, unsigned int len); @@ -9,3 +11,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCHashMap.h b/src/core/basetypes/MCHashMap.h index ec7955fc..92700190 100644 --- a/src/core/basetypes/MCHashMap.h +++ b/src/core/basetypes/MCHashMap.h @@ -4,6 +4,8 @@ #include <mailcore/MCObject.h> +#ifdef __cplusplus + namespace mailcore { class String; @@ -12,24 +14,12 @@ namespace mailcore { typedef HashMapCell HashMapIter; class HashMap : public Object { - private: - unsigned int mAllocated; - unsigned int mCount; - void ** mCells; - HashMapIter * iteratorBegin(); - HashMapIter * iteratorNext(HashMapIter * iter); - void allocate(unsigned int size); - void init(); public: HashMap(); - HashMap(HashMap * o); virtual ~HashMap(); static HashMap * hashMap(); - virtual String * description(); - virtual Object * copy(); - virtual unsigned int count(); virtual void setObjectForKey(Object * key, Object * value); virtual void removeObjectForKey(Object * key); @@ -37,8 +27,24 @@ namespace mailcore { virtual Array * allKeys(); virtual Array * allValues(); virtual void removeAllObjects(); + + public: // subclass behavior + HashMap(HashMap * o); + virtual String * description(); + virtual Object * copy(); + + 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/src/core/basetypes/MCLog.h b/src/core/basetypes/MCLog.h index 42246e61..49b18391 100644 --- a/src/core/basetypes/MCLog.h +++ b/src/core/basetypes/MCLog.h @@ -4,6 +4,8 @@ #include <stdio.h> +#ifdef __cplusplus + #define MCLog(...) mailcore::logInternal(NULL, __FILE__, __LINE__, 0, __VA_ARGS__) namespace mailcore { @@ -17,3 +19,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCMainThread.h b/src/core/basetypes/MCMainThread.h index db8e1141..31819a29 100644 --- a/src/core/basetypes/MCMainThread.h +++ b/src/core/basetypes/MCMainThread.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCMAINTHREAD_H +#ifdef __cplusplus + namespace mailcore { void callOnMainThread(void (*)(void *), void * context); void callOnMainThreadAndWait(void (*)(void *), void * context); @@ -9,3 +11,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCObject.h b/src/core/basetypes/MCObject.h index 9e323ebf..beda7471 100644 --- a/src/core/basetypes/MCObject.h +++ b/src/core/basetypes/MCObject.h @@ -4,15 +4,13 @@ #include <pthread.h> +#ifdef __cplusplus + namespace mailcore { class String; class Object { - private: - pthread_mutex_t mLock; - int mCounter; - void init(); public: Object(); virtual ~Object(); @@ -34,8 +32,15 @@ namespace mailcore { 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); + + private: + pthread_mutex_t mLock; + int mCounter; + void init(); }; } #endif + +#endif diff --git a/src/core/basetypes/MCOperation.h b/src/core/basetypes/MCOperation.h index 80bd8d30..c873f7e8 100644 --- a/src/core/basetypes/MCOperation.h +++ b/src/core/basetypes/MCOperation.h @@ -5,16 +5,13 @@ #include <pthread.h> #include <mailcore/MCObject.h> +#ifdef __cplusplus + namespace mailcore { class OperationCallback; class Operation : public Object { - private: - OperationCallback * mCallback; - bool mCancelled; - pthread_mutex_t mLock; - public: Operation(); virtual ~Operation(); @@ -26,8 +23,16 @@ namespace mailcore { virtual bool isCancelled(); virtual void main(); + + private: + OperationCallback * mCallback; + bool mCancelled; + pthread_mutex_t mLock; + }; } #endif + +#endif diff --git a/src/core/basetypes/MCOperationCallback.h b/src/core/basetypes/MCOperationCallback.h index e9623c76..7507d413 100644 --- a/src/core/basetypes/MCOperationCallback.h +++ b/src/core/basetypes/MCOperationCallback.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCOPERATIONCALLBACK_H_ +#ifdef __cplusplus + namespace mailcore { class Operation; @@ -14,3 +16,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCOperationQueue.h b/src/core/basetypes/MCOperationQueue.h index c584f33a..d9f7e78f 100644 --- a/src/core/basetypes/MCOperationQueue.h +++ b/src/core/basetypes/MCOperationQueue.h @@ -7,12 +7,22 @@ #include <mailcore/MCObject.h> #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { class Operation; class Array; class OperationQueue : public Object { + public: + OperationQueue(); + virtual ~OperationQueue(); + + virtual void addOperation(Operation * op); + + virtual unsigned int count(); + private: Array * mOperations; pthread_t mThreadID; @@ -31,17 +41,10 @@ namespace mailcore { void checkRunningOnMainThread(void * context); void checkRunningAfterDelay(void * context); - public: - OperationQueue(); - virtual ~OperationQueue(); - - virtual void addOperation(Operation * op); - - virtual unsigned int count(); - - //virtual void waitUntilAllOperationsAreFinished(); }; } #endif + +#endif diff --git a/src/core/basetypes/MCRange.h b/src/core/basetypes/MCRange.h index 752c4bec..9b978bfb 100644 --- a/src/core/basetypes/MCRange.h +++ b/src/core/basetypes/MCRange.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCRANGE_H_ +#ifdef __cplusplus + namespace mailcore { struct Range { @@ -13,3 +15,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/basetypes/MCSet.h b/src/core/basetypes/MCSet.h index b4a339d4..2d6df20c 100644 --- a/src/core/basetypes/MCSet.h +++ b/src/core/basetypes/MCSet.h @@ -4,6 +4,8 @@ #include <mailcore/MCObject.h> +#ifdef __cplusplus + namespace mailcore { class String; @@ -11,20 +13,13 @@ namespace mailcore { class HashMap; class Set : public Object { - private: - HashMap * mHash; - void init(); public: Set(); Set(Set * o); - virtual ~Set(); static Set * set(); static Set * setWithArray(Array * objects); - virtual String * description(); - virtual Object * copy(); - virtual unsigned int count(); virtual void addObject(Object * obj); virtual void removeObject(Object * obj); @@ -34,8 +29,19 @@ namespace mailcore { virtual Array * allObjects(); virtual void removeAllObjects(); virtual void addObjectsFromArray(Array * objects); + + public: // subclass behavior + virtual ~Set(); + virtual String * description(); + virtual Object * copy(); + + private: + HashMap * mHash; + void init(); }; } #endif + +#endif diff --git a/src/core/basetypes/MCString.h b/src/core/basetypes/MCString.h index 7a71b0f8..4cdee581 100644 --- a/src/core/basetypes/MCString.h +++ b/src/core/basetypes/MCString.h @@ -8,37 +8,22 @@ #include <stdarg.h> #include <unicode/utypes.h> +#ifdef __cplusplus + namespace mailcore { class Data; class Array; class String : public Object { - private: - UChar * mUnicodeChars; - unsigned int mLength; - unsigned int mAllocated; - void allocate(unsigned int length); - void appendCharactersLength(const UChar * unicodeCharacters, unsigned int length); - 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); - public: String(const UChar * unicodeChars = NULL); String(const UChar * unicodeChars, unsigned int length); String(const char * UTF8Characters); - String(String * otherString); String(Data * data, const char * charset); String(const char * bytes, unsigned int length, const char * charset = NULL); virtual ~String(); - virtual String * description(); - virtual Object * copy(); - virtual bool isEqual(Object * otherObject); - virtual unsigned int hash(); - static String * string(); static String * stringWithUTF8Format(const char * format, ...); static String * stringWithVUTF8Format(const char * format, va_list ap); @@ -115,8 +100,28 @@ namespace mailcore { virtual String * mUTF7DecodedString(); 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(); + + private: + UChar * mUnicodeChars; + unsigned int mLength; + unsigned int mAllocated; + void allocate(unsigned int length); + void appendCharactersLength(const UChar * unicodeCharacters, unsigned int length); + 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); }; } #endif + +#endif diff --git a/src/core/basetypes/MCUtils.h b/src/core/basetypes/MCUtils.h index 8dbbf5f4..9e3de1ac 100644 --- a/src/core/basetypes/MCUtils.h +++ b/src/core/basetypes/MCUtils.h @@ -2,6 +2,8 @@ #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) @@ -32,3 +34,5 @@ #define MCUTF8DESC(obj) ((obj) != NULL ? (obj)->description()->UTF8Characters() : NULL ) #endif + +#endif diff --git a/src/core/basetypes/MCValue.h b/src/core/basetypes/MCValue.h index 05f499b6..3d66d661 100644 --- a/src/core/basetypes/MCValue.h +++ b/src/core/basetypes/MCValue.h @@ -4,46 +4,16 @@ #include <mailcore/MCObject.h> +#ifdef __cplusplus + namespace mailcore { class String; class Value : public Object { - 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: - Value(Value * other); virtual ~Value(); - virtual String * description(); - - virtual bool isEqual(Object * otherObject); - virtual unsigned int hash(); - - Object * copy(); - static Value * valueWithBoolValue(bool value); static Value * valueWithCharValue(char value); static Value * valueWithUnsignedCharValue(unsigned char value); @@ -73,8 +43,42 @@ namespace mailcore { 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(); + + 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(); + }; } #endif + +#endif 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 diff --git a/src/core/pop/MCPOPMessageInfo.h b/src/core/pop/MCPOPMessageInfo.h index a70a3f80..5a87b3e4 100644 --- a/src/core/pop/MCPOPMessageInfo.h +++ b/src/core/pop/MCPOPMessageInfo.h @@ -4,24 +4,15 @@ #include <mailcore/MCBaseTypes.h> +#ifdef __cplusplus + namespace mailcore { class POPMessageInfo : public Object { - private: - unsigned int mIndex; - unsigned int mSize; - String * mUid; - - void init(); - public: POPMessageInfo(); - POPMessageInfo(POPMessageInfo * other); virtual ~POPMessageInfo(); - virtual String * description(); - virtual Object * copy(); - virtual void setIndex(unsigned int index); virtual unsigned int index(); @@ -30,8 +21,22 @@ namespace mailcore { 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/src/core/pop/MCPOPProgressCallback.h b/src/core/pop/MCPOPProgressCallback.h index 2fc1b66b..5a46b38e 100644 --- a/src/core/pop/MCPOPProgressCallback.h +++ b/src/core/pop/MCPOPProgressCallback.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCPOPPROGRESSCALLBACK_H_ +#ifdef __cplusplus + namespace mailcore { class POPSession; @@ -13,3 +15,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/pop/MCPOPSession.h b/src/core/pop/MCPOPSession.h index 523e1be6..cab3e50e 100644 --- a/src/core/pop/MCPOPSession.h +++ b/src/core/pop/MCPOPSession.h @@ -6,6 +6,8 @@ #include <mailcore/MCMessageConstants.h> #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { class POPMessageInfo; @@ -86,3 +88,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/rfc822/MCAttachment.h b/src/core/rfc822/MCAttachment.h index 225c6b00..0be168aa 100644 --- a/src/core/rfc822/MCAttachment.h +++ b/src/core/rfc822/MCAttachment.h @@ -7,21 +7,13 @@ #include <mailcore/MCAbstractMultipart.h> #include <mailcore/MCMessageConstants.h> +#ifdef __cplusplus + namespace mailcore { class MessagePart; class Attachment : public AbstractPart { - 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); - public: static String * mimeTypeForFilename(String * filename); static Attachment * attachmentWithContentOfFile(String * filename); @@ -30,18 +22,31 @@ namespace mailcore { static Attachment * attachmentWithText(String * text); Attachment(); - Attachment(Attachment * other); virtual ~Attachment(); - virtual String * description(); - virtual Object * copy(); - virtual void setData(Data * data); virtual Data * data(); static AbstractPart * attachmentsWithMIME(struct mailmime * mime); + + public: // subclass behavior + Attachment(Attachment * other); + virtual String * description(); + virtual Object * copy(); + + 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); }; } #endif + +#endif diff --git a/src/core/rfc822/MCMessageBuilder.h b/src/core/rfc822/MCMessageBuilder.h index 6a71b9e0..1d73f7d6 100644 --- a/src/core/rfc822/MCMessageBuilder.h +++ b/src/core/rfc822/MCMessageBuilder.h @@ -5,28 +5,17 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCAbstractMessage.h> +#ifdef __cplusplus + namespace mailcore { class Attachment; class MessageBuilder : public AbstractMessage { - private: - String * mHTMLBody; - String * mTextBody; - Array * mAttachments; - Array * mRelatedAttachments; - String * mBoundaryPrefix; - void init(); - Data * dataAndFilterBcc(bool filterBcc); - public: MessageBuilder(); - MessageBuilder(MessageBuilder * other); virtual ~MessageBuilder(); - virtual String * description(); - virtual Object * copy(); - virtual void setHTMLBody(String * htmlBody); virtual String * htmlBody(); @@ -47,8 +36,24 @@ namespace mailcore { virtual String * boundaryPrefix(); virtual Data * data(); + + public: // subclass behavior + MessageBuilder(MessageBuilder * other); + virtual String * description(); + virtual Object * copy(); + + private: + String * mHTMLBody; + String * mTextBody; + Array * mAttachments; + Array * mRelatedAttachments; + String * mBoundaryPrefix; + void init(); + Data * dataAndFilterBcc(bool filterBcc); }; }; #endif + +#endif diff --git a/src/core/rfc822/MCMessageParser.h b/src/core/rfc822/MCMessageParser.h index f3f835fa..06673ec4 100644 --- a/src/core/rfc822/MCMessageParser.h +++ b/src/core/rfc822/MCMessageParser.h @@ -6,28 +6,34 @@ #include <mailcore/MCAbstractMessage.h> #include <mailcore/MCAbstractPart.h> +#ifdef __cplusplus + namespace mailcore { class MessageParser : public AbstractMessage { - private: - Data * mData; - AbstractPart * mMainPart; - void init(); - public: static MessageParser * messageParserWithData(Data * data); MessageParser(Data * data); - MessageParser(MessageParser * other); virtual ~MessageParser(); + virtual AbstractPart * mainPart(); + virtual Data * data(); + + public: // subclass behavior + MessageParser(MessageParser * other); virtual String * description(); virtual Object * copy(); + + private: + Data * mData; + AbstractPart * mMainPart; + void init(); - virtual AbstractPart * mainPart(); - virtual Data * data(); }; }; #endif + +#endif diff --git a/src/core/rfc822/MCMessagePart.h b/src/core/rfc822/MCMessagePart.h index cbedec70..c4f80551 100644 --- a/src/core/rfc822/MCMessagePart.h +++ b/src/core/rfc822/MCMessagePart.h @@ -5,17 +5,21 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCAbstractMessagePart.h> +#ifdef __cplusplus + namespace mailcore { class MessagePart : public AbstractMessagePart { public: MessagePart(); - MessagePart(MessagePart * other); virtual ~MessagePart(); - + + public: // subclass behavior + MessagePart(MessagePart * other); virtual Object * copy(); }; } +#endif #endif diff --git a/src/core/rfc822/MCMultipart.h b/src/core/rfc822/MCMultipart.h index effe10f3..2853a2ed 100644 --- a/src/core/rfc822/MCMultipart.h +++ b/src/core/rfc822/MCMultipart.h @@ -5,16 +5,21 @@ #include <mailcore/MCBaseTypes.h> #include <mailcore/MCAbstractMultipart.h> +#ifdef __cplusplus + namespace mailcore { class Multipart : public AbstractMultipart { public: Multipart(); - Multipart(Multipart * other); virtual ~Multipart(); + public: // subclass behavior + Multipart(Multipart * other); virtual Object * copy(); }; } #endif + +#endif diff --git a/src/core/smtp/MCSMTPProgressCallback.h b/src/core/smtp/MCSMTPProgressCallback.h index 2537c2c3..d1c85e41 100644 --- a/src/core/smtp/MCSMTPProgressCallback.h +++ b/src/core/smtp/MCSMTPProgressCallback.h @@ -2,6 +2,8 @@ #define __MAILCORE_MCSMTPPROGRESSCALLBACK_H_ +#ifdef __cplusplus + namespace mailcore { class SMTPSession; @@ -13,3 +15,5 @@ namespace mailcore { } #endif + +#endif diff --git a/src/core/smtp/MCSMTPSession.h b/src/core/smtp/MCSMTPSession.h index 29e53ce4..dafe8b44 100644 --- a/src/core/smtp/MCSMTPSession.h +++ b/src/core/smtp/MCSMTPSession.h @@ -6,6 +6,8 @@ #include <mailcore/MCMessageConstants.h> #include <libetpan/libetpan.h> +#ifdef __cplusplus + namespace mailcore { class Address; @@ -13,38 +15,6 @@ namespace mailcore { class MessageBuilder; class SMTPSession : public Object { - private: - String * mHostname; - unsigned int mPort; - String * mUsername; - String * mPassword; - AuthType mAuthType; - ConnectionType mConnectionType; - time_t mTimeout; - bool mCheckCertificateEnabled; - bool mUseHeloIPEnabled; - - mailsmtp * mSmtp; - SMTPProgressCallback * mProgressCallback; - int mState; - String * mLastSMTPResponse; - int mLastLibetpanError; - int mLastSMTPResponseCode; - - 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); - void loginIfNeeded(ErrorCode * pError); - bool checkCertificate(); - - void sendMessage(Address * from, Array * recipients, Data * messageData, - SMTPProgressCallback * callback, ErrorCode * pError); - void sendMessage(MessageBuilder * msg, SMTPProgressCallback * callback, ErrorCode * pError); - public: SMTPSession(); virtual ~SMTPSession(); @@ -84,8 +54,42 @@ namespace mailcore { virtual void checkAccount(Address * from, ErrorCode * pError); virtual void sendMessage(Data * messageData, SMTPProgressCallback * callback, ErrorCode * pError); + + private: + String * mHostname; + unsigned int mPort; + String * mUsername; + String * mPassword; + AuthType mAuthType; + ConnectionType mConnectionType; + time_t mTimeout; + bool mCheckCertificateEnabled; + bool mUseHeloIPEnabled; + + mailsmtp * mSmtp; + SMTPProgressCallback * mProgressCallback; + int mState; + String * mLastSMTPResponse; + int mLastLibetpanError; + int mLastSMTPResponseCode; + + 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); + void loginIfNeeded(ErrorCode * pError); + bool checkCertificate(); + + void sendMessage(Address * from, Array * recipients, Data * messageData, + SMTPProgressCallback * callback, ErrorCode * pError); + void sendMessage(MessageBuilder * msg, SMTPProgressCallback * callback, ErrorCode * pError); }; } #endif + +#endif |