diff options
author | CodaFi <devteam.codafi@gmail.com> | 2014-08-13 14:53:51 -0600 |
---|---|---|
committer | CodaFi <devteam.codafi@gmail.com> | 2014-08-13 14:53:51 -0600 |
commit | 38d848cb9c8d64e910804b7b6d559a9a31d2ad99 (patch) | |
tree | d249b20e796b5927842b2712086ab9c3bc438a47 /src/async/nntp/MCNNTPAsyncSession.h | |
parent | 988fe081b340e5c1040a6d78db793107972c7bfb (diff) |
NNTP support
Diffstat (limited to 'src/async/nntp/MCNNTPAsyncSession.h')
-rw-r--r-- | src/async/nntp/MCNNTPAsyncSession.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/async/nntp/MCNNTPAsyncSession.h b/src/async/nntp/MCNNTPAsyncSession.h new file mode 100644 index 00000000..ad2ee699 --- /dev/null +++ b/src/async/nntp/MCNNTPAsyncSession.h @@ -0,0 +1,85 @@ +#ifndef MAILCORE_MCNNTPASYNCSESSION_H + +#define MAILCORE_MCNNTPASYNCSESSION_H + +#include <MailCore/MCBaseTypes.h> + +#ifdef __cplusplus + +namespace mailcore { + + class NNTPOperation; + class NNTPSession; + class NNTPFetchHeaderOperation; + class NNTPFetchMessageOperation; + class NNTPFetchMessagesOperation; + class NNTPListNewsgroupsOperation; + class NNTPOperationQueueCallback; + class NNTPConnectionLogger; + + class NNTPAsyncSession : public Object { + public: + NNTPAsyncSession(); + virtual ~NNTPAsyncSession(); + + virtual void setHostname(String * hostname); + virtual String * hostname(); + + virtual void setPort(unsigned int port); + virtual unsigned int port(); + + virtual void setUsername(String * login); + virtual String * username(); + + virtual void setPassword(String * password); + virtual String * password(); + + virtual void setConnectionType(ConnectionType connectionType); + virtual ConnectionType connectionType(); + + virtual void setTimeout(time_t timeout); + virtual time_t timeout(); + + virtual void setCheckCertificateEnabled(bool enabled); + virtual bool isCheckCertificateEnabled(); + + virtual void setConnectionLogger(ConnectionLogger * logger); + virtual ConnectionLogger * connectionLogger(); + +#ifdef __APPLE__ + virtual void setDispatchQueue(dispatch_queue_t dispatchQueue); + virtual dispatch_queue_t dispatchQueue(); +#endif + + virtual NNTPFetchMessagesOperation * fetchMessagesOperation(String * group); + + virtual NNTPFetchHeaderOperation * fetchHeaderOperation(unsigned int index); + + virtual NNTPFetchMessageOperation * fetchMessageOperation(unsigned int index); + + virtual NNTPListNewsgroupsOperation * listAllNewsgroupsOperation(); + virtual NNTPListNewsgroupsOperation * listSubscribedNewsgroupsOperation(); + + virtual NNTPOperation * disconnectOperation(); + + virtual NNTPOperation * checkAccountOperation(); + + private: + NNTPSession * mSession; + OperationQueue * mQueue; + NNTPOperationQueueCallback * mQueueCallback; + ConnectionLogger * mConnectionLogger; + pthread_mutex_t mConnectionLoggerLock; + NNTPConnectionLogger * mInternalLogger; + + public: // private + virtual void runOperation(NNTPOperation * operation); + virtual NNTPSession * session(); + virtual void logConnection(ConnectionLogType logType, Data * buffer); + }; + +} + +#endif + +#endif |