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