objc2_ui_kit/generated/
UIUpdateLink.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-quartz-core")]
7#[cfg(not(target_os = "watchos"))]
8use objc2_quartz_core::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
17 #[thread_kind = MainThreadOnly]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 pub struct UIUpdateLink;
20);
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for UIUpdateLink {}
24);
25
26impl UIUpdateLink {
27 extern_methods!(
28 #[unsafe(method(new))]
29 #[unsafe(method_family = new)]
30 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
31
32 #[unsafe(method(init))]
33 #[unsafe(method_family = init)]
34 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
35
36 #[cfg(all(
37 feature = "UIResponder",
38 feature = "UIScene",
39 feature = "UIWindowScene"
40 ))]
41 #[unsafe(method(updateLinkForWindowScene:))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn updateLinkForWindowScene(
44 window_scene: &UIWindowScene,
45 ) -> Retained<UIUpdateLink>;
46
47 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
48 #[unsafe(method(updateLinkForView:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn updateLinkForView(view: &UIView) -> Retained<UIUpdateLink>;
51
52 #[cfg(all(
53 feature = "UIUpdateActionPhase",
54 feature = "UIUpdateInfo",
55 feature = "block2"
56 ))]
57 #[unsafe(method(addActionToPhase:handler:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn addActionToPhase_handler(
60 &self,
61 phase: &UIUpdateActionPhase,
62 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
63 );
64
65 #[cfg(feature = "UIUpdateActionPhase")]
66 #[unsafe(method(addActionToPhase:target:selector:))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn addActionToPhase_target_selector(
69 &self,
70 phase: &UIUpdateActionPhase,
71 target: &AnyObject,
72 selector: Sel,
73 );
74
75 #[unsafe(method(isEnabled))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn isEnabled(&self) -> bool;
79
80 #[unsafe(method(setEnabled:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setEnabled(&self, enabled: bool);
84
85 #[unsafe(method(requiresContinuousUpdates))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn requiresContinuousUpdates(&self) -> bool;
90
91 #[unsafe(method(setRequiresContinuousUpdates:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setRequiresContinuousUpdates(&self, requires_continuous_updates: bool);
95
96 #[unsafe(method(wantsLowLatencyEventDispatch))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn wantsLowLatencyEventDispatch(&self) -> bool;
102
103 #[unsafe(method(setWantsLowLatencyEventDispatch:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setWantsLowLatencyEventDispatch(
107 &self,
108 wants_low_latency_event_dispatch: bool,
109 );
110
111 #[unsafe(method(wantsImmediatePresentation))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn wantsImmediatePresentation(&self) -> bool;
123
124 #[unsafe(method(setWantsImmediatePresentation:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setWantsImmediatePresentation(&self, wants_immediate_presentation: bool);
128
129 #[cfg(feature = "objc2-quartz-core")]
130 #[cfg(not(target_os = "watchos"))]
131 #[unsafe(method(preferredFrameRateRange))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn preferredFrameRateRange(&self) -> CAFrameRateRange;
136
137 #[cfg(feature = "objc2-quartz-core")]
138 #[cfg(not(target_os = "watchos"))]
139 #[unsafe(method(setPreferredFrameRateRange:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn setPreferredFrameRateRange(
143 &self,
144 preferred_frame_rate_range: CAFrameRateRange,
145 );
146
147 #[cfg(feature = "UIUpdateInfo")]
148 #[unsafe(method(currentUpdateInfo))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn currentUpdateInfo(&self) -> Option<Retained<UIUpdateInfo>>;
153 );
154}
155
156impl UIUpdateLink {
158 extern_methods!(
159 #[cfg(all(feature = "UIUpdateInfo", feature = "block2"))]
160 #[unsafe(method(addActionWithHandler:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn addActionWithHandler(
164 &self,
165 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
166 );
167
168 #[unsafe(method(addActionWithTarget:selector:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn addActionWithTarget_selector(&self, target: &AnyObject, selector: Sel);
172
173 #[cfg(all(
174 feature = "UIResponder",
175 feature = "UIScene",
176 feature = "UIUpdateInfo",
177 feature = "UIWindowScene",
178 feature = "block2"
179 ))]
180 #[unsafe(method(updateLinkForWindowScene:actionHandler:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn updateLinkForWindowScene_actionHandler(
184 window_scene: &UIWindowScene,
185 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
186 ) -> Retained<UIUpdateLink>;
187
188 #[cfg(all(
189 feature = "UIResponder",
190 feature = "UIScene",
191 feature = "UIWindowScene"
192 ))]
193 #[unsafe(method(updateLinkForWindowScene:actionTarget:selector:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn updateLinkForWindowScene_actionTarget_selector(
197 window_scene: &UIWindowScene,
198 target: &AnyObject,
199 selector: Sel,
200 ) -> Retained<UIUpdateLink>;
201
202 #[cfg(all(
203 feature = "UIResponder",
204 feature = "UIUpdateInfo",
205 feature = "UIView",
206 feature = "block2"
207 ))]
208 #[unsafe(method(updateLinkForView:actionHandler:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn updateLinkForView_actionHandler(
212 view: &UIView,
213 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
214 ) -> Retained<UIUpdateLink>;
215
216 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
217 #[unsafe(method(updateLinkForView:actionTarget:selector:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn updateLinkForView_actionTarget_selector(
221 view: &UIView,
222 target: &AnyObject,
223 selector: Sel,
224 ) -> Retained<UIUpdateLink>;
225 );
226}