aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/rfc822/MCOAttachment.h
blob: 7c6a0d7bb32294f700dee792ae985621ae7eee80 (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
//
//  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 <NSCopying>

// 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 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;
 
@end

#endif