objc2_ui_kit/generated/
UIPointerStyle.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(UIHoverStyle, NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "UIHoverStyle")]
18 pub struct UIPointerStyle;
19);
20
21#[cfg(feature = "UIHoverStyle")]
22extern_conformance!(
23 unsafe impl NSCopying for UIPointerStyle {}
24);
25
26#[cfg(feature = "UIHoverStyle")]
27unsafe impl CopyingHelper for UIPointerStyle {
28 type Result = Self;
29}
30
31#[cfg(feature = "UIHoverStyle")]
32extern_conformance!(
33 unsafe impl NSObjectProtocol for UIPointerStyle {}
34);
35
36#[cfg(feature = "UIHoverStyle")]
37impl UIPointerStyle {
38 extern_methods!(
39 #[cfg(feature = "UIPointerAccessory")]
40 #[unsafe(method(accessories))]
43 #[unsafe(method_family = none)]
44 pub fn accessories(&self) -> Retained<NSArray<UIPointerAccessory>>;
45
46 #[cfg(feature = "UIPointerAccessory")]
47 #[unsafe(method(setAccessories:))]
51 #[unsafe(method_family = none)]
52 pub fn setAccessories(&self, accessories: &NSArray<UIPointerAccessory>);
53
54 #[unsafe(method(styleWithEffect:shape:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn styleWithEffect_shape(
63 effect: &UIPointerEffect,
64 shape: Option<&UIPointerShape>,
65 ) -> Retained<Self>;
66
67 #[cfg(feature = "UIGeometry")]
68 #[unsafe(method(styleWithShape:constrainedAxes:))]
75 #[unsafe(method_family = none)]
76 pub fn styleWithShape_constrainedAxes(
77 shape: &UIPointerShape,
78 axes: UIAxis,
79 ) -> Retained<Self>;
80
81 #[unsafe(method(hiddenPointerStyle))]
83 #[unsafe(method_family = none)]
84 pub fn hiddenPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
85
86 #[unsafe(method(systemPointerStyle))]
88 #[unsafe(method_family = none)]
89 pub fn systemPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
90
91 #[unsafe(method(init))]
92 #[unsafe(method_family = init)]
93 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95 #[unsafe(method(new))]
96 #[unsafe(method_family = new)]
97 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
98 );
99}
100
101#[cfg(feature = "UIHoverStyle")]
103impl UIPointerStyle {
104 extern_methods!(
105 #[cfg(feature = "UIShape")]
106 #[unsafe(method(styleWithShape:))]
108 #[unsafe(method_family = none)]
109 pub fn styleWithShape(shape: Option<&UIShape>, mtm: MainThreadMarker) -> Retained<Self>;
110
111 #[unsafe(method(automaticStyle))]
113 #[unsafe(method_family = none)]
114 pub fn automaticStyle(mtm: MainThreadMarker) -> Retained<Self>;
115 );
116}
117
118extern_class!(
119 #[unsafe(super(NSObject))]
121 #[thread_kind = MainThreadOnly]
122 #[derive(Debug, PartialEq, Eq, Hash)]
123 pub struct UIPointerEffect;
124);
125
126extern_conformance!(
127 unsafe impl NSCopying for UIPointerEffect {}
128);
129
130unsafe impl CopyingHelper for UIPointerEffect {
131 type Result = Self;
132}
133
134extern_conformance!(
135 unsafe impl NSObjectProtocol for UIPointerEffect {}
136);
137
138#[cfg(feature = "UIHoverEffect")]
139extern_conformance!(
140 unsafe impl UIHoverEffect for UIPointerEffect {}
141);
142
143impl UIPointerEffect {
144 extern_methods!(
145 #[cfg(feature = "UITargetedPreview")]
146 #[unsafe(method(preview))]
147 #[unsafe(method_family = none)]
148 pub fn preview(&self) -> Retained<UITargetedPreview>;
149
150 #[cfg(feature = "UITargetedPreview")]
151 #[unsafe(method(effectWithPreview:))]
160 #[unsafe(method_family = none)]
161 pub fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
162
163 #[unsafe(method(init))]
164 #[unsafe(method_family = init)]
165 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167 #[unsafe(method(new))]
168 #[unsafe(method_family = new)]
169 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
170 );
171}
172
173extern_class!(
174 #[unsafe(super(UIPointerEffect, NSObject))]
178 #[thread_kind = MainThreadOnly]
179 #[derive(Debug, PartialEq, Eq, Hash)]
180 pub struct UIPointerHighlightEffect;
181);
182
183extern_conformance!(
184 unsafe impl NSCopying for UIPointerHighlightEffect {}
185);
186
187unsafe impl CopyingHelper for UIPointerHighlightEffect {
188 type Result = Self;
189}
190
191extern_conformance!(
192 unsafe impl NSObjectProtocol for UIPointerHighlightEffect {}
193);
194
195#[cfg(feature = "UIHoverEffect")]
196extern_conformance!(
197 unsafe impl UIHoverEffect for UIPointerHighlightEffect {}
198);
199
200impl UIPointerHighlightEffect {
201 extern_methods!();
202}
203
204impl UIPointerHighlightEffect {
206 extern_methods!(
207 #[cfg(feature = "UITargetedPreview")]
208 #[unsafe(method(effectWithPreview:))]
217 #[unsafe(method_family = none)]
218 pub fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
219
220 #[unsafe(method(init))]
221 #[unsafe(method_family = init)]
222 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
223
224 #[unsafe(method(new))]
225 #[unsafe(method_family = new)]
226 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
227 );
228}
229
230extern_class!(
231 #[unsafe(super(UIPointerEffect, NSObject))]
235 #[thread_kind = MainThreadOnly]
236 #[derive(Debug, PartialEq, Eq, Hash)]
237 pub struct UIPointerLiftEffect;
238);
239
240extern_conformance!(
241 unsafe impl NSCopying for UIPointerLiftEffect {}
242);
243
244unsafe impl CopyingHelper for UIPointerLiftEffect {
245 type Result = Self;
246}
247
248extern_conformance!(
249 unsafe impl NSObjectProtocol for UIPointerLiftEffect {}
250);
251
252#[cfg(feature = "UIHoverEffect")]
253extern_conformance!(
254 unsafe impl UIHoverEffect for UIPointerLiftEffect {}
255);
256
257impl UIPointerLiftEffect {
258 extern_methods!();
259}
260
261impl UIPointerLiftEffect {
263 extern_methods!(
264 #[cfg(feature = "UITargetedPreview")]
265 #[unsafe(method(effectWithPreview:))]
274 #[unsafe(method_family = none)]
275 pub fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
276
277 #[unsafe(method(init))]
278 #[unsafe(method_family = init)]
279 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
280
281 #[unsafe(method(new))]
282 #[unsafe(method_family = new)]
283 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
284 );
285}
286
287#[repr(transparent)]
290#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
291pub struct UIPointerEffectTintMode(pub NSInteger);
292impl UIPointerEffectTintMode {
293 #[doc(alias = "UIPointerEffectTintModeNone")]
294 pub const None: Self = Self(0);
295 #[doc(alias = "UIPointerEffectTintModeOverlay")]
296 pub const Overlay: Self = Self(1);
297 #[doc(alias = "UIPointerEffectTintModeUnderlay")]
298 pub const Underlay: Self = Self(2);
299}
300
301unsafe impl Encode for UIPointerEffectTintMode {
302 const ENCODING: Encoding = NSInteger::ENCODING;
303}
304
305unsafe impl RefEncode for UIPointerEffectTintMode {
306 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
307}
308
309extern_class!(
310 #[unsafe(super(UIPointerEffect, NSObject))]
314 #[thread_kind = MainThreadOnly]
315 #[derive(Debug, PartialEq, Eq, Hash)]
316 pub struct UIPointerHoverEffect;
317);
318
319extern_conformance!(
320 unsafe impl NSCopying for UIPointerHoverEffect {}
321);
322
323unsafe impl CopyingHelper for UIPointerHoverEffect {
324 type Result = Self;
325}
326
327extern_conformance!(
328 unsafe impl NSObjectProtocol for UIPointerHoverEffect {}
329);
330
331#[cfg(feature = "UIHoverEffect")]
332extern_conformance!(
333 unsafe impl UIHoverEffect for UIPointerHoverEffect {}
334);
335
336impl UIPointerHoverEffect {
337 extern_methods!(
338 #[unsafe(method(preferredTintMode))]
339 #[unsafe(method_family = none)]
340 pub fn preferredTintMode(&self) -> UIPointerEffectTintMode;
341
342 #[unsafe(method(setPreferredTintMode:))]
344 #[unsafe(method_family = none)]
345 pub fn setPreferredTintMode(&self, preferred_tint_mode: UIPointerEffectTintMode);
346
347 #[unsafe(method(prefersShadow))]
348 #[unsafe(method_family = none)]
349 pub fn prefersShadow(&self) -> bool;
350
351 #[unsafe(method(setPrefersShadow:))]
353 #[unsafe(method_family = none)]
354 pub fn setPrefersShadow(&self, prefers_shadow: bool);
355
356 #[unsafe(method(prefersScaledContent))]
357 #[unsafe(method_family = none)]
358 pub fn prefersScaledContent(&self) -> bool;
359
360 #[unsafe(method(setPrefersScaledContent:))]
362 #[unsafe(method_family = none)]
363 pub fn setPrefersScaledContent(&self, prefers_scaled_content: bool);
364 );
365}
366
367impl UIPointerHoverEffect {
369 extern_methods!(
370 #[cfg(feature = "UITargetedPreview")]
371 #[unsafe(method(effectWithPreview:))]
380 #[unsafe(method_family = none)]
381 pub fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
382
383 #[unsafe(method(init))]
384 #[unsafe(method_family = init)]
385 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
386
387 #[unsafe(method(new))]
388 #[unsafe(method_family = new)]
389 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
390 );
391}
392
393extern_class!(
394 #[unsafe(super(NSObject))]
396 #[thread_kind = MainThreadOnly]
397 #[derive(Debug, PartialEq, Eq, Hash)]
398 pub struct UIPointerShape;
399);
400
401extern_conformance!(
402 unsafe impl NSCopying for UIPointerShape {}
403);
404
405unsafe impl CopyingHelper for UIPointerShape {
406 type Result = Self;
407}
408
409extern_conformance!(
410 unsafe impl NSObjectProtocol for UIPointerShape {}
411);
412
413impl UIPointerShape {
414 extern_methods!(
415 #[cfg(feature = "UIBezierPath")]
416 #[unsafe(method(shapeWithPath:))]
420 #[unsafe(method_family = none)]
421 pub fn shapeWithPath(path: &UIBezierPath, mtm: MainThreadMarker) -> Retained<Self>;
422
423 #[cfg(feature = "objc2-core-foundation")]
424 #[unsafe(method(shapeWithRoundedRect:))]
431 #[unsafe(method_family = none)]
432 pub fn shapeWithRoundedRect(rect: CGRect, mtm: MainThreadMarker) -> Retained<Self>;
433
434 #[cfg(feature = "objc2-core-foundation")]
435 #[unsafe(method(shapeWithRoundedRect:cornerRadius:))]
444 #[unsafe(method_family = none)]
445 pub fn shapeWithRoundedRect_cornerRadius(
446 rect: CGRect,
447 corner_radius: CGFloat,
448 mtm: MainThreadMarker,
449 ) -> Retained<Self>;
450
451 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
452 #[unsafe(method(beamWithPreferredLength:axis:))]
459 #[unsafe(method_family = none)]
460 pub fn beamWithPreferredLength_axis(
461 length: CGFloat,
462 axis: UIAxis,
463 mtm: MainThreadMarker,
464 ) -> Retained<Self>;
465
466 #[unsafe(method(init))]
467 #[unsafe(method_family = init)]
468 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
469
470 #[unsafe(method(new))]
471 #[unsafe(method_family = new)]
472 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
473 );
474}