aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/abstract/MCAbstractPart.h
blob: b38c1b385ed282aa9558cb1def16651019316e8b (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
#ifndef __MAILCORE_MCABSTRACTPART_H_

#define __MAILCORE_MCABSTRACTPART_H_

#include <MailCore/MCBaseTypes.h>
#include <MailCore/MCMessageConstants.h>

#ifdef __cplusplus

namespace mailcore {

	class AbstractMessage;

	class AbstractPart : public Object {
	public:
		AbstractPart();
		virtual ~AbstractPart();
		
		virtual PartType partType();
		virtual void setPartType(PartType type);
		
		virtual String * filename();
		virtual void setFilename(String * filename);
		
		virtual String * mimeType();
		virtual void setMimeType(String * mimeType);
		
		virtual String * charset();
		virtual void setCharset(String * charset);
		
		virtual String * uniqueID();
		virtual void setUniqueID(String * uniqueID);
        
		virtual String * contentID();
		virtual void setContentID(String * contentID);
		
		virtual String * contentLocation();
		virtual void setContentLocation(String * contentLocation);
		
		virtual bool isInlineAttachment();
		virtual void setInlineAttachment(bool inlineAttachment);
		
        virtual AbstractPart * partForContentID(String * contentID);
        virtual AbstractPart * partForUniqueID(String * uniqueID);
        
		virtual String * decodedStringForData(Data * data);
		
    public: // subclass behavior
		AbstractPart(AbstractPart * other);
		virtual String * description();
		virtual Object * copy();
        
    public: // private
		virtual void importIMAPFields(struct mailimap_body_fields * fields,
                                      struct mailimap_body_ext_1part * extension);
        virtual void applyUniquePartID();
        
	private:
		String * mUniqueID;
		String * mFilename;
		String * mMimeType;
		String * mCharset;
		String * mContentID;
		String * mContentLocation;
		bool mInlineAttachment;
		PartType mPartType;
		void init();
	};
	
}

#endif

#endif