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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! 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 crate::*;
extern_protocol!(
/// Methods in this protocol can be used by a mail app extension to encode messages.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageencoder?language=objc)
pub unsafe trait MEMessageEncoder: NSObjectProtocol {
#[cfg(all(
feature = "MEComposeContext",
feature = "MEMessage",
feature = "MEOutgoingMessageEncodingStatus",
feature = "block2"
))]
/// 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
/// `message`will contain the email address of the sender, the recipient email addresses, and
/// 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.
///
/// Parameter `message`: - The outgoing message to apply any security mechanisms on.
///
/// Parameter `composeContext`: -
/// `MEComposeContext`instance which corresponds to the
/// `message`being composed.
#[unsafe(method(getEncodingStatusForMessage:composeContext:completionHandler:))]
#[unsafe(method_family = none)]
unsafe fn getEncodingStatusForMessage_composeContext_completionHandler(
&self,
message: &MEMessage,
compose_context: &MEComposeContext,
completion_handler: &block2::DynBlock<dyn Fn(NonNull<MEOutgoingMessageEncodingStatus>)>,
);
#[cfg(all(
feature = "MEComposeContext",
feature = "MEMessage",
feature = "MEMessageEncodingResult",
feature = "block2"
))]
/// This is invoked when an outgoing message is sent. The supplied
/// `message`will contain the email address of the sender, the recipient email addresses, and
/// the message data being sent. The completion handler should be called with the
/// `result`of applying any encoding if needed based on
/// `shouldSign`and
/// `shouldEncrypt.`If the
/// `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
/// `data`for the result will be ignored.
///
/// Parameter `message`: - The outgoing message to apply any security mechanisms on.
///
/// Parameter `composeContext`: -
/// `MEComposeContext`instance which corresponds to the
/// `message`being composed.
#[unsafe(method(encodeMessage:composeContext:completionHandler:))]
#[unsafe(method_family = none)]
unsafe fn encodeMessage_composeContext_completionHandler(
&self,
message: &MEMessage,
compose_context: &MEComposeContext,
completion_handler: &block2::DynBlock<dyn Fn(NonNull<MEMessageEncodingResult>)>,
);
}
);