aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/pop/MCPOPAsyncSession.h
blob: 41ada0efdd533d7c40c39baade99313072c7f9fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
//  MCPopAsyncSession.h
//  mailcore2
//
//  Created by DINH Viêt Hoà on 1/16/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#ifndef __MAILCORE_MCPOPASYNCSESSION_H_

#define __MAILCORE_MCPOPASYNCSESSION_H_

#include <MailCore/MCBaseTypes.h>

#ifdef __cplusplus

namespace mailcore {
    
    class POPOperation;
    class POPSession;
    class POPFetchHeaderOperation;
    class POPFetchMessageOperation;
    class POPDeleteMessagesOperation;
    class POPFetchMessagesOperation;
	
	class POPAsyncSession : public Object {
	public:
		POPAsyncSession();
		virtual ~POPAsyncSession();
		
		virtual void setHostname(String * hostname);
		virtual String * hostname();
        
		virtual void setPort(unsigned int port);
		virtual unsigned int port();
        
		virtual void setUsername(String * login);
		virtual String * username();
        
		virtual void setPassword(String * password);
		virtual String * password();
        
		virtual void setAuthType(AuthType authType);
		virtual AuthType authType();
        
		virtual void setConnectionType(ConnectionType connectionType);
		virtual ConnectionType connectionType();
        
		virtual void setTimeout(time_t timeout);
		virtual time_t timeout();
		
		virtual void setCheckCertificateEnabled(bool enabled);
		virtual bool isCheckCertificateEnabled();
        
		virtual POPFetchMessagesOperation * fetchMessagesOperation();
        
        virtual POPFetchHeaderOperation * fetchHeaderOperation(unsigned int index);
        
		virtual POPFetchMessageOperation * fetchMessageOperation(unsigned int index);
        
        // Will disconnect.
        virtual POPOperation * deleteMessagesOperation(IndexSet * indexes);
        
	private:
        POPSession * mSession;
        OperationQueue * mQueue;
		
    public: // private
        virtual void runOperation(POPOperation * operation);
        virtual POPSession * session();
        
    };
}

#endif

#endif