aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-09-22 22:13:31 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-09-22 22:13:31 -0700
commitde2b44501bf3da0eed83905f44eed75059e9e401 (patch)
tree9b9029c69d07ba19a9257550a4ab79871819a312 /src/objc
parentc001526075610a35a05573da749b8ecdde3077ba (diff)
Simplified extra headers implementation and content-types parameters
Diffstat (limited to 'src/objc')
-rw-r--r--src/objc/abstract/MCOAbstractPart.h12
-rw-r--r--src/objc/abstract/MCOAbstractPart.mm20
-rw-r--r--src/objc/rfc822/MCOAttachment.h12
-rw-r--r--src/objc/rfc822/MCOAttachment.mm19
4 files changed, 32 insertions, 31 deletions
diff --git a/src/objc/abstract/MCOAbstractPart.h b/src/objc/abstract/MCOAbstractPart.h
index e30f09bf..30dd8f5f 100644
--- a/src/objc/abstract/MCOAbstractPart.h
+++ b/src/objc/abstract/MCOAbstractPart.h
@@ -82,6 +82,18 @@ typedef NS_ENUM(NSInteger, MCOPartType) {
/** Returns a string representation of the data according to charset.*/
- (NSString *) decodedStringForData:(NSData *)data;
+/** 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
diff --git a/src/objc/abstract/MCOAbstractPart.mm b/src/objc/abstract/MCOAbstractPart.mm
index d55422d5..8608ec61 100644
--- a/src/objc/abstract/MCOAbstractPart.mm
+++ b/src/objc/abstract/MCOAbstractPart.mm
@@ -87,4 +87,24 @@ MCO_OBJC_SYNTHESIZE_BOOL(setInlineAttachment, isInlineAttachment)
{
return [NSString mco_stringWithMCString:MCO_NATIVE_INSTANCE->decodedStringForData([data mco_mcData])];
}
+
+- (void) setContentTypeParameterValue:(NSString *)value forName:(NSString *)name
+{
+ MCO_NATIVE_INSTANCE->setContentTypeParameter(MCO_FROM_OBJC(mailcore::String, name), MCO_FROM_OBJC(mailcore::String, value));
+}
+
+- (NSString *) contentTypeParameterValueForName:(NSString *)name
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->contentTypeParameterValueForName((MCO_FROM_OBJC(mailcore::String, name))));
+}
+- (void) removeContentTypeParameterForName:(NSString *)name
+{
+ MCO_NATIVE_INSTANCE->removeContentTypeParameter(MCO_FROM_OBJC(mailcore::String, name));
+}
+
+- (NSArray * /* NSString */) allContentTypeParametersNames
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->allContentTypeParametersNames());
+}
+
@end
diff --git a/src/objc/rfc822/MCOAttachment.h b/src/objc/rfc822/MCOAttachment.h
index 954a825c..eec1bd19 100644
--- a/src/objc/rfc822/MCOAttachment.h
+++ b/src/objc/rfc822/MCOAttachment.h
@@ -42,18 +42,6 @@
/** 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
diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm
index 18c13693..afaf96af 100644
--- a/src/objc/rfc822/MCOAttachment.mm
+++ b/src/objc/rfc822/MCOAttachment.mm
@@ -90,23 +90,4 @@ MCO_OBJC_SYNTHESIZE_DATA(setData, data)
return [NSString mco_stringWithMCString:result];
}
-- (void) setContentTypeParameterValue:(NSString *)value forName:(NSString *)name
-{
- MCO_NATIVE_INSTANCE->setContentTypeParameter(MCO_FROM_OBJC(mailcore::String, name), MCO_FROM_OBJC(mailcore::String, value));
-}
-
-- (NSString *) contentTypeParameterValueForName:(NSString *)name
-{
- return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->contentTypeParameterValueForName((MCO_FROM_OBJC(mailcore::String, name))));
-}
-- (void) removeContentTypeParameterForName:(NSString *)name
-{
- MCO_NATIVE_INSTANCE->removeContentTypeParameter(MCO_FROM_OBJC(mailcore::String, name));
-}
-
-- (NSArray * /* NSString */) allContentTypeParametersNames
-{
- return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->allContentTypeParametersNames());
-}
-
@end