objc2_mail_kit/generated/
MEMessageActionHandler.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// Methods in this protocol can be used by a mail app extension to perform actions on messages as they are downloaded.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageactionhandler?language=objc)
14    pub unsafe trait MEMessageActionHandler: NSObjectProtocol {
15        #[cfg(all(
16            feature = "MEMessage",
17            feature = "MEMessageActionDecision",
18            feature = "block2"
19        ))]
20        /// This is invoked when a message is downloaded. The action set in the completion handler will be performed on the message. Depending on if the full body of the
21        /// message has been downloaded the
22        /// `MEMessage`provided might have the full body data. If the full body is not present the
23        /// `decision`property can be set to
24        /// `MEMessageActionDecision.invokeAgainWithBody`and this method will be invoked again once the full body is available.
25        ///
26        /// Parameter `message`: - The message for which the action will be performed. Might or might not contain the full message body data.
27        #[unsafe(method(decideActionForMessage:completionHandler:))]
28        #[unsafe(method_family = none)]
29        unsafe fn decideActionForMessage_completionHandler(
30            &self,
31            message: &MEMessage,
32            completion_handler: &block2::DynBlock<dyn Fn(*mut MEMessageActionDecision)>,
33        );
34
35        /// Provide additional headers that the extension requires to perform an action. Mail will fetch these additional headers before invoking
36        /// `-[MEMessageActionHandler``decideActionForMessage:completionHandler:].`For example, extensions can return the headers that were set in
37        /// `-[MEComposeSessionHandler``additionalHeadersForSession:]`
38        /// Returns: An array of header keys. Mail will normalize the headers to lower case before fetching them from the mail server.
39        #[optional]
40        #[unsafe(method(requiredHeaders))]
41        #[unsafe(method_family = none)]
42        unsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>;
43    }
44);