objc2_intents/generated/
INSnoozeTasksIntent.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/insnoozetasksintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INSnoozeTasksIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INSnoozeTasksIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INSnoozeTasksIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INSnoozeTasksIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INSnoozeTasksIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INSnoozeTasksIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INSnoozeTasksIntent {
45    extern_methods!(
46        #[cfg(all(feature = "INDateComponentsRange", feature = "INTask"))]
47        #[unsafe(method(initWithTasks:nextTriggerTime:all:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithTasks_nextTriggerTime_all(
50            this: Allocated<Self>,
51            tasks: Option<&NSArray<INTask>>,
52            next_trigger_time: Option<&INDateComponentsRange>,
53            all: Option<&NSNumber>,
54        ) -> Retained<Self>;
55
56        #[cfg(feature = "INTask")]
57        #[unsafe(method(tasks))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn tasks(&self) -> Option<Retained<NSArray<INTask>>>;
60
61        #[cfg(feature = "INDateComponentsRange")]
62        #[unsafe(method(nextTriggerTime))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn nextTriggerTime(&self) -> Option<Retained<INDateComponentsRange>>;
65
66        #[unsafe(method(all))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn all(&self) -> Option<Retained<NSNumber>>;
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73#[cfg(feature = "INIntent")]
74impl INSnoozeTasksIntent {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new() -> Retained<Self>;
83    );
84}
85
86extern_protocol!(
87    /// Protocol to declare support for handling an INSnoozeTasksIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
88    ///
89    /// 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.
90    ///
91    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insnoozetasksintenthandling?language=objc)
92    pub unsafe trait INSnoozeTasksIntentHandling: NSObjectProtocol {
93        #[cfg(all(
94            feature = "INIntent",
95            feature = "INIntentResponse",
96            feature = "INSnoozeTasksIntentResponse",
97            feature = "block2"
98        ))]
99        /// Handling method - Execute the task represented by the INSnoozeTasksIntent that's passed in
100        ///
101        /// Called to actually execute the intent. The app must return a response for this intent.
102        ///
103        ///
104        /// Parameter `intent`: The input intent
105        ///
106        /// Parameter `completion`: The response handling block takes a INSnoozeTasksIntentResponse containing the details of the result of having executed the intent
107        ///
108        ///
109        /// See: INSnoozeTasksIntentResponse
110        #[unsafe(method(handleSnoozeTasks:completion:))]
111        #[unsafe(method_family = none)]
112        unsafe fn handleSnoozeTasks_completion(
113            &self,
114            intent: &INSnoozeTasksIntent,
115            completion: &block2::DynBlock<dyn Fn(NonNull<INSnoozeTasksIntentResponse>)>,
116        );
117
118        #[cfg(all(
119            feature = "INIntent",
120            feature = "INIntentResponse",
121            feature = "INSnoozeTasksIntentResponse",
122            feature = "block2"
123        ))]
124        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
125        ///
126        /// 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.
127        ///
128        ///
129        /// Parameter `intent`: The input intent
130        ///
131        /// Parameter `completion`: The response block contains an INSnoozeTasksIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
132        ///
133        ///
134        /// See: INSnoozeTasksIntentResponse
135        #[optional]
136        #[unsafe(method(confirmSnoozeTasks:completion:))]
137        #[unsafe(method_family = none)]
138        unsafe fn confirmSnoozeTasks_completion(
139            &self,
140            intent: &INSnoozeTasksIntent,
141            completion: &block2::DynBlock<dyn Fn(NonNull<INSnoozeTasksIntentResponse>)>,
142        );
143
144        #[cfg(all(
145            feature = "INIntent",
146            feature = "INIntentResolutionResult",
147            feature = "INSnoozeTasksTaskResolutionResult",
148            feature = "INTaskResolutionResult",
149            feature = "block2"
150        ))]
151        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
152        ///
153        /// 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.
154        ///
155        ///
156        /// Parameter `intent`: The input intent
157        ///
158        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
159        ///
160        ///
161        /// See: INIntentResolutionResult
162        #[optional]
163        #[unsafe(method(resolveTasksForSnoozeTasks:withCompletion:))]
164        #[unsafe(method_family = none)]
165        unsafe fn resolveTasksForSnoozeTasks_withCompletion(
166            &self,
167            intent: &INSnoozeTasksIntent,
168            completion: &block2::DynBlock<
169                dyn Fn(NonNull<NSArray<INSnoozeTasksTaskResolutionResult>>),
170            >,
171        );
172
173        #[cfg(all(
174            feature = "INDateComponentsRangeResolutionResult",
175            feature = "INIntent",
176            feature = "INIntentResolutionResult",
177            feature = "block2"
178        ))]
179        #[optional]
180        #[unsafe(method(resolveNextTriggerTimeForSnoozeTasks:withCompletion:))]
181        #[unsafe(method_family = none)]
182        unsafe fn resolveNextTriggerTimeForSnoozeTasks_withCompletion(
183            &self,
184            intent: &INSnoozeTasksIntent,
185            completion: &block2::DynBlock<dyn Fn(NonNull<INDateComponentsRangeResolutionResult>)>,
186        );
187    }
188);