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 security information about a decoded message
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessagesecurityinformation?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MEMessageSecurityInformation;
);

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

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

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

impl MEMessageSecurityInformation {
    extern_methods!(
        #[cfg(feature = "MEMessageSigner")]
        /// The signers of the message
        #[unsafe(method(signers))]
        #[unsafe(method_family = none)]
        pub unsafe fn signers(&self) -> Retained<NSArray<MEMessageSigner>>;

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

        /// Any signing error that occured when decoding the message.
        #[unsafe(method(signingError))]
        #[unsafe(method_family = none)]
        pub unsafe fn signingError(&self) -> Option<Retained<NSError>>;

        /// Any encryption error that occured when decoding the message.
        #[unsafe(method(encryptionError))]
        #[unsafe(method_family = none)]
        pub unsafe fn encryptionError(&self) -> Option<Retained<NSError>>;

        /// Whether or not Mail should block loading remote content for the message by default. The user will have the option to load remote content manually.
        #[unsafe(method(shouldBlockRemoteContent))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldBlockRemoteContent(&self) -> bool;

        /// A localized string containing the reason for blocking remote content.
        #[unsafe(method(localizedRemoteContentBlockingReason))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedRemoteContentBlockingReason(&self) -> Option<Retained<NSString>>;

        #[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 = "MEMessageSigner")]
        #[unsafe(method(initWithSigners:isEncrypted:signingError:encryptionError:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSigners_isEncrypted_signingError_encryptionError(
            this: Allocated<Self>,
            signers: &NSArray<MEMessageSigner>,
            is_encrypted: bool,
            signing_error: Option<&NSError>,
            encryption_error: Option<&NSError>,
        ) -> Retained<Self>;

        #[cfg(feature = "MEMessageSigner")]
        #[unsafe(method(initWithSigners:isEncrypted:signingError:encryptionError:shouldBlockRemoteContent:localizedRemoteContentBlockingReason:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSigners_isEncrypted_signingError_encryptionError_shouldBlockRemoteContent_localizedRemoteContentBlockingReason(
            this: Allocated<Self>,
            signers: &NSArray<MEMessageSigner>,
            is_encrypted: bool,
            signing_error: Option<&NSError>,
            encryption_error: Option<&NSError>,
            should_block_remote_content: bool,
            localized_remote_content_blocking_reason: Option<&NSString>,
        ) -> Retained<Self>;
    );
}