objc2_ui_kit/generated/
UICornerConfiguration.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    /// Defines how corner radii are mapped to the corners of a rectangle.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uicornerconfiguration?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UICornerConfiguration;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for UICornerConfiguration {}
22);
23
24unsafe impl CopyingHelper for UICornerConfiguration {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for UICornerConfiguration {}
30);
31
32impl UICornerConfiguration {
33    extern_methods!(
34        #[cfg(feature = "UICornerRadius")]
35        /// A configuration that applies the given radius independently to all corners.
36        ///
37        /// When used with a container concentric radius, this allows each individual
38        /// corner to resolve to different radii.
39        #[unsafe(method(configurationWithRadius:))]
40        #[unsafe(method_family = none)]
41        pub fn configurationWithRadius(radius: &UICornerRadius) -> Retained<Self>;
42
43        #[cfg(feature = "UICornerRadius")]
44        /// A configuration with independent radii for each corner.
45        #[unsafe(method(configurationWithTopLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:))]
46        #[unsafe(method_family = none)]
47        pub fn configurationWithTopLeftRadius_topRightRadius_bottomLeftRadius_bottomRightRadius(
48            top_left_radius: Option<&UICornerRadius>,
49            top_right_radius: Option<&UICornerRadius>,
50            bottom_left_radius: Option<&UICornerRadius>,
51            bottom_right_radius: Option<&UICornerRadius>,
52        ) -> Retained<Self>;
53
54        /// A configuration that rounds the corners into a capsule shape, scaling with the view's size.
55        #[unsafe(method(capsuleConfiguration))]
56        #[unsafe(method_family = none)]
57        pub fn capsuleConfiguration() -> Retained<Self>;
58
59        #[cfg(feature = "objc2-core-foundation")]
60        /// A configuration that rounds the corners into a capsule shape, scaling with the view's size and clamped to the `maximumRadius`.
61        #[unsafe(method(capsuleConfigurationWithMaximumRadius:))]
62        #[unsafe(method_family = none)]
63        pub fn capsuleConfigurationWithMaximumRadius(maximum_radius: CGFloat) -> Retained<Self>;
64
65        #[cfg(feature = "UICornerRadius")]
66        /// A configuration that applies the given radius uniformly to all corners.
67        #[unsafe(method(configurationWithUniformRadius:))]
68        #[unsafe(method_family = none)]
69        pub fn configurationWithUniformRadius(radius: &UICornerRadius) -> Retained<Self>;
70
71        #[cfg(feature = "UICornerRadius")]
72        /// A configuration that applies the `topRadius` uniformly to the top-left and top-right corners, and the `bottomRadius` uniformly to the bottom-left and bottom-right corners.
73        #[unsafe(method(configurationWithUniformTopRadius:uniformBottomRadius:))]
74        #[unsafe(method_family = none)]
75        pub fn configurationWithUniformTopRadius_uniformBottomRadius(
76            top_radius: &UICornerRadius,
77            bottom_radius: &UICornerRadius,
78        ) -> Retained<Self>;
79
80        #[cfg(feature = "UICornerRadius")]
81        /// A configuration that applies the `leftRadius` uniformly to the top-left and bottom-left corners, and the `rightRadius` uniformly to the top-right and bottom-right corners.
82        #[unsafe(method(configurationWithUniformLeftRadius:uniformRightRadius:))]
83        #[unsafe(method_family = none)]
84        pub fn configurationWithUniformLeftRadius_uniformRightRadius(
85            left_radius: &UICornerRadius,
86            right_radius: &UICornerRadius,
87        ) -> Retained<Self>;
88
89        #[cfg(feature = "UICornerRadius")]
90        /// A configuration that applies the `topRadius` uniformly to the top-left and top-right corners, with optional independent radii for the bottom-left and bottom-right corners.
91        #[unsafe(method(configurationWithUniformTopRadius:bottomLeftRadius:bottomRightRadius:))]
92        #[unsafe(method_family = none)]
93        pub fn configurationWithUniformTopRadius_bottomLeftRadius_bottomRightRadius(
94            top_radius: &UICornerRadius,
95            bottom_left_radius: Option<&UICornerRadius>,
96            bottom_right_radius: Option<&UICornerRadius>,
97        ) -> Retained<Self>;
98
99        #[cfg(feature = "UICornerRadius")]
100        /// A configuration that applies the `bottomRadius` uniformly to the bottom-left and bottom-right corners, with optional independent radii for the top-left and top-right corners.
101        #[unsafe(method(configurationWithUniformBottomRadius:topLeftRadius:topRightRadius:))]
102        #[unsafe(method_family = none)]
103        pub fn configurationWithUniformBottomRadius_topLeftRadius_topRightRadius(
104            bottom_radius: &UICornerRadius,
105            top_left_radius: Option<&UICornerRadius>,
106            top_right_radius: Option<&UICornerRadius>,
107        ) -> Retained<Self>;
108
109        #[cfg(feature = "UICornerRadius")]
110        /// A configuration that applies the `leftRadius` uniformly to the top-left and bottom-left corners, with optional independent radii for the top-right and bottom-right corners.
111        #[unsafe(method(configurationWithUniformLeftRadius:topRightRadius:bottomRightRadius:))]
112        #[unsafe(method_family = none)]
113        pub fn configurationWithUniformLeftRadius_topRightRadius_bottomRightRadius(
114            left_radius: &UICornerRadius,
115            top_right_radius: Option<&UICornerRadius>,
116            bottom_right_radius: Option<&UICornerRadius>,
117        ) -> Retained<Self>;
118
119        #[cfg(feature = "UICornerRadius")]
120        /// A configuration that applies the `rightRadius` uniformly to the top-right and bottom-right corners, with optional independent radii for the top-left and bottom-left corners.
121        #[unsafe(method(configurationWithUniformRightRadius:topLeftRadius:bottomLeftRadius:))]
122        #[unsafe(method_family = none)]
123        pub fn configurationWithUniformRightRadius_topLeftRadius_bottomLeftRadius(
124            right_radius: &UICornerRadius,
125            top_left_radius: Option<&UICornerRadius>,
126            bottom_left_radius: Option<&UICornerRadius>,
127        ) -> Retained<Self>;
128
129        #[unsafe(method(init))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133        #[unsafe(method(new))]
134        #[unsafe(method_family = new)]
135        pub unsafe fn new() -> Retained<Self>;
136    );
137}