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

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

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

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

impl MEDecodedMessage {
    extern_methods!(
        /// The decoded MIME data for the message
        /// The decoded data should not be encrypted or contain any signatures that were decoded. The
        /// `rawData`here should only contain MIME parts that a standard email parser can decode without needing to decrypt. All information on the encryption and signature status should be defined in
        /// `securityInformation.`If the message is unable to be decrypted this should be left nil and an error message will be displayed to the user.
        #[unsafe(method(rawData))]
        #[unsafe(method_family = none)]
        pub unsafe fn rawData(&self) -> Option<Retained<NSData>>;

        #[cfg(feature = "MEMessageSecurityInformation")]
        /// The security information for whether or not the message was signed, encrypted, or had an errors in decoding.
        #[unsafe(method(securityInformation))]
        #[unsafe(method_family = none)]
        pub unsafe fn securityInformation(&self) -> Retained<MEMessageSecurityInformation>;

        /// The context for the decoded message. This will be passed back to the extension when Mail loads the extension's custom view controller for the message.
        #[unsafe(method(context))]
        #[unsafe(method_family = none)]
        pub unsafe fn context(&self) -> Option<Retained<NSData>>;

        #[cfg(feature = "MEDecodedMessageBanner")]
        /// Suggestion information used to populate a suggestion banner at the top of the message view. Clicking on the action associated with the suggestion banner will present the extension's view controller for the provided message context.
        #[unsafe(method(banner))]
        #[unsafe(method_family = none)]
        pub unsafe fn banner(&self) -> Option<Retained<MEDecodedMessageBanner>>;

        #[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 = "MEMessageSecurityInformation")]
        #[unsafe(method(initWithData:securityInformation:context:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithData_securityInformation_context(
            this: Allocated<Self>,
            raw_data: Option<&NSData>,
            security_information: &MEMessageSecurityInformation,
            context: Option<&NSData>,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "MEDecodedMessageBanner",
            feature = "MEMessageSecurityInformation"
        ))]
        #[unsafe(method(initWithData:securityInformation:context:banner:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithData_securityInformation_context_banner(
            this: Allocated<Self>,
            raw_data: Option<&NSData>,
            security_information: &MEMessageSecurityInformation,
            context: Option<&NSData>,
            banner: Option<&MEDecodedMessageBanner>,
        ) -> Retained<Self>;
    );
}