objc2_ui_kit/generated/
UIRegion.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/uiregion?language=objc)
13    #[unsafe(super(NSObject))]
14    #[thread_kind = MainThreadOnly]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct UIRegion;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for UIRegion {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for UIRegion {}
25);
26
27unsafe impl CopyingHelper for UIRegion {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for UIRegion {}
33);
34
35impl UIRegion {
36    extern_methods!(
37        /// A shared infinite region
38        #[unsafe(method(infiniteRegion))]
39        #[unsafe(method_family = none)]
40        pub fn infiniteRegion(mtm: MainThreadMarker) -> Retained<UIRegion>;
41
42        #[cfg(feature = "objc2-core-foundation")]
43        /// Create a circular region with radius
44        #[unsafe(method(initWithRadius:))]
45        #[unsafe(method_family = init)]
46        pub fn initWithRadius(this: Allocated<Self>, radius: CGFloat) -> Retained<Self>;
47
48        #[cfg(feature = "objc2-core-foundation")]
49        /// Create a rectangular region of size.
50        #[unsafe(method(initWithSize:))]
51        #[unsafe(method_family = init)]
52        pub fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
53
54        /// Create a new region that is the inverse of the current region.
55        /// The inverse of the infiniteRegion is an empty region.
56        /// Subclasses of UIRegion need to provide an implementation of inverseRegion.
57        #[unsafe(method(inverseRegion))]
58        #[unsafe(method_family = none)]
59        pub fn inverseRegion(&self) -> Retained<Self>;
60
61        /// Create a new region that is the original region plus the supplied region
62        #[unsafe(method(regionByUnionWithRegion:))]
63        #[unsafe(method_family = none)]
64        pub fn regionByUnionWithRegion(&self, region: &UIRegion) -> Retained<Self>;
65
66        /// Create a new region that is the original region minus the supplied region
67        #[unsafe(method(regionByDifferenceFromRegion:))]
68        #[unsafe(method_family = none)]
69        pub fn regionByDifferenceFromRegion(&self, region: &UIRegion) -> Retained<Self>;
70
71        /// Create a new region that is the region covered by the original region and the supplied region
72        #[unsafe(method(regionByIntersectionWithRegion:))]
73        #[unsafe(method_family = none)]
74        pub fn regionByIntersectionWithRegion(&self, region: &UIRegion) -> Retained<Self>;
75
76        #[cfg(feature = "objc2-core-foundation")]
77        /// Test for containment
78        #[unsafe(method(containsPoint:))]
79        #[unsafe(method_family = none)]
80        pub fn containsPoint(&self, point: CGPoint) -> bool;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85impl UIRegion {
86    extern_methods!(
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
94    );
95}