aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/rfc822
diff options
context:
space:
mode:
Diffstat (limited to 'src/objc/rfc822')
-rw-r--r--src/objc/rfc822/MCOAttachment.h2
-rw-r--r--src/objc/rfc822/MCOAttachment.mm8
-rw-r--r--src/objc/rfc822/MCOMessageBuilder.h10
-rw-r--r--src/objc/rfc822/MCOMessageBuilder.mm16
-rw-r--r--src/objc/rfc822/MCOMessageParser.h12
-rw-r--r--src/objc/rfc822/MCOMessageParser.mm23
-rw-r--r--src/objc/rfc822/MCOMessagePart.mm8
-rw-r--r--src/objc/rfc822/MCOMultipart.h2
-rw-r--r--src/objc/rfc822/MCOMultipart.mm8
9 files changed, 54 insertions, 35 deletions
diff --git a/src/objc/rfc822/MCOAttachment.h b/src/objc/rfc822/MCOAttachment.h
index 50a2d1a7..560f4590 100644
--- a/src/objc/rfc822/MCOAttachment.h
+++ b/src/objc/rfc822/MCOAttachment.h
@@ -16,7 +16,7 @@
It can either parsed from RFC 822 message data or created to build a message.*/
-@interface MCOAttachment : MCOAbstractPart <NSCopying>
+@interface MCOAttachment : MCOAbstractPart
/** Returns a MIME type for a filename.*/
+ (NSString *) mimeTypeForFilename:(NSString *)filename;
diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm
index 423ac0df..5b20e583 100644
--- a/src/objc/rfc822/MCOAttachment.mm
+++ b/src/objc/rfc822/MCOAttachment.mm
@@ -26,14 +26,6 @@
MCORegisterClass(self, &typeid(nativeType));
}
-- (id) copyWithZone:(NSZone *)zone
-{
- nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy();
- id result = [[self class] mco_objectWithMCObject:nativeObject];
- MC_SAFE_RELEASE(nativeObject);
- return [result retain];
-}
-
+ (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object
{
mailcore::Attachment * attachment = (mailcore::Attachment *) object;
diff --git a/src/objc/rfc822/MCOMessageBuilder.h b/src/objc/rfc822/MCOMessageBuilder.h
index 217ec49c..5ba199a4 100644
--- a/src/objc/rfc822/MCOMessageBuilder.h
+++ b/src/objc/rfc822/MCOMessageBuilder.h
@@ -61,6 +61,16 @@
/** HTML rendering of the message to be displayed in a web view. The delegate can be nil.*/
- (NSString *) htmlRenderingWithDelegate:(id <MCOHTMLRendererDelegate>)delegate;
+/** HTML rendering of the body of the message to be displayed in a web view.*/
+- (NSString *) htmlBodyRendering;
+
+/** Text rendering of the message.*/
+- (NSString *) plainTextRendering;
+
+/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up.
+ This method can be used to generate the summary of the message.*/
+- (NSString *) plainTextBodyRendering;
+
@end
#endif
diff --git a/src/objc/rfc822/MCOMessageBuilder.mm b/src/objc/rfc822/MCOMessageBuilder.mm
index 2cb26448..dfcf6028 100644
--- a/src/objc/rfc822/MCOMessageBuilder.mm
+++ b/src/objc/rfc822/MCOMessageBuilder.mm
@@ -75,4 +75,20 @@ MCO_OBJC_SYNTHESIZE_STRING(setBoundaryPrefix, boundaryPrefix)
return result;
}
+
+- (NSString *) htmlBodyRendering
+{
+ return MCO_OBJC_BRIDGE_GET(htmlBodyRendering);
+}
+
+- (NSString *) plainTextRendering
+{
+ return MCO_OBJC_BRIDGE_GET(plainTextRendering);
+}
+
+- (NSString *) plainTextBodyRendering
+{
+ return MCO_OBJC_BRIDGE_GET(plainTextBodyRendering);
+}
+
@end
diff --git a/src/objc/rfc822/MCOMessageParser.h b/src/objc/rfc822/MCOMessageParser.h
index fa46132b..5a009bb7 100644
--- a/src/objc/rfc822/MCOMessageParser.h
+++ b/src/objc/rfc822/MCOMessageParser.h
@@ -20,7 +20,7 @@
@protocol MCOHTMLRendererDelegate;
-@interface MCOMessageParser : MCOAbstractMessage <NSCopying>
+@interface MCOMessageParser : MCOAbstractMessage
/** returns a parsed message from the given RFC 822 data.*/
+ (MCOMessageParser *) messageParserWithData:(NSData *)data;
@@ -38,6 +38,16 @@
/** HTML rendering of the message to be displayed in a web view. delegate can be nil.*/
- (NSString *) htmlRenderingWithDelegate:(id <MCOHTMLRendererDelegate>)delegate;
+/** HTML rendering of the body of the message to be displayed in a web view.*/
+- (NSString *) htmlBodyRendering;
+
+/** Text rendering of the message.*/
+- (NSString *) plainTextRendering;
+
+/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up.
+ This method can be used to generate the summary of the message.*/
+- (NSString *) plainTextBodyRendering;
+
@end
#endif
diff --git a/src/objc/rfc822/MCOMessageParser.mm b/src/objc/rfc822/MCOMessageParser.mm
index 05f52f54..8e3f1261 100644
--- a/src/objc/rfc822/MCOMessageParser.mm
+++ b/src/objc/rfc822/MCOMessageParser.mm
@@ -26,14 +26,6 @@
MCORegisterClass(self, &typeid(nativeType));
}
-- (id) copyWithZone:(NSZone *)zone
-{
- nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy();
- id result = [[self class] mco_objectWithMCObject:nativeObject];
- MC_SAFE_RELEASE(nativeObject);
- return [result retain];
-}
-
+ (id) mco_objectWithMCObject:(mailcore::Object *)object
{
mailcore::MessageParser * msg = (mailcore::MessageParser *) object;
@@ -77,4 +69,19 @@
return result;
}
+- (NSString *) htmlBodyRendering
+{
+ return MCO_OBJC_BRIDGE_GET(htmlBodyRendering);
+}
+
+- (NSString *) plainTextRendering
+{
+ return MCO_OBJC_BRIDGE_GET(plainTextRendering);
+}
+
+- (NSString *) plainTextBodyRendering
+{
+ return MCO_OBJC_BRIDGE_GET(plainTextBodyRendering);
+}
+
@end
diff --git a/src/objc/rfc822/MCOMessagePart.mm b/src/objc/rfc822/MCOMessagePart.mm
index f1535049..4ed4a6d7 100644
--- a/src/objc/rfc822/MCOMessagePart.mm
+++ b/src/objc/rfc822/MCOMessagePart.mm
@@ -22,14 +22,6 @@
MCORegisterClass(self, &typeid(nativeType));
}
-- (id) copyWithZone:(NSZone *)zone
-{
- nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy();
- id result = [[self class] mco_objectWithMCObject:nativeObject];
- MC_SAFE_RELEASE(nativeObject);
- return [result retain];
-}
-
+ (id) mco_objectWithMCObject:(mailcore::Object *)object
{
mailcore::MessagePart * part = (mailcore::MessagePart *) object;
diff --git a/src/objc/rfc822/MCOMultipart.h b/src/objc/rfc822/MCOMultipart.h
index e45d4a0c..a730b8a4 100644
--- a/src/objc/rfc822/MCOMultipart.h
+++ b/src/objc/rfc822/MCOMultipart.h
@@ -14,7 +14,7 @@
/** Multipart parsed from RFC 822 message data. */
-@interface MCOMultipart : MCOAbstractMultipart <NSCopying>
+@interface MCOMultipart : MCOAbstractMultipart
@end
diff --git a/src/objc/rfc822/MCOMultipart.mm b/src/objc/rfc822/MCOMultipart.mm
index 2267f775..78fa1a98 100644
--- a/src/objc/rfc822/MCOMultipart.mm
+++ b/src/objc/rfc822/MCOMultipart.mm
@@ -22,14 +22,6 @@
MCORegisterClass(self, &typeid(nativeType));
}
-- (id) copyWithZone:(NSZone *)zone
-{
- nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy();
- id result = [[self class] mco_objectWithMCObject:nativeObject];
- MC_SAFE_RELEASE(nativeObject);
- return [result retain];
-}
-
+ (id) mco_objectWithMCObject:(mailcore::Object *)object
{
mailcore::Attachment * attachment = (mailcore::Attachment *) object;