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 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 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 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 fn altitudeAngle(&self) -> CGFloat;
62
63        #[cfg(feature = "objc2-core-foundation")]
64        #[unsafe(method(rollAngle))]
65        #[unsafe(method_family = none)]
66        pub fn rollAngle(&self) -> CGFloat;
67    );
68}
69
70/// Methods declared on superclass `UIGestureRecognizer`.
71#[cfg(feature = "UIGestureRecognizer")]
72impl UIHoverGestureRecognizer {
73    extern_methods!(
74        /// # Safety
75        ///
76        /// - `target` should be of the correct type.
77        /// - `action` must be a valid selector.
78        #[unsafe(method(initWithTarget:action:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithTarget_action(
81            this: Allocated<Self>,
82            target: Option<&AnyObject>,
83            action: Option<Sel>,
84        ) -> Retained<Self>;
85
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        /// # Safety
91        ///
92        /// `coder` possibly has further requirements.
93        #[unsafe(method(initWithCoder:))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn initWithCoder(
96            this: Allocated<Self>,
97            coder: &NSCoder,
98        ) -> Option<Retained<Self>>;
99    );
100}
101
102/// Methods declared on superclass `NSObject`.
103#[cfg(feature = "UIGestureRecognizer")]
104impl UIHoverGestureRecognizer {
105    extern_methods!(
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
109    );
110}