diff options
author | Prapat <prapat@throughwave.co.th> | 2014-09-02 18:11:09 +0700 |
---|---|---|
committer | Prapat <prapat@throughwave.co.th> | 2014-09-02 18:11:09 +0700 |
commit | 485fa9d194d869b7e7f7dc3bcebba6ed2bc6fd03 (patch) | |
tree | 7b8f9dd166de07576696410c04f6d2f31bc7cfa7 /src/objc | |
parent | 634bbb6bc3a8f24bb32d5f7a0b5691a0caf606b8 (diff) |
Add IMAP search body
Diffstat (limited to 'src/objc')
-rw-r--r-- | src/objc/abstract/MCOConstants.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPSearchExpression.h | 9 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPSearchExpression.mm | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/objc/abstract/MCOConstants.h b/src/objc/abstract/MCOConstants.h index 32a1b1bb..53406727 100644 --- a/src/objc/abstract/MCOConstants.h +++ b/src/objc/abstract/MCOConstants.h @@ -182,6 +182,8 @@ typedef NS_ENUM(NSInteger, MCOIMAPSearchKind) { MCOIMAPSearchKindSubject, /** Match content of the message.*/ MCOIMAPSearchKindContent, + /** Match body of the message.*/ + MCOIMAPSearchKindBody, /** Match uids */ MCOIMAPSearchKindUids, /** Match headers of the message.*/ diff --git a/src/objc/imap/MCOIMAPSearchExpression.h b/src/objc/imap/MCOIMAPSearchExpression.h index fbffb8f3..5161a6ee 100644 --- a/src/objc/imap/MCOIMAPSearchExpression.h +++ b/src/objc/imap/MCOIMAPSearchExpression.h @@ -91,6 +91,15 @@ + (MCOIMAPSearchExpression *) searchContent:(NSString *)value; /** + Creates a search expression that matches the body of an email. + + Example: + + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchBody:@"building"] + */ ++ (MCOIMAPSearchExpression *) searchBody:(NSString *)value; + +/** Creates a search expression that matches the uids specified. Example: diff --git a/src/objc/imap/MCOIMAPSearchExpression.mm b/src/objc/imap/MCOIMAPSearchExpression.mm index f395596c..57ae8455 100644 --- a/src/objc/imap/MCOIMAPSearchExpression.mm +++ b/src/objc/imap/MCOIMAPSearchExpression.mm @@ -96,6 +96,11 @@ return MCO_TO_OBJC(mailcore::IMAPSearchExpression::searchContent([value mco_mcString])); } ++ (MCOIMAPSearchExpression *) searchBody:(NSString *)value +{ + return MCO_TO_OBJC(mailcore::IMAPSearchExpression::searchBody([value mco_mcString])); +} + + (MCOIMAPSearchExpression *) searchUIDs:(MCOIndexSet *) uids { return MCO_TO_OBJC(mailcore::IMAPSearchExpression::searchUIDs(MCO_FROM_OBJC(mailcore::IndexSet, uids))); |