objc2_mail_kit/generated/
MEDecodedMessage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Contains information about a decoded message
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/medecodedmessage?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct MEDecodedMessage;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for MEDecodedMessage {}
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for MEDecodedMessage {}
24);
25
26extern_conformance!(
27    unsafe impl NSSecureCoding for MEDecodedMessage {}
28);
29
30impl MEDecodedMessage {
31    extern_methods!(
32        /// The decoded MIME data for the message
33        /// The decoded data should not be encrypted or contain any signatures that were decoded. The
34        /// `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
35        /// `securityInformation.`If the message is unable to be decrypted this should be left nil and an error message will be displayed to the user.
36        #[unsafe(method(rawData))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn rawData(&self) -> Option<Retained<NSData>>;
39
40        #[cfg(feature = "MEMessageSecurityInformation")]
41        /// The security information for whether or not the message was signed, encrypted, or had an errors in decoding.
42        #[unsafe(method(securityInformation))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn securityInformation(&self) -> Retained<MEMessageSecurityInformation>;
45
46        /// 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.
47        #[unsafe(method(context))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn context(&self) -> Option<Retained<NSData>>;
50
51        #[cfg(feature = "MEDecodedMessageBanner")]
52        /// 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.
53        #[unsafe(method(banner))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn banner(&self) -> Option<Retained<MEDecodedMessageBanner>>;
56
57        #[unsafe(method(new))]
58        #[unsafe(method_family = new)]
59        pub unsafe fn new() -> Retained<Self>;
60
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[cfg(feature = "MEMessageSecurityInformation")]
66        #[unsafe(method(initWithData:securityInformation:context:))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn initWithData_securityInformation_context(
69            this: Allocated<Self>,
70            raw_data: Option<&NSData>,
71            security_information: &MEMessageSecurityInformation,
72            context: Option<&NSData>,
73        ) -> Retained<Self>;
74
75        #[cfg(all(
76            feature = "MEDecodedMessageBanner",
77            feature = "MEMessageSecurityInformation"
78        ))]
79        #[unsafe(method(initWithData:securityInformation:context:banner:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithData_securityInformation_context_banner(
82            this: Allocated<Self>,
83            raw_data: Option<&NSData>,
84            security_information: &MEMessageSecurityInformation,
85            context: Option<&NSData>,
86            banner: Option<&MEDecodedMessageBanner>,
87        ) -> Retained<Self>;
88    );
89}