objc2_ui_kit/generated/
UIPointerRegion.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipointerregion?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIPointerRegion;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for UIPointerRegion {}
22);
23
24unsafe impl CopyingHelper for UIPointerRegion {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for UIPointerRegion {}
30);
31
32impl UIPointerRegion {
33    extern_methods!(
34        #[cfg(feature = "objc2-core-foundation")]
35        #[unsafe(method(rect))]
36        #[unsafe(method_family = none)]
37        pub fn rect(&self) -> CGRect;
38
39        #[unsafe(method(identifier))]
40        #[unsafe(method_family = none)]
41        pub fn identifier(&self) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
42
43        #[cfg(feature = "UIGeometry")]
44        /// Axes along which this region latches when the primary mouse button is pressed.
45        /// When set, the UIPointerStyle associated with this region will "lock in" and allow free-form movement along the specified axes.
46        #[unsafe(method(latchingAxes))]
47        #[unsafe(method_family = none)]
48        pub fn latchingAxes(&self) -> UIAxis;
49
50        #[cfg(feature = "UIGeometry")]
51        /// Setter for [`latchingAxes`][Self::latchingAxes].
52        #[unsafe(method(setLatchingAxes:))]
53        #[unsafe(method_family = none)]
54        pub fn setLatchingAxes(&self, latching_axes: UIAxis);
55
56        #[cfg(feature = "objc2-core-foundation")]
57        /// Creates a UIPointerRegion with the supplied rect and optional identifier.
58        ///
59        ///
60        /// Parameter `rect`: This region's rect. Must be in the pointer interaction's view's coordinate space.
61        ///
62        /// Parameter `identifier`: Optional identifier that may be used to identify this region in subsequent pointer interaction delegate calls.
63        ///
64        /// # Safety
65        ///
66        /// `identifier` should be of the correct type.
67        #[unsafe(method(regionWithRect:identifier:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn regionWithRect_identifier(
70            rect: CGRect,
71            identifier: Option<&ProtocolObject<dyn NSObjectProtocol>>,
72            mtm: MainThreadMarker,
73        ) -> Retained<Self>;
74
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
82    );
83}