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
20unsafe impl NSCopying for UIPointerRegion {}
21
22unsafe impl CopyingHelper for UIPointerRegion {
23    type Result = Self;
24}
25
26unsafe impl NSObjectProtocol for UIPointerRegion {}
27
28impl UIPointerRegion {
29    extern_methods!(
30        #[cfg(feature = "objc2-core-foundation")]
31        #[unsafe(method(rect))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn rect(&self) -> CGRect;
34
35        #[unsafe(method(identifier))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn identifier(&self) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
38
39        #[cfg(feature = "UIGeometry")]
40        /// Axes along which this region latches when the primary mouse button is pressed.
41        /// When set, the UIPointerStyle associated with this region will "lock in" and allow free-form movement along the specified axes.
42        #[unsafe(method(latchingAxes))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn latchingAxes(&self) -> UIAxis;
45
46        #[cfg(feature = "UIGeometry")]
47        /// Setter for [`latchingAxes`][Self::latchingAxes].
48        #[unsafe(method(setLatchingAxes:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn setLatchingAxes(&self, latching_axes: UIAxis);
51
52        #[cfg(feature = "objc2-core-foundation")]
53        /// Creates a UIPointerRegion with the supplied rect and optional identifier.
54        ///
55        ///
56        /// Parameter `rect`: This region's rect. Must be in the pointer interaction's view's coordinate space.
57        ///
58        /// Parameter `identifier`: Optional identifier that may be used to identify this region in subsequent pointer interaction delegate calls.
59        #[unsafe(method(regionWithRect:identifier:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn regionWithRect_identifier(
62            rect: CGRect,
63            identifier: Option<&ProtocolObject<dyn NSObjectProtocol>>,
64            mtm: MainThreadMarker,
65        ) -> Retained<Self>;
66
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
74    );
75}