objc2-mail-kit 0.3.2

Bindings to the MailKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Contains information about an outging mail message after any security measures have been applied.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageencodingresult?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MEMessageEncodingResult;
);

extern_conformance!(
    unsafe impl NSCoding for MEMessageEncodingResult {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MEMessageEncodingResult {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for MEMessageEncodingResult {}
);

impl MEMessageEncodingResult {
    extern_methods!(
        #[cfg(feature = "MEEncodedOutgoingMessage")]
        /// The encoded message. Nil if no need to encode or an error occured while encoding
        #[unsafe(method(encodedMessage))]
        #[unsafe(method_family = none)]
        pub unsafe fn encodedMessage(&self) -> Option<Retained<MEEncodedOutgoingMessage>>;

        /// Any error that occured while attempting to sign the outgoing message.
        #[unsafe(method(signingError))]
        #[unsafe(method_family = none)]
        pub unsafe fn signingError(&self) -> Option<Retained<NSError>>;

        /// Any error that occured while attempting to encrypt the outgoing message.
        #[unsafe(method(encryptionError))]
        #[unsafe(method_family = none)]
        pub unsafe fn encryptionError(&self) -> Option<Retained<NSError>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "MEEncodedOutgoingMessage")]
        #[unsafe(method(initWithEncodedMessage:signingError:encryptionError:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEncodedMessage_signingError_encryptionError(
            this: Allocated<Self>,
            encoded_message: Option<&MEEncodedOutgoingMessage>,
            signing_error: Option<&NSError>,
            encryption_error: Option<&NSError>,
        ) -> Retained<Self>;
    );
}