blob: 954a825c9a4a5c8317a4f338644a43f143fb74a6 (
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
|
//
// 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;
/** Adds a content type parameter.*/
- (void) setContentTypeParameterValue:(NSString *)value forName:(NSString *)name;
/** Remove a given content type parameter.*/
- (void) removeContentTypeParameterForName:(NSString *)name;
/** Returns the value of a given content type parameter.*/
- (NSString *) contentTypeParameterValueForName:(NSString *)name;
/** Returns an array with the names of all content type parameters.*/
- (NSArray * /* NSString */) allContentTypeParametersNames;
@end
#endif
|