aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/rfc822/MCOAttachment.h
blob: eec1bd198436e954484b1d1ddb4a7e526a8b53a6 (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
//
//  MCOAttachment.h
//  mailcore2
//
//  Created by DINH Viêt Hoà on 3/22/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#ifndef MAILCORE_MCOATTACHMENT_H

#define MAILCORE_MCOATTACHMENT_H

#import <MailCore/MCOAbstractPart.h>

/** This is a single part.

    It can either parsed from RFC 822 message data or created to build a message.*/

@interface MCOAttachment : MCOAbstractPart

/** Returns a MIME type for a filename.*/
+ (NSString *) mimeTypeForFilename:(NSString *)filename;

/** Returns a file attachment with the content of the given file.*/
+ (MCOAttachment *) attachmentWithContentsOfFile:(NSString *)filename;

/** Returns a file attachment with the given data and filename.*/
+ (MCOAttachment *) attachmentWithData:(NSData *)data filename:(NSString *)filename;

/** Returns a part with an HTML content.*/
+ (MCOAttachment *) attachmentWithHTMLString:(NSString *)htmlString;

/** Returns a part with a RFC 822 messsage attachment.*/
+ (MCOAttachment *) attachmentWithRFC822Message:(NSData *)messageData;

/** Returns a part with an plain text content.*/
+ (MCOAttachment *) attachmentWithText:(NSString *)text;

/** Decoded data of the part.*/
@property (nonatomic, strong) NSData * data;

/** Returns string representation according to charset*/
- (NSString *) decodedString;

@end

#endif