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 fn updateLinkForWindowScene(window_scene: &UIWindowScene) -> Retained<UIUpdateLink>;
44
45 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
46 #[unsafe(method(updateLinkForView:))]
47 #[unsafe(method_family = none)]
48 pub fn updateLinkForView(view: &UIView) -> Retained<UIUpdateLink>;
49
50 #[cfg(all(
51 feature = "UIUpdateActionPhase",
52 feature = "UIUpdateInfo",
53 feature = "block2"
54 ))]
55 #[unsafe(method(addActionToPhase:handler:))]
56 #[unsafe(method_family = none)]
57 pub fn addActionToPhase_handler(
58 &self,
59 phase: &UIUpdateActionPhase,
60 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
61 );
62
63 #[cfg(feature = "UIUpdateActionPhase")]
64 #[unsafe(method(addActionToPhase:target:selector:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn addActionToPhase_target_selector(
71 &self,
72 phase: &UIUpdateActionPhase,
73 target: &AnyObject,
74 selector: Sel,
75 );
76
77 #[unsafe(method(isEnabled))]
79 #[unsafe(method_family = none)]
80 pub fn isEnabled(&self) -> bool;
81
82 #[unsafe(method(setEnabled:))]
84 #[unsafe(method_family = none)]
85 pub fn setEnabled(&self, enabled: bool);
86
87 #[unsafe(method(requiresContinuousUpdates))]
90 #[unsafe(method_family = none)]
91 pub fn requiresContinuousUpdates(&self) -> bool;
92
93 #[unsafe(method(setRequiresContinuousUpdates:))]
95 #[unsafe(method_family = none)]
96 pub fn setRequiresContinuousUpdates(&self, requires_continuous_updates: bool);
97
98 #[unsafe(method(wantsLowLatencyEventDispatch))]
102 #[unsafe(method_family = none)]
103 pub fn wantsLowLatencyEventDispatch(&self) -> bool;
104
105 #[unsafe(method(setWantsLowLatencyEventDispatch:))]
107 #[unsafe(method_family = none)]
108 pub fn setWantsLowLatencyEventDispatch(&self, wants_low_latency_event_dispatch: bool);
109
110 #[unsafe(method(wantsImmediatePresentation))]
120 #[unsafe(method_family = none)]
121 pub fn wantsImmediatePresentation(&self) -> bool;
122
123 #[unsafe(method(setWantsImmediatePresentation:))]
125 #[unsafe(method_family = none)]
126 pub fn setWantsImmediatePresentation(&self, wants_immediate_presentation: bool);
127
128 #[cfg(feature = "objc2-quartz-core")]
129 #[cfg(not(target_os = "watchos"))]
130 #[unsafe(method(preferredFrameRateRange))]
133 #[unsafe(method_family = none)]
134 pub fn preferredFrameRateRange(&self) -> CAFrameRateRange;
135
136 #[cfg(feature = "objc2-quartz-core")]
137 #[cfg(not(target_os = "watchos"))]
138 #[unsafe(method(setPreferredFrameRateRange:))]
140 #[unsafe(method_family = none)]
141 pub fn setPreferredFrameRateRange(&self, preferred_frame_rate_range: CAFrameRateRange);
142
143 #[cfg(feature = "UIUpdateInfo")]
144 #[unsafe(method(currentUpdateInfo))]
147 #[unsafe(method_family = none)]
148 pub fn currentUpdateInfo(&self) -> Option<Retained<UIUpdateInfo>>;
149 );
150}
151
152impl UIUpdateLink {
154 extern_methods!(
155 #[cfg(all(feature = "UIUpdateInfo", feature = "block2"))]
156 #[unsafe(method(addActionWithHandler:))]
158 #[unsafe(method_family = none)]
159 pub fn addActionWithHandler(
160 &self,
161 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
162 );
163
164 #[unsafe(method(addActionWithTarget:selector:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn addActionWithTarget_selector(&self, target: &AnyObject, selector: Sel);
173
174 #[cfg(all(
175 feature = "UIResponder",
176 feature = "UIScene",
177 feature = "UIUpdateInfo",
178 feature = "UIWindowScene",
179 feature = "block2"
180 ))]
181 #[unsafe(method(updateLinkForWindowScene:actionHandler:))]
183 #[unsafe(method_family = none)]
184 pub fn updateLinkForWindowScene_actionHandler(
185 window_scene: &UIWindowScene,
186 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
187 ) -> Retained<UIUpdateLink>;
188
189 #[cfg(all(
190 feature = "UIResponder",
191 feature = "UIScene",
192 feature = "UIWindowScene"
193 ))]
194 #[unsafe(method(updateLinkForWindowScene:actionTarget:selector:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn updateLinkForWindowScene_actionTarget_selector(
203 window_scene: &UIWindowScene,
204 target: &AnyObject,
205 selector: Sel,
206 ) -> Retained<UIUpdateLink>;
207
208 #[cfg(all(
209 feature = "UIResponder",
210 feature = "UIUpdateInfo",
211 feature = "UIView",
212 feature = "block2"
213 ))]
214 #[unsafe(method(updateLinkForView:actionHandler:))]
216 #[unsafe(method_family = none)]
217 pub fn updateLinkForView_actionHandler(
218 view: &UIView,
219 handler: &block2::DynBlock<dyn Fn(NonNull<UIUpdateLink>, NonNull<UIUpdateInfo>)>,
220 ) -> Retained<UIUpdateLink>;
221
222 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
223 #[unsafe(method(updateLinkForView:actionTarget:selector:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn updateLinkForView_actionTarget_selector(
232 view: &UIView,
233 target: &AnyObject,
234 selector: Sel,
235 ) -> Retained<UIUpdateLink>;
236 );
237}