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")]
22unsafe impl NSCopying for UIPointerStyle {}
23
24#[cfg(feature = "UIHoverStyle")]
25unsafe impl CopyingHelper for UIPointerStyle {
26 type Result = Self;
27}
28
29#[cfg(feature = "UIHoverStyle")]
30unsafe impl NSObjectProtocol for UIPointerStyle {}
31
32#[cfg(feature = "UIHoverStyle")]
33impl UIPointerStyle {
34 extern_methods!(
35 #[cfg(feature = "UIPointerAccessory")]
36 #[unsafe(method(accessories))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn accessories(&self) -> Retained<NSArray<UIPointerAccessory>>;
41
42 #[cfg(feature = "UIPointerAccessory")]
43 #[unsafe(method(setAccessories:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn setAccessories(&self, accessories: &NSArray<UIPointerAccessory>);
47
48 #[unsafe(method(styleWithEffect:shape:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn styleWithEffect_shape(
57 effect: &UIPointerEffect,
58 shape: Option<&UIPointerShape>,
59 ) -> Retained<Self>;
60
61 #[cfg(feature = "UIGeometry")]
62 #[unsafe(method(styleWithShape:constrainedAxes:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn styleWithShape_constrainedAxes(
71 shape: &UIPointerShape,
72 axes: UIAxis,
73 ) -> Retained<Self>;
74
75 #[unsafe(method(hiddenPointerStyle))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn hiddenPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
79
80 #[unsafe(method(systemPointerStyle))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn systemPointerStyle(mtm: MainThreadMarker) -> Retained<Self>;
84
85 #[unsafe(method(init))]
86 #[unsafe(method_family = init)]
87 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89 #[unsafe(method(new))]
90 #[unsafe(method_family = new)]
91 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
92 );
93}
94
95#[cfg(feature = "UIHoverStyle")]
97impl UIPointerStyle {
98 extern_methods!(
99 #[cfg(feature = "UIShape")]
100 #[unsafe(method(styleWithShape:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn styleWithShape(
104 shape: Option<&UIShape>,
105 mtm: MainThreadMarker,
106 ) -> Retained<Self>;
107
108 #[unsafe(method(automaticStyle))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn automaticStyle(mtm: MainThreadMarker) -> Retained<Self>;
112 );
113}
114
115extern_class!(
116 #[unsafe(super(NSObject))]
118 #[thread_kind = MainThreadOnly]
119 #[derive(Debug, PartialEq, Eq, Hash)]
120 pub struct UIPointerEffect;
121);
122
123unsafe impl NSCopying for UIPointerEffect {}
124
125unsafe impl CopyingHelper for UIPointerEffect {
126 type Result = Self;
127}
128
129unsafe impl NSObjectProtocol for UIPointerEffect {}
130
131#[cfg(feature = "UIHoverEffect")]
132unsafe impl UIHoverEffect for UIPointerEffect {}
133
134impl UIPointerEffect {
135 extern_methods!(
136 #[cfg(feature = "UITargetedPreview")]
137 #[unsafe(method(preview))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn preview(&self) -> Retained<UITargetedPreview>;
140
141 #[cfg(feature = "UITargetedPreview")]
142 #[unsafe(method(effectWithPreview:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
153
154 #[unsafe(method(init))]
155 #[unsafe(method_family = init)]
156 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
157
158 #[unsafe(method(new))]
159 #[unsafe(method_family = new)]
160 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
161 );
162}
163
164extern_class!(
165 #[unsafe(super(UIPointerEffect, NSObject))]
169 #[thread_kind = MainThreadOnly]
170 #[derive(Debug, PartialEq, Eq, Hash)]
171 pub struct UIPointerHighlightEffect;
172);
173
174unsafe impl NSCopying for UIPointerHighlightEffect {}
175
176unsafe impl CopyingHelper for UIPointerHighlightEffect {
177 type Result = Self;
178}
179
180unsafe impl NSObjectProtocol for UIPointerHighlightEffect {}
181
182#[cfg(feature = "UIHoverEffect")]
183unsafe impl UIHoverEffect for UIPointerHighlightEffect {}
184
185impl UIPointerHighlightEffect {
186 extern_methods!();
187}
188
189impl UIPointerHighlightEffect {
191 extern_methods!(
192 #[cfg(feature = "UITargetedPreview")]
193 #[unsafe(method(effectWithPreview:))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
204
205 #[unsafe(method(init))]
206 #[unsafe(method_family = init)]
207 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
208
209 #[unsafe(method(new))]
210 #[unsafe(method_family = new)]
211 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
212 );
213}
214
215extern_class!(
216 #[unsafe(super(UIPointerEffect, NSObject))]
220 #[thread_kind = MainThreadOnly]
221 #[derive(Debug, PartialEq, Eq, Hash)]
222 pub struct UIPointerLiftEffect;
223);
224
225unsafe impl NSCopying for UIPointerLiftEffect {}
226
227unsafe impl CopyingHelper for UIPointerLiftEffect {
228 type Result = Self;
229}
230
231unsafe impl NSObjectProtocol for UIPointerLiftEffect {}
232
233#[cfg(feature = "UIHoverEffect")]
234unsafe impl UIHoverEffect for UIPointerLiftEffect {}
235
236impl UIPointerLiftEffect {
237 extern_methods!();
238}
239
240impl UIPointerLiftEffect {
242 extern_methods!(
243 #[cfg(feature = "UITargetedPreview")]
244 #[unsafe(method(effectWithPreview:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
255
256 #[unsafe(method(init))]
257 #[unsafe(method_family = init)]
258 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
259
260 #[unsafe(method(new))]
261 #[unsafe(method_family = new)]
262 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
263 );
264}
265
266#[repr(transparent)]
269#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
270pub struct UIPointerEffectTintMode(pub NSInteger);
271impl UIPointerEffectTintMode {
272 #[doc(alias = "UIPointerEffectTintModeNone")]
273 pub const None: Self = Self(0);
274 #[doc(alias = "UIPointerEffectTintModeOverlay")]
275 pub const Overlay: Self = Self(1);
276 #[doc(alias = "UIPointerEffectTintModeUnderlay")]
277 pub const Underlay: Self = Self(2);
278}
279
280unsafe impl Encode for UIPointerEffectTintMode {
281 const ENCODING: Encoding = NSInteger::ENCODING;
282}
283
284unsafe impl RefEncode for UIPointerEffectTintMode {
285 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
286}
287
288extern_class!(
289 #[unsafe(super(UIPointerEffect, NSObject))]
293 #[thread_kind = MainThreadOnly]
294 #[derive(Debug, PartialEq, Eq, Hash)]
295 pub struct UIPointerHoverEffect;
296);
297
298unsafe impl NSCopying for UIPointerHoverEffect {}
299
300unsafe impl CopyingHelper for UIPointerHoverEffect {
301 type Result = Self;
302}
303
304unsafe impl NSObjectProtocol for UIPointerHoverEffect {}
305
306#[cfg(feature = "UIHoverEffect")]
307unsafe impl UIHoverEffect for UIPointerHoverEffect {}
308
309impl UIPointerHoverEffect {
310 extern_methods!(
311 #[unsafe(method(preferredTintMode))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn preferredTintMode(&self) -> UIPointerEffectTintMode;
314
315 #[unsafe(method(setPreferredTintMode:))]
317 #[unsafe(method_family = none)]
318 pub unsafe fn setPreferredTintMode(&self, preferred_tint_mode: UIPointerEffectTintMode);
319
320 #[unsafe(method(prefersShadow))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn prefersShadow(&self) -> bool;
323
324 #[unsafe(method(setPrefersShadow:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn setPrefersShadow(&self, prefers_shadow: bool);
328
329 #[unsafe(method(prefersScaledContent))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn prefersScaledContent(&self) -> bool;
332
333 #[unsafe(method(setPrefersScaledContent:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn setPrefersScaledContent(&self, prefers_scaled_content: bool);
337 );
338}
339
340impl UIPointerHoverEffect {
342 extern_methods!(
343 #[cfg(feature = "UITargetedPreview")]
344 #[unsafe(method(effectWithPreview:))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn effectWithPreview(preview: &UITargetedPreview) -> Retained<Self>;
355
356 #[unsafe(method(init))]
357 #[unsafe(method_family = init)]
358 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
359
360 #[unsafe(method(new))]
361 #[unsafe(method_family = new)]
362 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
363 );
364}
365
366extern_class!(
367 #[unsafe(super(NSObject))]
369 #[thread_kind = MainThreadOnly]
370 #[derive(Debug, PartialEq, Eq, Hash)]
371 pub struct UIPointerShape;
372);
373
374unsafe impl NSCopying for UIPointerShape {}
375
376unsafe impl CopyingHelper for UIPointerShape {
377 type Result = Self;
378}
379
380unsafe impl NSObjectProtocol for UIPointerShape {}
381
382impl UIPointerShape {
383 extern_methods!(
384 #[cfg(feature = "UIBezierPath")]
385 #[unsafe(method(shapeWithPath:))]
389 #[unsafe(method_family = none)]
390 pub unsafe fn shapeWithPath(path: &UIBezierPath, mtm: MainThreadMarker) -> Retained<Self>;
391
392 #[cfg(feature = "objc2-core-foundation")]
393 #[unsafe(method(shapeWithRoundedRect:))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn shapeWithRoundedRect(rect: CGRect, mtm: MainThreadMarker) -> Retained<Self>;
402
403 #[cfg(feature = "objc2-core-foundation")]
404 #[unsafe(method(shapeWithRoundedRect:cornerRadius:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn shapeWithRoundedRect_cornerRadius(
415 rect: CGRect,
416 corner_radius: CGFloat,
417 mtm: MainThreadMarker,
418 ) -> Retained<Self>;
419
420 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
421 #[unsafe(method(beamWithPreferredLength:axis:))]
428 #[unsafe(method_family = none)]
429 pub unsafe fn beamWithPreferredLength_axis(
430 length: CGFloat,
431 axis: UIAxis,
432 mtm: MainThreadMarker,
433 ) -> Retained<Self>;
434
435 #[unsafe(method(init))]
436 #[unsafe(method_family = init)]
437 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
438
439 #[unsafe(method(new))]
440 #[unsafe(method_family = new)]
441 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
442 );
443}