objc2_intents/generated/
INSendMessageIntent.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_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/intents/insendmessageintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INSendMessageIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INSendMessageIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INSendMessageIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INSendMessageIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INSendMessageIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INSendMessageIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INSendMessageIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INOutgoingMessageType",
48            feature = "INPerson",
49            feature = "INSendMessageAttachment",
50            feature = "INSpeakableString"
51        ))]
52        #[unsafe(method(initWithRecipients:outgoingMessageType:content:speakableGroupName:conversationIdentifier:serviceName:sender:attachments:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithRecipients_outgoingMessageType_content_speakableGroupName_conversationIdentifier_serviceName_sender_attachments(
55            this: Allocated<Self>,
56            recipients: Option<&NSArray<INPerson>>,
57            outgoing_message_type: INOutgoingMessageType,
58            content: Option<&NSString>,
59            speakable_group_name: Option<&INSpeakableString>,
60            conversation_identifier: Option<&NSString>,
61            service_name: Option<&NSString>,
62            sender: Option<&INPerson>,
63            attachments: Option<&NSArray<INSendMessageAttachment>>,
64        ) -> Retained<Self>;
65
66        #[cfg(feature = "INPerson")]
67        #[unsafe(method(recipients))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn recipients(&self) -> Option<Retained<NSArray<INPerson>>>;
70
71        #[cfg(feature = "INOutgoingMessageType")]
72        #[unsafe(method(outgoingMessageType))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn outgoingMessageType(&self) -> INOutgoingMessageType;
75
76        #[unsafe(method(content))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn content(&self) -> Option<Retained<NSString>>;
79
80        #[cfg(feature = "INSpeakableString")]
81        #[unsafe(method(speakableGroupName))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn speakableGroupName(&self) -> Option<Retained<INSpeakableString>>;
84
85        #[unsafe(method(conversationIdentifier))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn conversationIdentifier(&self) -> Option<Retained<NSString>>;
88
89        #[unsafe(method(serviceName))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn serviceName(&self) -> Option<Retained<NSString>>;
92
93        #[cfg(feature = "INPerson")]
94        #[unsafe(method(sender))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn sender(&self) -> Option<Retained<INPerson>>;
97
98        #[cfg(feature = "INSendMessageAttachment")]
99        #[unsafe(method(attachments))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn attachments(&self) -> Option<Retained<NSArray<INSendMessageAttachment>>>;
102    );
103}
104
105/// Methods declared on superclass `NSObject`.
106#[cfg(feature = "INIntent")]
107impl INSendMessageIntent {
108    extern_methods!(
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}
118
119extern_protocol!(
120    /// Protocol to declare support for handling an INSendMessageIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
121    ///
122    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
123    ///
124    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insendmessageintenthandling?language=objc)
125    pub unsafe trait INSendMessageIntentHandling: NSObjectProtocol {
126        #[cfg(all(
127            feature = "INIntent",
128            feature = "INIntentResponse",
129            feature = "INSendMessageIntentResponse",
130            feature = "block2"
131        ))]
132        /// Handling method - Execute the task represented by the INSendMessageIntent that's passed in
133        ///
134        /// Called to actually execute the intent. The app must return a response for this intent.
135        ///
136        ///
137        /// Parameter `intent`: The input intent
138        ///
139        /// Parameter `completion`: The response handling block takes a INSendMessageIntentResponse containing the details of the result of having executed the intent
140        ///
141        ///
142        /// See: INSendMessageIntentResponse
143        #[unsafe(method(handleSendMessage:completion:))]
144        #[unsafe(method_family = none)]
145        unsafe fn handleSendMessage_completion(
146            &self,
147            intent: &INSendMessageIntent,
148            completion: &block2::DynBlock<dyn Fn(NonNull<INSendMessageIntentResponse>)>,
149        );
150
151        #[cfg(all(
152            feature = "INIntent",
153            feature = "INIntentResponse",
154            feature = "INSendMessageIntentResponse",
155            feature = "block2"
156        ))]
157        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
158        ///
159        /// Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
160        ///
161        ///
162        /// Parameter `intent`: The input intent
163        ///
164        /// Parameter `completion`: The response block contains an INSendMessageIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
165        ///
166        ///
167        /// See: INSendMessageIntentResponse
168        #[optional]
169        #[unsafe(method(confirmSendMessage:completion:))]
170        #[unsafe(method_family = none)]
171        unsafe fn confirmSendMessage_completion(
172            &self,
173            intent: &INSendMessageIntent,
174            completion: &block2::DynBlock<dyn Fn(NonNull<INSendMessageIntentResponse>)>,
175        );
176
177        #[cfg(all(
178            feature = "INIntent",
179            feature = "INIntentResolutionResult",
180            feature = "INPersonResolutionResult",
181            feature = "block2"
182        ))]
183        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
184        ///
185        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
186        ///
187        ///
188        /// Parameter `intent`: The input intent
189        ///
190        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
191        ///
192        ///
193        /// See: INIntentResolutionResult
194        #[deprecated = "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead"]
195        #[optional]
196        #[unsafe(method(resolveRecipientsForSendMessage:withCompletion:))]
197        #[unsafe(method_family = none)]
198        unsafe fn resolveRecipientsForSendMessage_withCompletion(
199            &self,
200            intent: &INSendMessageIntent,
201            completion: &block2::DynBlock<dyn Fn(NonNull<NSArray<INPersonResolutionResult>>)>,
202        );
203
204        #[cfg(all(
205            feature = "INIntent",
206            feature = "INIntentResolutionResult",
207            feature = "INPersonResolutionResult",
208            feature = "INSendMessageRecipientResolutionResult",
209            feature = "block2"
210        ))]
211        #[optional]
212        #[unsafe(method(resolveRecipientsForSendMessage:completion:))]
213        #[unsafe(method_family = none)]
214        unsafe fn resolveRecipientsForSendMessage_completion(
215            &self,
216            intent: &INSendMessageIntent,
217            completion: &block2::DynBlock<
218                dyn Fn(NonNull<NSArray<INSendMessageRecipientResolutionResult>>),
219            >,
220        );
221
222        #[cfg(all(
223            feature = "INIntent",
224            feature = "INIntentResolutionResult",
225            feature = "INStringResolutionResult",
226            feature = "block2"
227        ))]
228        #[deprecated = "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead"]
229        #[optional]
230        #[unsafe(method(resolveGroupNameForSendMessage:withCompletion:))]
231        #[unsafe(method_family = none)]
232        unsafe fn resolveGroupNameForSendMessage_withCompletion(
233            &self,
234            intent: &INSendMessageIntent,
235            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
236        );
237
238        #[cfg(all(
239            feature = "INIntent",
240            feature = "INIntentResolutionResult",
241            feature = "INOutgoingMessageTypeResolutionResult",
242            feature = "block2"
243        ))]
244        #[optional]
245        #[unsafe(method(resolveOutgoingMessageTypeForSendMessage:withCompletion:))]
246        #[unsafe(method_family = none)]
247        unsafe fn resolveOutgoingMessageTypeForSendMessage_withCompletion(
248            &self,
249            intent: &INSendMessageIntent,
250            completion: &block2::DynBlock<dyn Fn(NonNull<INOutgoingMessageTypeResolutionResult>)>,
251        );
252
253        #[cfg(all(
254            feature = "INIntent",
255            feature = "INIntentResolutionResult",
256            feature = "INStringResolutionResult",
257            feature = "block2"
258        ))]
259        #[optional]
260        #[unsafe(method(resolveContentForSendMessage:withCompletion:))]
261        #[unsafe(method_family = none)]
262        unsafe fn resolveContentForSendMessage_withCompletion(
263            &self,
264            intent: &INSendMessageIntent,
265            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
266        );
267
268        #[cfg(all(
269            feature = "INIntent",
270            feature = "INIntentResolutionResult",
271            feature = "INSpeakableStringResolutionResult",
272            feature = "block2"
273        ))]
274        #[optional]
275        #[unsafe(method(resolveSpeakableGroupNameForSendMessage:withCompletion:))]
276        #[unsafe(method_family = none)]
277        unsafe fn resolveSpeakableGroupNameForSendMessage_withCompletion(
278            &self,
279            intent: &INSendMessageIntent,
280            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
281        );
282    }
283);