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

  1. //
  2. // PEPMessage+PEPMessage_MIME.h
  3. // pEpMimeObjCAdapter_macOS
  4. //
  5. // Created by Andreas Buff on 01.07.21.
  6. //
  7. #include <PEPObjCTypes_macOS/PEPObjCTypes_macOS.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @interface PEPMessage (PEPMessage_MIME)
  10. /// @param error Is guaranteed to be set in error case
  11. /// @return MIME representation of this message, nil in error case
  12. - (nullable NSData*)mimeDataWithError:(NSError **)error;
  13. /// @param error Is guaranteed to be set in error case
  14. /// @return MIME representation of this message, nil in error case
  15. - (nullable NSString*)mimeStringWithError:(NSError **)error;
  16. /// Factory method, creating a PEPMessage form the given MIME.
  17. /// @note Re-set or update all Identities afterwards (from, to, cc, bcc, ...) with what you
  18. /// know (userID, username, ...).
  19. /// @param mimeData MIME data to create message with
  20. /// @param error Is guaranteed to be set in error case
  21. /// @return PEPMessage with given data, `nil`in error case
  22. + (nullable instancetype)pEpMessageWithMimeData:(NSData *)mimeData error:(NSError **)error;
  23. /// Factory method, creating a PEPMessage form the given MIME.
  24. /// @note Re-set or update all Identities afterwards (from, to, cc, bcc, ...) with what you
  25. /// know (userID, username, ...).
  26. /// @param mimeString MIME String to create message with
  27. /// @param error Is guaranteed to be set in error case
  28. /// @return PEPMessage with given data, `nil`in error case
  29. + (nullable instancetype)pEpMessageWithMimeString:(NSString *)mimeString error:(NSError **)error;
  30. @end
  31. NS_ASSUME_NONNULL_END