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