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 any security measures that will be applied to a mail message when it is sent or any errrors that occurred while verifying security status.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/meoutgoingmessageencodingstatus?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MEOutgoingMessageEncodingStatus;
);

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

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

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

impl MEOutgoingMessageEncodingStatus {
    extern_methods!(
        /// Whether or not the message can be signed.
        #[unsafe(method(canSign))]
        #[unsafe(method_family = none)]
        pub unsafe fn canSign(&self) -> bool;

        /// Whether or not the message can be encrypted.
        #[unsafe(method(canEncrypt))]
        #[unsafe(method_family = none)]
        pub unsafe fn canEncrypt(&self) -> bool;

        /// Any error that occurred while verifying the security status for the outgoing mail message.
        #[unsafe(method(securityError))]
        #[unsafe(method_family = none)]
        pub unsafe fn securityError(&self) -> Option<Retained<NSError>>;

        #[cfg(feature = "MEEmailAddress")]
        /// A list of any recipients for which the message should be encrypted but an error occurred. This could include missing the public key for the recipient.
        #[unsafe(method(addressesFailingEncryption))]
        #[unsafe(method_family = none)]
        pub unsafe fn addressesFailingEncryption(&self) -> Retained<NSArray<MEEmailAddress>>;

        #[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 = "MEEmailAddress")]
        #[unsafe(method(initWithCanSign:canEncrypt:securityError:addressesFailingEncryption:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCanSign_canEncrypt_securityError_addressesFailingEncryption(
            this: Allocated<Self>,
            can_sign: bool,
            can_encrypt: bool,
            security_error: Option<&NSError>,
            addresses_failing_encryption: &NSArray<MEEmailAddress>,
        ) -> Retained<Self>;
    );
}