Adapter for libpepmime, offering ObjC API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
1.5 KiB

//
// PEPMessage+PEPMessage_MIME.h
// pEpMimeObjCAdapter_macOS
//
// Created by Andreas Buff on 01.07.21.
//
#include <PEPObjCTypes_macOS/PEPObjCTypes_macOS.h>
NS_ASSUME_NONNULL_BEGIN
@interface PEPMessage (PEPMessage_MIME)
/// @param error Is guaranteed to be set in error case
/// @return MIME representation of this message, nil in error case
- (nullable NSData*)mimeDataWithError:(NSError **)error;
/// @param error Is guaranteed to be set in error case
/// @return MIME representation of this message, nil in error case
- (nullable NSString*)mimeStringWithError:(NSError **)error;
/// Factory method, creating a PEPMessage form the given MIME.
/// @note Re-set or update all Identities afterwards (from, to, cc, bcc, ...) with what you
/// know (userID, username, ...).
/// @param mimeData MIME data to create message with
/// @param error Is guaranteed to be set in error case
/// @return PEPMessage with given data, `nil`in error case
+ (nullable instancetype)pEpMessageWithMimeData:(NSData *)mimeData error:(NSError **)error;
/// Factory method, creating a PEPMessage form the given MIME.
/// @note Re-set or update all Identities afterwards (from, to, cc, bcc, ...) with what you
/// know (userID, username, ...).
/// @param mimeString MIME String to create message with
/// @param error Is guaranteed to be set in error case
/// @return PEPMessage with given data, `nil`in error case
+ (nullable instancetype)pEpMessageWithMimeString:(NSString *)mimeString error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END