aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc
diff options
context:
space:
mode:
authorGravatar Viktor Gedzenko <foxinushka@gmail.com>2014-07-31 14:28:42 +0300
committerGravatar Viktor Gedzenko <foxinushka@gmail.com>2014-07-31 14:28:42 +0300
commitee2dd6be849dbbc10572f71434a65c10800246d4 (patch)
tree8ed9f1a69ac19842e77fa642e1fdd4f4f2c165e2 /src/objc
parent6f5f44ff92337b6f34e6f6d10d9135661b164b0c (diff)
Added extra parameters to attachment
Diffstat (limited to 'src/objc')
-rw-r--r--src/objc/rfc822/MCOAttachment.h14
-rw-r--r--src/objc/rfc822/MCOAttachment.mm19
2 files changed, 32 insertions, 1 deletions
diff --git a/src/objc/rfc822/MCOAttachment.h b/src/objc/rfc822/MCOAttachment.h
index 8094d474..03ccbeab 100644
--- a/src/objc/rfc822/MCOAttachment.h
+++ b/src/objc/rfc822/MCOAttachment.h
@@ -41,7 +41,19 @@
/** Returns string representation according to charset*/
- (NSString *) decodedString;
-
+
+/** Adds a custom parameter.*/
+- (void) setExtraParameterValue:(NSString *)value forName:(NSString *)name;
+
+/** Remove a given custom parameter.*/
+- (void) removeExtraParameterForName:(NSString *)name;
+
+/** Returns the value of a given custom parameter.*/
+- (NSString *) extraParameterValueForName:(NSString *)name;
+
+/** Returns an array with the names of all custom headers.*/
+- (NSArray * /* NSString */) allExtraParametersNames;
+
@end
#endif
diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm
index afaf96af..3892ee78 100644
--- a/src/objc/rfc822/MCOAttachment.mm
+++ b/src/objc/rfc822/MCOAttachment.mm
@@ -90,4 +90,23 @@ MCO_OBJC_SYNTHESIZE_DATA(setData, data)
return [NSString mco_stringWithMCString:result];
}
+- (void) setExtraParameterValue:(NSString *)value forName:(NSString *)name
+{
+ MCO_NATIVE_INSTANCE->setExtraParameter(MCO_FROM_OBJC(mailcore::String, name), MCO_FROM_OBJC(mailcore::String, value));
+}
+
+- (NSString *) extraParameterValueForName:(NSString *)name
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->extraParameterValueForName((MCO_FROM_OBJC(mailcore::String, name))));
+}
+- (void) removeExtraParameterForName:(NSString *)name
+{
+ MCO_NATIVE_INSTANCE->removeExtraParameter(MCO_FROM_OBJC(mailcore::String, name));
+}
+
+- (NSArray * /* NSString */) allExtraParametersNames
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->allExtraParametersNames());
+}
+
@end