objc2_ui_kit/generated/
UIListContentImageProperties.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/uilistcontentimageproperties?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIListContentImageProperties;
18);
19
20unsafe impl NSCoding for UIListContentImageProperties {}
21
22unsafe impl NSCopying for UIListContentImageProperties {}
23
24unsafe impl CopyingHelper for UIListContentImageProperties {
25    type Result = Self;
26}
27
28unsafe impl NSObjectProtocol for UIListContentImageProperties {}
29
30unsafe impl NSSecureCoding for UIListContentImageProperties {}
31
32impl UIListContentImageProperties {
33    extern_methods!(
34        #[cfg(all(
35            feature = "UIImageConfiguration",
36            feature = "UIImageSymbolConfiguration"
37        ))]
38        /// The symbol configuration to use.
39        #[unsafe(method(preferredSymbolConfiguration))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn preferredSymbolConfiguration(
42            &self,
43        ) -> Option<Retained<UIImageSymbolConfiguration>>;
44
45        #[cfg(all(
46            feature = "UIImageConfiguration",
47            feature = "UIImageSymbolConfiguration"
48        ))]
49        /// Setter for [`preferredSymbolConfiguration`][Self::preferredSymbolConfiguration].
50        #[unsafe(method(setPreferredSymbolConfiguration:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setPreferredSymbolConfiguration(
53            &self,
54            preferred_symbol_configuration: Option<&UIImageSymbolConfiguration>,
55        );
56
57        #[cfg(feature = "UIColor")]
58        /// The tintColor to apply to the image view. Nil will use the image view's normal inherited tintColor.
59        #[unsafe(method(tintColor))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
62
63        #[cfg(feature = "UIColor")]
64        /// Setter for [`tintColor`][Self::tintColor].
65        #[unsafe(method(setTintColor:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
68
69        #[cfg(all(
70            feature = "UIColor",
71            feature = "UIConfigurationColorTransformer",
72            feature = "block2"
73        ))]
74        /// Optional color transformer that is used to resolve the tint color. A nil value means the `tintColor` is used as-is.
75        #[unsafe(method(tintColorTransformer))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn tintColorTransformer(&self) -> UIConfigurationColorTransformer;
78
79        #[cfg(all(
80            feature = "UIColor",
81            feature = "UIConfigurationColorTransformer",
82            feature = "block2"
83        ))]
84        /// Setter for [`tintColorTransformer`][Self::tintColorTransformer].
85        #[unsafe(method(setTintColorTransformer:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setTintColorTransformer(
88            &self,
89            tint_color_transformer: UIConfigurationColorTransformer,
90        );
91
92        #[cfg(feature = "UIColor")]
93        /// Returns the resolved image tint color for the specified tint color of the view, based on the `tintColor` and `tintColorTransformer`.
94        #[unsafe(method(resolvedTintColorForTintColor:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn resolvedTintColorForTintColor(
97            &self,
98            tint_color: &UIColor,
99        ) -> Retained<UIColor>;
100
101        #[cfg(feature = "objc2-core-foundation")]
102        /// The preferred corner radius (using a continuous corner curve) for the image.
103        /// Default is 0. If the image is too small to fit the requested radius, the corner curve
104        /// and radius will be adjusted to fit.
105        #[unsafe(method(cornerRadius))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn cornerRadius(&self) -> CGFloat;
108
109        #[cfg(feature = "objc2-core-foundation")]
110        /// Setter for [`cornerRadius`][Self::cornerRadius].
111        #[unsafe(method(setCornerRadius:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
114
115        #[cfg(feature = "objc2-core-foundation")]
116        /// Enforces a maximum size for the image. The default value is CGSizeZero. A zero width or
117        /// height means the size is unconstrained on that dimension. If the image exceeds this size
118        /// on either dimension, its size will be reduced proportionately (maintaining aspect ratio).
119        #[unsafe(method(maximumSize))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn maximumSize(&self) -> CGSize;
122
123        #[cfg(feature = "objc2-core-foundation")]
124        /// Setter for [`maximumSize`][Self::maximumSize].
125        #[unsafe(method(setMaximumSize:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setMaximumSize(&self, maximum_size: CGSize);
128
129        #[cfg(feature = "objc2-core-foundation")]
130        /// The layout size that is reserved for the image, inside which the image will be centered.
131        /// The default value is CGSizeZero. The reservedLayoutSize width
132        /// &
133        /// height only affect the
134        /// space reserved for the image and its positioning; they do not affect the image's size.
135        /// A zero width or height means the default behavior is used for that dimension:
136        /// * Symbol images will be centered inside a standard width/height that is scaled
137        /// with the content size category.
138        /// * Non-symbol images will use a reservedLayoutSize equal to the actual size of the
139        /// displayed image.
140        /// Use the UIListContentImageStandardDimension constant for the width and/or height to force
141        /// the standard symbol image value to be used for that dimension, regardless of the image.
142        /// This property is used to horizontally align images across adjacent content views (even
143        /// when the actual image widths may vary slightly), and/or to ensure a consistent height is
144        /// reserved for different images across different content views (so that the content view
145        /// heights are consistent even when the actual image heights may vary slightly). The
146        /// reservedLayoutSize.width is ignored by content views at Accessibility Dynamic Type
147        /// sizes, and the reservedLayoutSize.height is ignored when using the special Accessibility
148        /// Dynamic Type layout where text wraps around the image.
149        #[unsafe(method(reservedLayoutSize))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn reservedLayoutSize(&self) -> CGSize;
152
153        #[cfg(feature = "objc2-core-foundation")]
154        /// Setter for [`reservedLayoutSize`][Self::reservedLayoutSize].
155        #[unsafe(method(setReservedLayoutSize:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn setReservedLayoutSize(&self, reserved_layout_size: CGSize);
158
159        /// Prevents the image from inverting its colors when the accessibility setting is enabled.
160        #[unsafe(method(accessibilityIgnoresInvertColors))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn accessibilityIgnoresInvertColors(&self) -> bool;
163
164        /// Setter for [`accessibilityIgnoresInvertColors`][Self::accessibilityIgnoresInvertColors].
165        #[unsafe(method(setAccessibilityIgnoresInvertColors:))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn setAccessibilityIgnoresInvertColors(
168            &self,
169            accessibility_ignores_invert_colors: bool,
170        );
171
172        #[cfg(feature = "objc2-core-foundation")]
173        /// The width of the stroke to draw around the image. Default is `0.0`.
174        #[unsafe(method(strokeWidth))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn strokeWidth(&self) -> CGFloat;
177
178        #[cfg(feature = "objc2-core-foundation")]
179        /// Setter for [`strokeWidth`][Self::strokeWidth].
180        #[unsafe(method(setStrokeWidth:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn setStrokeWidth(&self, stroke_width: CGFloat);
183
184        #[cfg(feature = "UIColor")]
185        /// Configures the color of the stroke. A nil value uses the view's tint color; use `clearColor` for no color (transparent).
186        #[unsafe(method(strokeColor))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn strokeColor(&self) -> Option<Retained<UIColor>>;
189
190        #[cfg(feature = "UIColor")]
191        /// Setter for [`strokeColor`][Self::strokeColor].
192        #[unsafe(method(setStrokeColor:))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn setStrokeColor(&self, stroke_color: Option<&UIColor>);
195
196        #[cfg(all(
197            feature = "UIColor",
198            feature = "UIConfigurationColorTransformer",
199            feature = "block2"
200        ))]
201        /// Optional color transformer that is used to resolve the stroke color. A nil value means the `strokeColor` is used as-is.
202        #[unsafe(method(strokeColorTransformer))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn strokeColorTransformer(&self) -> UIConfigurationColorTransformer;
205
206        #[cfg(all(
207            feature = "UIColor",
208            feature = "UIConfigurationColorTransformer",
209            feature = "block2"
210        ))]
211        /// Setter for [`strokeColorTransformer`][Self::strokeColorTransformer].
212        #[unsafe(method(setStrokeColorTransformer:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn setStrokeColorTransformer(
215            &self,
216            stroke_color_transformer: UIConfigurationColorTransformer,
217        );
218
219        #[cfg(feature = "UIColor")]
220        /// Returns the resolved stroke color for the specified tint color, based on the `strokeColor` and `strokeColorTransformer`.
221        #[unsafe(method(resolvedStrokeColorForTintColor:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn resolvedStrokeColorForTintColor(
224            &self,
225            tint_color: &UIColor,
226        ) -> Retained<UIColor>;
227    );
228}
229
230/// Methods declared on superclass `NSObject`.
231impl UIListContentImageProperties {
232    extern_methods!(
233        #[unsafe(method(init))]
234        #[unsafe(method_family = init)]
235        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
236
237        #[unsafe(method(new))]
238        #[unsafe(method_family = new)]
239        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
240    );
241}
242
243extern "C" {
244    /// A special constant that can be set to the `reservedLayoutSize` width or height. This
245    /// forces the system standard value that a symbol image would use for that dimension,
246    /// even when the image is not a symbol image.
247    ///
248    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistcontentimagestandarddimension?language=objc)
249    #[cfg(feature = "objc2-core-foundation")]
250    pub static UIListContentImageStandardDimension: CGFloat;
251}