objc2_clock_kit/generated/
CLKComplicationDataSource.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait CLKComplicationDataSource: NSObjectProtocol + MainThreadOnly {
13 #[cfg(all(feature = "CLKComplication", feature = "block2"))]
14 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
15 #[optional]
16 #[unsafe(method(getTimelineEndDateForComplication:withHandler:))]
17 #[unsafe(method_family = none)]
18 unsafe fn getTimelineEndDateForComplication_withHandler(
19 &self,
20 complication: &CLKComplication,
21 handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
22 );
23
24 #[cfg(all(
25 feature = "CLKComplication",
26 feature = "CLKDefines",
27 feature = "block2"
28 ))]
29 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
30 #[optional]
31 #[unsafe(method(getPrivacyBehaviorForComplication:withHandler:))]
32 #[unsafe(method_family = none)]
33 unsafe fn getPrivacyBehaviorForComplication_withHandler(
34 &self,
35 complication: &CLKComplication,
36 handler: &block2::DynBlock<dyn Fn(CLKComplicationPrivacyBehavior)>,
37 );
38
39 #[cfg(all(
40 feature = "CLKComplication",
41 feature = "CLKDefines",
42 feature = "block2"
43 ))]
44 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
45 #[optional]
46 #[unsafe(method(getTimelineAnimationBehaviorForComplication:withHandler:))]
47 #[unsafe(method_family = none)]
48 unsafe fn getTimelineAnimationBehaviorForComplication_withHandler(
49 &self,
50 complication: &CLKComplication,
51 handler: &block2::DynBlock<dyn Fn(CLKComplicationTimelineAnimationBehavior)>,
52 );
53
54 #[cfg(all(
55 feature = "CLKComplication",
56 feature = "CLKComplicationTemplate",
57 feature = "block2"
58 ))]
59 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
60 #[optional]
61 #[unsafe(method(getAlwaysOnTemplateForComplication:withHandler:))]
62 #[unsafe(method_family = none)]
63 unsafe fn getAlwaysOnTemplateForComplication_withHandler(
64 &self,
65 complication: &CLKComplication,
66 handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
67 );
68
69 #[cfg(all(
70 feature = "CLKComplication",
71 feature = "CLKComplicationTimelineEntry",
72 feature = "block2"
73 ))]
74 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
75 #[unsafe(method(getCurrentTimelineEntryForComplication:withHandler:))]
76 #[unsafe(method_family = none)]
77 unsafe fn getCurrentTimelineEntryForComplication_withHandler(
78 &self,
79 complication: &CLKComplication,
80 handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTimelineEntry)>,
81 );
82
83 #[cfg(all(
84 feature = "CLKComplication",
85 feature = "CLKComplicationTimelineEntry",
86 feature = "block2"
87 ))]
88 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
89 #[optional]
90 #[unsafe(method(getTimelineEntriesForComplication:afterDate:limit:withHandler:))]
91 #[unsafe(method_family = none)]
92 unsafe fn getTimelineEntriesForComplication_afterDate_limit_withHandler(
93 &self,
94 complication: &CLKComplication,
95 date: &NSDate,
96 limit: NSUInteger,
97 handler: &block2::DynBlock<dyn Fn(*mut NSArray<CLKComplicationTimelineEntry>)>,
98 );
99
100 #[cfg(all(
101 feature = "CLKComplication",
102 feature = "CLKComplicationTemplate",
103 feature = "block2"
104 ))]
105 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
106 #[optional]
107 #[unsafe(method(getLocalizableSampleTemplateForComplication:withHandler:))]
108 #[unsafe(method_family = none)]
109 unsafe fn getLocalizableSampleTemplateForComplication_withHandler(
110 &self,
111 complication: &CLKComplication,
112 handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
113 );
114
115 #[cfg(all(feature = "CLKComplicationDescriptor", feature = "block2"))]
116 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
117 #[optional]
118 #[unsafe(method(getComplicationDescriptorsWithHandler:))]
119 #[unsafe(method_family = none)]
120 unsafe fn getComplicationDescriptorsWithHandler(
121 &self,
122 handler: &block2::DynBlock<dyn Fn(NonNull<NSArray<CLKComplicationDescriptor>>)>,
123 );
124
125 #[cfg(feature = "CLKComplicationDescriptor")]
126 #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
127 #[optional]
128 #[unsafe(method(handleSharedComplicationDescriptors:))]
129 #[unsafe(method_family = none)]
130 unsafe fn handleSharedComplicationDescriptors(
131 &self,
132 complication_descriptors: &NSArray<CLKComplicationDescriptor>,
133 );
134
135 #[cfg(feature = "CLKComplicationWidgetMigrator")]
136 #[optional]
137 #[unsafe(method(widgetMigrator))]
138 #[unsafe(method_family = none)]
139 unsafe fn widgetMigrator(
140 &self,
141 ) -> Retained<ProtocolObject<dyn CLKComplicationWidgetMigrator>>;
142
143 #[cfg(all(
144 feature = "CLKComplication",
145 feature = "CLKComplicationTemplate",
146 feature = "block2"
147 ))]
148 #[deprecated]
149 #[optional]
150 #[unsafe(method(getPlaceholderTemplateForComplication:withHandler:))]
151 #[unsafe(method_family = none)]
152 unsafe fn getPlaceholderTemplateForComplication_withHandler(
153 &self,
154 complication: &CLKComplication,
155 handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
156 );
157
158 #[cfg(all(
159 feature = "CLKComplication",
160 feature = "CLKDefines",
161 feature = "block2"
162 ))]
163 #[deprecated = "Time Travel is no longer supported. Use CLKComplicationDataSource's getTimelineEndDateForComplication:withHandler: to specify forward timeline support."]
164 #[optional]
165 #[unsafe(method(getSupportedTimeTravelDirectionsForComplication:withHandler:))]
166 #[unsafe(method_family = none)]
167 unsafe fn getSupportedTimeTravelDirectionsForComplication_withHandler(
168 &self,
169 complication: &CLKComplication,
170 handler: &block2::DynBlock<dyn Fn(CLKComplicationTimeTravelDirections)>,
171 );
172
173 #[cfg(all(feature = "CLKComplication", feature = "block2"))]
174 #[deprecated = "Time Travel and backwards extension of timelines are no longer supported."]
175 #[optional]
176 #[unsafe(method(getTimelineStartDateForComplication:withHandler:))]
177 #[unsafe(method_family = none)]
178 unsafe fn getTimelineStartDateForComplication_withHandler(
179 &self,
180 complication: &CLKComplication,
181 handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
182 );
183
184 #[cfg(all(
185 feature = "CLKComplication",
186 feature = "CLKComplicationTimelineEntry",
187 feature = "block2"
188 ))]
189 #[deprecated = "Time Travel and backwards extension of timelines are no longer supported."]
190 #[optional]
191 #[unsafe(method(getTimelineEntriesForComplication:beforeDate:limit:withHandler:))]
192 #[unsafe(method_family = none)]
193 unsafe fn getTimelineEntriesForComplication_beforeDate_limit_withHandler(
194 &self,
195 complication: &CLKComplication,
196 date: &NSDate,
197 limit: NSUInteger,
198 handler: &block2::DynBlock<dyn Fn(*mut NSArray<CLKComplicationTimelineEntry>)>,
199 );
200
201 #[cfg(feature = "block2")]
202 #[deprecated = "Use WKRefreshBackgroundTask instead"]
203 #[optional]
204 #[unsafe(method(getNextRequestedUpdateDateWithHandler:))]
205 #[unsafe(method_family = none)]
206 unsafe fn getNextRequestedUpdateDateWithHandler(
207 &self,
208 handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
209 );
210
211 #[deprecated = "Use WKRefreshBackgroundTask instead"]
212 #[optional]
213 #[unsafe(method(requestedUpdateDidBegin))]
214 #[unsafe(method_family = none)]
215 unsafe fn requestedUpdateDidBegin(&self);
216
217 #[deprecated = "Use WKRefreshBackgroundTask instead"]
218 #[optional]
219 #[unsafe(method(requestedUpdateBudgetExhausted))]
220 #[unsafe(method_family = none)]
221 unsafe fn requestedUpdateBudgetExhausted(&self);
222 }
223);