aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/pop/MCPOPAsyncSession.h
blob: fe713c4e67312e324d77d76cd11901692b21411a (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
//
//  MCPopAsyncSession.h
//  mailcore2
//
//  Created by DINH Viêt Hoà on 1/16/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#ifndef __mailcore2__MCPopAsyncSession__
#define __mailcore2__MCPopAsyncSession__

#include <mailcore/MCBaseTypes.h>

namespace mailcore {
    
    class POPOperation;
    class POPSession;
    class POPFetchHeaderOperation;
    class POPFetchMessageOperation;
    class POPDeleteMessagesOperation;
    class POPFetchMessagesOperation;
	
	class POPAsyncSession : public Object {
	private:
        POPSession * mSession;
        OperationQueue * mQueue;
		
	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 * fetchMessage(unsigned int index);
        
        virtual POPOperation * deleteMessages(Array * indexes);
        
        // private
        virtual void runOperation(POPOperation * operation);
        virtual POPSession * session();
    };
}

#endif /* defined(__mailcore2__MCPopAsyncSession__) */