objc2_mail_kit/generated/
MEMessageEncoder.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// Methods in this protocol can be used by a mail app extension to encode messages.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageencoder?language=objc)
13    pub unsafe trait MEMessageEncoder: NSObjectProtocol {
14        #[cfg(all(
15            feature = "MEComposeContext",
16            feature = "MEMessage",
17            feature = "MEOutgoingMessageEncodingStatus",
18            feature = "block2"
19        ))]
20        /// This is invoked while a message is being composed. This will be be invoked each time the sending address or the list of recipients changes. The supplied
21        /// `message`will contain the email address of the sender, the recipient email addresses, and
22        /// the message data being sent.  The completion handler should be called with the current encoding status of the message indicating whether the message is able to be signed, encrypted, both or neither. The result will also contain any error that occured, including a list of any recipients whose encryption keys are expected and missing.
23        ///
24        /// Parameter `message`: - The outgoing message to apply any security mechanisms on.
25        ///
26        /// Parameter `composeContext`: -
27        /// `MEComposeContext`instance which corresponds to the
28        /// `message`being composed.
29        #[unsafe(method(getEncodingStatusForMessage:composeContext:completionHandler:))]
30        #[unsafe(method_family = none)]
31        unsafe fn getEncodingStatusForMessage_composeContext_completionHandler(
32            &self,
33            message: &MEMessage,
34            compose_context: &MEComposeContext,
35            completion_handler: &block2::DynBlock<dyn Fn(NonNull<MEOutgoingMessageEncodingStatus>)>,
36        );
37
38        #[cfg(all(
39            feature = "MEComposeContext",
40            feature = "MEMessage",
41            feature = "MEMessageEncodingResult",
42            feature = "block2"
43        ))]
44        /// This is invoked when an outgoing message is sent. The supplied
45        /// `message`will contain the email address of the sender, the recipient email addresses, and
46        /// the message data being sent. The completion handler should be called with the
47        /// `result`of applying any encoding if needed based on
48        /// `shouldSign`and
49        /// `shouldEncrypt.`If the
50        /// `result`is not encrypted or signed and does not have  any errors, it is assumed the message did not need a signature or encryption applied. In this case the
51        /// `data`for the result will be ignored.
52        ///
53        /// Parameter `message`: - The outgoing message to apply any security mechanisms on.
54        ///
55        /// Parameter `composeContext`: -
56        /// `MEComposeContext`instance which corresponds to the
57        /// `message`being composed.
58        #[unsafe(method(encodeMessage:composeContext:completionHandler:))]
59        #[unsafe(method_family = none)]
60        unsafe fn encodeMessage_composeContext_completionHandler(
61            &self,
62            message: &MEMessage,
63            compose_context: &MEComposeContext,
64            completion_handler: &block2::DynBlock<dyn Fn(NonNull<MEMessageEncodingResult>)>,
65        );
66    }
67);