objc2_intents/generated/
INAddTasksIntent.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/inaddtasksintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INAddTasksIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INAddTasksIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INAddTasksIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INAddTasksIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INAddTasksIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INAddTasksIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INAddTasksIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INSpatialEventTrigger",
48            feature = "INSpeakableString",
49            feature = "INTaskList",
50            feature = "INTaskPriority",
51            feature = "INTemporalEventTrigger"
52        ))]
53        #[unsafe(method(initWithTargetTaskList:taskTitles:spatialEventTrigger:temporalEventTrigger:priority:))]
54        #[unsafe(method_family = init)]
55        pub unsafe fn initWithTargetTaskList_taskTitles_spatialEventTrigger_temporalEventTrigger_priority(
56            this: Allocated<Self>,
57            target_task_list: Option<&INTaskList>,
58            task_titles: Option<&NSArray<INSpeakableString>>,
59            spatial_event_trigger: Option<&INSpatialEventTrigger>,
60            temporal_event_trigger: Option<&INTemporalEventTrigger>,
61            priority: INTaskPriority,
62        ) -> Retained<Self>;
63
64        #[cfg(feature = "INTaskList")]
65        #[unsafe(method(targetTaskList))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn targetTaskList(&self) -> Option<Retained<INTaskList>>;
68
69        #[cfg(feature = "INSpeakableString")]
70        #[unsafe(method(taskTitles))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn taskTitles(&self) -> Option<Retained<NSArray<INSpeakableString>>>;
73
74        #[cfg(feature = "INSpatialEventTrigger")]
75        #[unsafe(method(spatialEventTrigger))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn spatialEventTrigger(&self) -> Option<Retained<INSpatialEventTrigger>>;
78
79        #[cfg(feature = "INTemporalEventTrigger")]
80        #[unsafe(method(temporalEventTrigger))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn temporalEventTrigger(&self) -> Option<Retained<INTemporalEventTrigger>>;
83
84        #[cfg(feature = "INTaskPriority")]
85        #[unsafe(method(priority))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn priority(&self) -> INTaskPriority;
88    );
89}
90
91/// Methods declared on superclass `NSObject`.
92#[cfg(feature = "INIntent")]
93impl INAddTasksIntent {
94    extern_methods!(
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102    );
103}
104
105extern_protocol!(
106    /// Protocol to declare support for handling an INAddTasksIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
107    ///
108    /// 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.
109    ///
110    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inaddtasksintenthandling?language=objc)
111    pub unsafe trait INAddTasksIntentHandling: NSObjectProtocol {
112        #[cfg(all(
113            feature = "INAddTasksIntentResponse",
114            feature = "INIntent",
115            feature = "INIntentResponse",
116            feature = "block2"
117        ))]
118        /// Handling method - Execute the task represented by the INAddTasksIntent that's passed in
119        ///
120        /// Called to actually execute the intent. The app must return a response for this intent.
121        ///
122        ///
123        /// Parameter `intent`: The input intent
124        ///
125        /// Parameter `completion`: The response handling block takes a INAddTasksIntentResponse containing the details of the result of having executed the intent
126        ///
127        ///
128        /// See: INAddTasksIntentResponse
129        #[unsafe(method(handleAddTasks:completion:))]
130        #[unsafe(method_family = none)]
131        unsafe fn handleAddTasks_completion(
132            &self,
133            intent: &INAddTasksIntent,
134            completion: &block2::DynBlock<dyn Fn(NonNull<INAddTasksIntentResponse>)>,
135        );
136
137        #[cfg(all(
138            feature = "INAddTasksIntentResponse",
139            feature = "INIntent",
140            feature = "INIntentResponse",
141            feature = "block2"
142        ))]
143        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
144        ///
145        /// 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.
146        ///
147        ///
148        /// Parameter `intent`: The input intent
149        ///
150        /// Parameter `completion`: The response block contains an INAddTasksIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
151        ///
152        ///
153        /// See: INAddTasksIntentResponse
154        #[optional]
155        #[unsafe(method(confirmAddTasks:completion:))]
156        #[unsafe(method_family = none)]
157        unsafe fn confirmAddTasks_completion(
158            &self,
159            intent: &INAddTasksIntent,
160            completion: &block2::DynBlock<dyn Fn(NonNull<INAddTasksIntentResponse>)>,
161        );
162
163        #[cfg(all(
164            feature = "INIntent",
165            feature = "INIntentResolutionResult",
166            feature = "INTaskListResolutionResult",
167            feature = "block2"
168        ))]
169        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
170        ///
171        /// 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.
172        ///
173        ///
174        /// Parameter `intent`: The input intent
175        ///
176        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
177        ///
178        ///
179        /// See: INIntentResolutionResult
180        #[deprecated = "resolveTargetTaskListForAddTasks:withCompletion: is deprecated. Use resolveTargetTaskListForAddTasks:completion: instead"]
181        #[optional]
182        #[unsafe(method(resolveTargetTaskListForAddTasks:withCompletion:))]
183        #[unsafe(method_family = none)]
184        unsafe fn resolveTargetTaskListForAddTasks_withCompletion(
185            &self,
186            intent: &INAddTasksIntent,
187            completion: &block2::DynBlock<dyn Fn(NonNull<INTaskListResolutionResult>)>,
188        );
189
190        #[cfg(all(
191            feature = "INAddTasksTargetTaskListResolutionResult",
192            feature = "INIntent",
193            feature = "INIntentResolutionResult",
194            feature = "INTaskListResolutionResult",
195            feature = "block2"
196        ))]
197        #[optional]
198        #[unsafe(method(resolveTargetTaskListForAddTasks:completion:))]
199        #[unsafe(method_family = none)]
200        unsafe fn resolveTargetTaskListForAddTasks_completion(
201            &self,
202            intent: &INAddTasksIntent,
203            completion: &block2::DynBlock<
204                dyn Fn(NonNull<INAddTasksTargetTaskListResolutionResult>),
205            >,
206        );
207
208        #[cfg(all(
209            feature = "INIntent",
210            feature = "INIntentResolutionResult",
211            feature = "INSpeakableStringResolutionResult",
212            feature = "block2"
213        ))]
214        #[optional]
215        #[unsafe(method(resolveTaskTitlesForAddTasks:withCompletion:))]
216        #[unsafe(method_family = none)]
217        unsafe fn resolveTaskTitlesForAddTasks_withCompletion(
218            &self,
219            intent: &INAddTasksIntent,
220            completion: &block2::DynBlock<
221                dyn Fn(NonNull<NSArray<INSpeakableStringResolutionResult>>),
222            >,
223        );
224
225        #[cfg(all(
226            feature = "INIntent",
227            feature = "INIntentResolutionResult",
228            feature = "INSpatialEventTriggerResolutionResult",
229            feature = "block2"
230        ))]
231        #[optional]
232        #[unsafe(method(resolveSpatialEventTriggerForAddTasks:withCompletion:))]
233        #[unsafe(method_family = none)]
234        unsafe fn resolveSpatialEventTriggerForAddTasks_withCompletion(
235            &self,
236            intent: &INAddTasksIntent,
237            completion: &block2::DynBlock<dyn Fn(NonNull<INSpatialEventTriggerResolutionResult>)>,
238        );
239
240        #[cfg(all(
241            feature = "INIntent",
242            feature = "INIntentResolutionResult",
243            feature = "INTemporalEventTriggerResolutionResult",
244            feature = "block2"
245        ))]
246        #[deprecated = "resolveTemporalEventTriggerForAddTasks:withCompletion: is deprecated. Use resolveTemporalEventTriggerForAddTasks:completion: instead"]
247        #[optional]
248        #[unsafe(method(resolveTemporalEventTriggerForAddTasks:withCompletion:))]
249        #[unsafe(method_family = none)]
250        unsafe fn resolveTemporalEventTriggerForAddTasks_withCompletion(
251            &self,
252            intent: &INAddTasksIntent,
253            completion: &block2::DynBlock<dyn Fn(NonNull<INTemporalEventTriggerResolutionResult>)>,
254        );
255
256        #[cfg(all(
257            feature = "INAddTasksTemporalEventTriggerResolutionResult",
258            feature = "INIntent",
259            feature = "INIntentResolutionResult",
260            feature = "INTemporalEventTriggerResolutionResult",
261            feature = "block2"
262        ))]
263        #[optional]
264        #[unsafe(method(resolveTemporalEventTriggerForAddTasks:completion:))]
265        #[unsafe(method_family = none)]
266        unsafe fn resolveTemporalEventTriggerForAddTasks_completion(
267            &self,
268            intent: &INAddTasksIntent,
269            completion: &block2::DynBlock<
270                dyn Fn(NonNull<INAddTasksTemporalEventTriggerResolutionResult>),
271            >,
272        );
273
274        #[cfg(all(
275            feature = "INIntent",
276            feature = "INIntentResolutionResult",
277            feature = "INTaskPriorityResolutionResult",
278            feature = "block2"
279        ))]
280        #[optional]
281        #[unsafe(method(resolvePriorityForAddTasks:withCompletion:))]
282        #[unsafe(method_family = none)]
283        unsafe fn resolvePriorityForAddTasks_withCompletion(
284            &self,
285            intent: &INAddTasksIntent,
286            completion: &block2::DynBlock<dyn Fn(NonNull<INTaskPriorityResolutionResult>)>,
287        );
288    }
289);