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