aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/abstract/MCAddress.h
blob: e6644576e41d82cb8194f0d5c53142ad6922e639 (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
#ifndef MAILCORE_MCADDRESS_H

#define MAILCORE_MCADDRESS_H

#include <MailCore/MCBaseTypes.h>

#ifdef __cplusplus

namespace mailcore {
    
    class MAILCORE_EXPORT Address : public Object {
    public:
        Address();
        virtual ~Address();
        
        static Address * addressWithDisplayName(String * displayName, String * mailbox);
        static Address * addressWithMailbox(String * mailbox);
        static Address * addressWithRFC822String(String * RFC822String);
        static Address * addressWithNonEncodedRFC822String(String * nonEncodedRFC822String);
        
        static Array * addressesWithRFC822String(String * string);
        static Array * addressesWithNonEncodedRFC822String(String * string);
        
        static String * RFC822StringForAddresses(Array * addresses);
        static String * nonEncodedRFC822StringForAddresses(Array * addresses);
        
        virtual void setDisplayName(String * displayName);
        virtual String * displayName();
        
        virtual void setMailbox(String * address);
        virtual String * mailbox();
        
        virtual String * RFC822String();
        virtual String * nonEncodedRFC822String();
        
    public: // subclass behavior.
        Address(Address * other);
        virtual String * description();
        virtual bool isEqual(Object * otherObject);
        virtual unsigned int hash();
        virtual Object * copy();
        virtual HashMap * serializable();
        virtual void importSerializable(HashMap * serializable);
        
    public: // private
        // Must be released
        virtual struct mailimf_address * createIMFAddress();
        virtual struct mailimf_mailbox * createIMFMailbox();
        
        // Additions
        static Address * addressWithIMFMailbox(struct mailimf_mailbox * mb);
        static Address * addressWithNonEncodedIMFMailbox(struct mailimf_mailbox * mb);
        static Address * addressWithIMAPAddress(struct mailimap_address * imap_addr);
        
    private:
        String * mDisplayName;
        String * mMailbox;
        void init();
    };
    
}

#endif

#endif