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 unsafe fn accessories(&self) -> Retained<NSArray<UIPointerAccessory>>;
45
46 #[cfg(feature = "UIPointerAccessory")]
47 #[unsafe(method(setAccessories:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn setAccessories(&self, accessories: &NSArray<UIPointerAccessory>);
51
52 #[unsafe(method(styleWithEffect:shape:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn styleWithEffect_shape(
61 effect: &UIPointerEffect,
62 shape: Option<&UIPointerShape>,
63 ) -> Retained<Self>;
64
65 #[cfg(feature = "UIGeometry")]
66 #[unsafe(method(styleWithShape:constrainedAxes:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn styleWithShape_constrainedAxes(
75 shape: &UIPointerShape,
76 axes: UIAxis,
77 ) -> Retained<Self>;
78
79 #[unsafe(method(hiddenPointerStyle))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn hiddenPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
83
84 #[unsafe(method(systemPointerStyle))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn systemPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
88
89 #[unsafe(method(init))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
92
93 #[unsafe(method(new))]
94 #[unsafe(method_family = new)]
95 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
96 );
97}
98
99#[cfg(feature = "UIHoverStyle")]
101impl UIPointerStyle {
102 extern_methods!(
103 #[cfg(feature = "UIShape")]
104 #[unsafe(method(styleWithShape:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn styleWithShape(
108 shape: Option<&UIShape>,
109 mtm: MainThreadMarker,
110 ) -> Retained<Self>;
111
112 #[unsafe(method(automaticStyle))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn automaticStyle(mtm: MainThreadMarker) -> Retained<Self>;
116 );
117}
118
119extern_class!(
120 #[unsafe(super(NSObject))]
122 #[thread_kind = MainThreadOnly]
123 #[derive(Debug, PartialEq, Eq, Hash)]
124 pub struct UIPointerEffect;
125);
126
127extern_conformance!(
128 unsafe impl NSCopying for UIPointerEffect {}
129);
130
131unsafe impl CopyingHelper for UIPointerEffect {
132 type Result = Self;
133}
134
135extern_conformance!(
136 unsafe impl NSObjectProtocol for UIPointerEffect {}
137);
138
139#[cfg(feature = "UIHoverEffect")]
140extern_conformance!(
141 unsafe impl UIHoverEffect for UIPointerEffect {}
142);
143
144impl UIPointerEffect {
145 extern_methods!(
146 #[cfg(feature = "UITargetedPreview")]
147 #[unsafe(method(preview))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn preview(&self) -> Retained<UITargetedPreview>;
150
151 #[cfg(feature = "UITargetedPreview")]
152 #[unsafe(method(effectWithPreview:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
163
164 #[unsafe(method(init))]
165 #[unsafe(method_family = init)]
166 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
167
168 #[unsafe(method(new))]
169 #[unsafe(method_family = new)]
170 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
171 );
172}
173
174extern_class!(
175 #[unsafe(super(UIPointerEffect, NSObject))]
179 #[thread_kind = MainThreadOnly]
180 #[derive(Debug, PartialEq, Eq, Hash)]
181 pub struct UIPointerHighlightEffect;
182);
183
184extern_conformance!(
185 unsafe impl NSCopying for UIPointerHighlightEffect {}
186);
187
188unsafe impl CopyingHelper for UIPointerHighlightEffect {
189 type Result = Self;
190}
191
192extern_conformance!(
193 unsafe impl NSObjectProtocol for UIPointerHighlightEffect {}
194);
195
196#[cfg(feature = "UIHoverEffect")]
197extern_conformance!(
198 unsafe impl UIHoverEffect for UIPointerHighlightEffect {}
199);
200
201impl UIPointerHighlightEffect {
202 extern_methods!();
203}
204
205impl UIPointerHighlightEffect {
207 extern_methods!(
208 #[cfg(feature = "UITargetedPreview")]
209 #[unsafe(method(effectWithPreview:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
220
221 #[unsafe(method(init))]
222 #[unsafe(method_family = init)]
223 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
224
225 #[unsafe(method(new))]
226 #[unsafe(method_family = new)]
227 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
228 );
229}
230
231extern_class!(
232 #[unsafe(super(UIPointerEffect, NSObject))]
236 #[thread_kind = MainThreadOnly]
237 #[derive(Debug, PartialEq, Eq, Hash)]
238 pub struct UIPointerLiftEffect;
239);
240
241extern_conformance!(
242 unsafe impl NSCopying for UIPointerLiftEffect {}
243);
244
245unsafe impl CopyingHelper for UIPointerLiftEffect {
246 type Result = Self;
247}
248
249extern_conformance!(
250 unsafe impl NSObjectProtocol for UIPointerLiftEffect {}
251);
252
253#[cfg(feature = "UIHoverEffect")]
254extern_conformance!(
255 unsafe impl UIHoverEffect for UIPointerLiftEffect {}
256);
257
258impl UIPointerLiftEffect {
259 extern_methods!();
260}
261
262impl UIPointerLiftEffect {
264 extern_methods!(
265 #[cfg(feature = "UITargetedPreview")]
266 #[unsafe(method(effectWithPreview:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
277
278 #[unsafe(method(init))]
279 #[unsafe(method_family = init)]
280 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
281
282 #[unsafe(method(new))]
283 #[unsafe(method_family = new)]
284 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
285 );
286}
287
288#[repr(transparent)]
291#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
292pub struct UIPointerEffectTintMode(pub NSInteger);
293impl UIPointerEffectTintMode {
294 #[doc(alias = "UIPointerEffectTintModeNone")]
295 pub const None: Self = Self(0);
296 #[doc(alias = "UIPointerEffectTintModeOverlay")]
297 pub const Overlay: Self = Self(1);
298 #[doc(alias = "UIPointerEffectTintModeUnderlay")]
299 pub const Underlay: Self = Self(2);
300}
301
302unsafe impl Encode for UIPointerEffectTintMode {
303 const ENCODING: Encoding = NSInteger::ENCODING;
304}
305
306unsafe impl RefEncode for UIPointerEffectTintMode {
307 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
308}
309
310extern_class!(
311 #[unsafe(super(UIPointerEffect, NSObject))]
315 #[thread_kind = MainThreadOnly]
316 #[derive(Debug, PartialEq, Eq, Hash)]
317 pub struct UIPointerHoverEffect;
318);
319
320extern_conformance!(
321 unsafe impl NSCopying for UIPointerHoverEffect {}
322);
323
324unsafe impl CopyingHelper for UIPointerHoverEffect {
325 type Result = Self;
326}
327
328extern_conformance!(
329 unsafe impl NSObjectProtocol for UIPointerHoverEffect {}
330);
331
332#[cfg(feature = "UIHoverEffect")]
333extern_conformance!(
334 unsafe impl UIHoverEffect for UIPointerHoverEffect {}
335);
336
337impl UIPointerHoverEffect {
338 extern_methods!(
339 #[unsafe(method(preferredTintMode))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn preferredTintMode(&self) -> UIPointerEffectTintMode;
342
343 #[unsafe(method(setPreferredTintMode:))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn setPreferredTintMode(&self, preferred_tint_mode: UIPointerEffectTintMode);
347
348 #[unsafe(method(prefersShadow))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn prefersShadow(&self) -> bool;
351
352 #[unsafe(method(setPrefersShadow:))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn setPrefersShadow(&self, prefers_shadow: bool);
356
357 #[unsafe(method(prefersScaledContent))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn prefersScaledContent(&self) -> bool;
360
361 #[unsafe(method(setPrefersScaledContent:))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn setPrefersScaledContent(&self, prefers_scaled_content: bool);
365 );
366}
367
368impl UIPointerHoverEffect {
370 extern_methods!(
371 #[cfg(feature = "UITargetedPreview")]
372 #[unsafe(method(effectWithPreview:))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
383
384 #[unsafe(method(init))]
385 #[unsafe(method_family = init)]
386 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
387
388 #[unsafe(method(new))]
389 #[unsafe(method_family = new)]
390 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
391 );
392}
393
394extern_class!(
395 #[unsafe(super(NSObject))]
397 #[thread_kind = MainThreadOnly]
398 #[derive(Debug, PartialEq, Eq, Hash)]
399 pub struct UIPointerShape;
400);
401
402extern_conformance!(
403 unsafe impl NSCopying for UIPointerShape {}
404);
405
406unsafe impl CopyingHelper for UIPointerShape {
407 type Result = Self;
408}
409
410extern_conformance!(
411 unsafe impl NSObjectProtocol for UIPointerShape {}
412);
413
414impl UIPointerShape {
415 extern_methods!(
416 #[cfg(feature = "UIBezierPath")]
417 #[unsafe(method(shapeWithPath:))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn shapeWithPath(path: &UIBezierPath, mtm: MainThreadMarker) -> Retained<Self>;
423
424 #[cfg(feature = "objc2-core-foundation")]
425 #[unsafe(method(shapeWithRoundedRect:))]
432 #[unsafe(method_family = none)]
433 pub unsafe fn shapeWithRoundedRect(rect: CGRect, mtm: MainThreadMarker) -> Retained<Self>;
434
435 #[cfg(feature = "objc2-core-foundation")]
436 #[unsafe(method(shapeWithRoundedRect:cornerRadius:))]
445 #[unsafe(method_family = none)]
446 pub unsafe fn shapeWithRoundedRect_cornerRadius(
447 rect: CGRect,
448 corner_radius: CGFloat,
449 mtm: MainThreadMarker,
450 ) -> Retained<Self>;
451
452 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
453 #[unsafe(method(beamWithPreferredLength:axis:))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn beamWithPreferredLength_axis(
462 length: CGFloat,
463 axis: UIAxis,
464 mtm: MainThreadMarker,
465 ) -> Retained<Self>;
466
467 #[unsafe(method(init))]
468 #[unsafe(method_family = init)]
469 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
470
471 #[unsafe(method(new))]
472 #[unsafe(method_family = new)]
473 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
474 );
475}