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