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")]
20unsafe impl NSObjectProtocol for UIHoverGestureRecognizer {}
21
22#[cfg(feature = "UIGestureRecognizer")]
23impl UIHoverGestureRecognizer {
24    extern_methods!(
25        #[cfg(feature = "objc2-core-foundation")]
26        /// The normalized distance from the screen of the hovering device. This value will be 1 at the maximum distance
27        /// from the screen and will approach 0 as the device gets closer to the screen. Will always return 0 for devices that
28        /// don't support z offset.
29        #[unsafe(method(zOffset))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn zOffset(&self) -> CGFloat;
32
33        #[cfg(all(
34            feature = "UIResponder",
35            feature = "UIView",
36            feature = "objc2-core-foundation"
37        ))]
38        /// The azimuth angle of the current device in the specified view, or the gesture recognizer's window if nil. 0 is
39        /// returned for devices that don't support azimuth.
40        #[unsafe(method(azimuthAngleInView:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn azimuthAngleInView(&self, view: Option<&UIView>) -> CGFloat;
43
44        #[cfg(all(
45            feature = "UIResponder",
46            feature = "UIView",
47            feature = "objc2-core-foundation"
48        ))]
49        /// The azimuth unit vector of the current device in the specified view, or the gesture recognizer's window if nil.
50        /// An empty vector is returned for devices that don't support azimuth.
51        #[unsafe(method(azimuthUnitVectorInView:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn azimuthUnitVectorInView(&self, view: Option<&UIView>) -> CGVector;
54
55        #[cfg(feature = "objc2-core-foundation")]
56        /// The altitude angle of the current device. 0 is returned for devices that don't support altitude.
57        #[unsafe(method(altitudeAngle))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn altitudeAngle(&self) -> CGFloat;
60
61        #[cfg(feature = "objc2-core-foundation")]
62        #[unsafe(method(rollAngle))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn rollAngle(&self) -> CGFloat;
65    );
66}
67
68/// Methods declared on superclass `UIGestureRecognizer`.
69#[cfg(feature = "UIGestureRecognizer")]
70impl UIHoverGestureRecognizer {
71    extern_methods!(
72        #[unsafe(method(initWithTarget:action:))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn initWithTarget_action(
75            this: Allocated<Self>,
76            target: Option<&AnyObject>,
77            action: Option<Sel>,
78        ) -> Retained<Self>;
79
80        #[unsafe(method(init))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84        #[unsafe(method(initWithCoder:))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn initWithCoder(
87            this: Allocated<Self>,
88            coder: &NSCoder,
89        ) -> Option<Retained<Self>>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94#[cfg(feature = "UIGestureRecognizer")]
95impl UIHoverGestureRecognizer {
96    extern_methods!(
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
100    );
101}