objc2_ui_kit/generated/
UIHoverGestureRecognizer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uihovergesturerecognizer?language=objc)
13    #[unsafe(super(UIGestureRecognizer, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UIGestureRecognizer")]
16    pub struct UIHoverGestureRecognizer;
17);
18
19#[cfg(feature = "UIGestureRecognizer")]
20extern_conformance!(
21    unsafe impl NSObjectProtocol for UIHoverGestureRecognizer {}
22);
23
24#[cfg(feature = "UIGestureRecognizer")]
25impl UIHoverGestureRecognizer {
26    extern_methods!(
27        #[cfg(feature = "objc2-core-foundation")]
28        /// The normalized distance from the screen of the hovering device. This value will be 1 at the maximum distance
29        /// from the screen and will approach 0 as the device gets closer to the screen. Will always return 0 for devices that
30        /// don't support z offset.
31        #[unsafe(method(zOffset))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn zOffset(&self) -> CGFloat;
34
35        #[cfg(all(
36            feature = "UIResponder",
37            feature = "UIView",
38            feature = "objc2-core-foundation"
39        ))]
40        /// The azimuth angle of the current device in the specified view, or the gesture recognizer's window if nil. 0 is
41        /// returned for devices that don't support azimuth.
42        #[unsafe(method(azimuthAngleInView:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn azimuthAngleInView(&self, view: Option<&UIView>) -> CGFloat;
45
46        #[cfg(all(
47            feature = "UIResponder",
48            feature = "UIView",
49            feature = "objc2-core-foundation"
50        ))]
51        /// The azimuth unit vector of the current device in the specified view, or the gesture recognizer's window if nil.
52        /// An empty vector is returned for devices that don't support azimuth.
53        #[unsafe(method(azimuthUnitVectorInView:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn azimuthUnitVectorInView(&self, view: Option<&UIView>) -> CGVector;
56
57        #[cfg(feature = "objc2-core-foundation")]
58        /// The altitude angle of the current device. 0 is returned for devices that don't support altitude.
59        #[unsafe(method(altitudeAngle))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn altitudeAngle(&self) -> CGFloat;
62
63        #[cfg(feature = "objc2-core-foundation")]
64        #[unsafe(method(rollAngle))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn rollAngle(&self) -> CGFloat;
67    );
68}
69
70/// Methods declared on superclass `UIGestureRecognizer`.
71#[cfg(feature = "UIGestureRecognizer")]
72impl UIHoverGestureRecognizer {
73    extern_methods!(
74        #[unsafe(method(initWithTarget:action:))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn initWithTarget_action(
77            this: Allocated<Self>,
78            target: Option<&AnyObject>,
79            action: Option<Sel>,
80        ) -> Retained<Self>;
81
82        #[unsafe(method(init))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86        #[unsafe(method(initWithCoder:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithCoder(
89            this: Allocated<Self>,
90            coder: &NSCoder,
91        ) -> Option<Retained<Self>>;
92    );
93}
94
95/// Methods declared on superclass `NSObject`.
96#[cfg(feature = "UIGestureRecognizer")]
97impl UIHoverGestureRecognizer {
98    extern_methods!(
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
102    );
103}