objc2_ui_kit/generated/
UIBackgroundConfiguration.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/uibackgroundconfiguration?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIBackgroundConfiguration;
18);
19
20extern_conformance!(
21    unsafe impl NSCoding for UIBackgroundConfiguration {}
22);
23
24extern_conformance!(
25    unsafe impl NSCopying for UIBackgroundConfiguration {}
26);
27
28unsafe impl CopyingHelper for UIBackgroundConfiguration {
29    type Result = Self;
30}
31
32extern_conformance!(
33    unsafe impl NSObjectProtocol for UIBackgroundConfiguration {}
34);
35
36extern_conformance!(
37    unsafe impl NSSecureCoding for UIBackgroundConfiguration {}
38);
39
40impl UIBackgroundConfiguration {
41    extern_methods!(
42        /// Returns a clear configuration, with no default styling.
43        #[unsafe(method(clearConfiguration))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn clearConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
46
47        /// Represents a generic cell background configuration that automatically adopts the style of a containing list when updated for a
48        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
49        /// Defaults to the background configuration for a cell in a plain-style list.
50        #[unsafe(method(listCellConfiguration))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn listCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
53
54        /// Represents a generic header background configuration that automatically adopts the style of a containing list when updated for a
55        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
56        /// Defaults to the background configuration for a header in a plain-style list.
57        #[unsafe(method(listHeaderConfiguration))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn listHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
60
61        /// Represents a generic footer background configuration that automatically adopts the style of a containing list when updated for a
62        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
63        /// Defaults to the background configuration for a footer in a plain-style list.
64        #[unsafe(method(listFooterConfiguration))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn listFooterConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
67
68        /// Returns the default configuration for an accompanied sidebar list cell.
69        #[unsafe(method(listAccompaniedSidebarCellConfiguration))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn listAccompaniedSidebarCellConfiguration(
72            mtm: MainThreadMarker,
73        ) -> Retained<Self>;
74
75        #[unsafe(method(new))]
76        #[unsafe(method_family = new)]
77        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
78
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[cfg(feature = "UIConfigurationState")]
84        /// Returns a copy of the configuration updated for the specified state, by applying the configuration's default values for that state to any properties that have not been customized.
85        #[unsafe(method(updatedConfigurationForState:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn updatedConfigurationForState(
88            &self,
89            state: &ProtocolObject<dyn UIConfigurationState>,
90        ) -> Retained<Self>;
91
92        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
93        /// A custom view for the background. The custom view must have translatesAutoresizingMaskIntoConstraints
94        /// enabled, but may use auto layout constraints internally for layout of subviews.
95        #[unsafe(method(customView))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn customView(&self) -> Option<Retained<UIView>>;
98
99        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
100        /// Setter for [`customView`][Self::customView].
101        #[unsafe(method(setCustomView:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setCustomView(&self, custom_view: Option<&UIView>);
104
105        #[cfg(feature = "objc2-core-foundation")]
106        /// The preferred corner radius (using a continuous corner curve) for the background and stroke. This is also applied to the custom view. Default is 0.
107        /// If the view is too small to fit the requested radius, the corner curve and radius will be adjusted to fit.
108        #[unsafe(method(cornerRadius))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn cornerRadius(&self) -> CGFloat;
111
112        #[cfg(feature = "objc2-core-foundation")]
113        /// Setter for [`cornerRadius`][Self::cornerRadius].
114        #[unsafe(method(setCornerRadius:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
117
118        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
119        /// Insets (or outsets, if negative) for the background and stroke, relative to the edges of the containing view. These also apply to the custom view. Default is NSDirectionalEdgeInsetsZero.
120        #[unsafe(method(backgroundInsets))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn backgroundInsets(&self) -> NSDirectionalEdgeInsets;
123
124        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
125        /// Setter for [`backgroundInsets`][Self::backgroundInsets].
126        #[unsafe(method(setBackgroundInsets:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setBackgroundInsets(&self, background_insets: NSDirectionalEdgeInsets);
129
130        #[cfg(feature = "UIGeometry")]
131        /// The edges on which the containing view's layout margins are added to the `backgroundInsets`, effectively making the `backgroundInsets` values relative
132        /// to the containing view's layout margins for these edges. Default is NSDirectionalRectEdgeNone.
133        #[unsafe(method(edgesAddingLayoutMarginsToBackgroundInsets))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn edgesAddingLayoutMarginsToBackgroundInsets(&self) -> NSDirectionalRectEdge;
136
137        #[cfg(feature = "UIGeometry")]
138        /// Setter for [`edgesAddingLayoutMarginsToBackgroundInsets`][Self::edgesAddingLayoutMarginsToBackgroundInsets].
139        #[unsafe(method(setEdgesAddingLayoutMarginsToBackgroundInsets:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setEdgesAddingLayoutMarginsToBackgroundInsets(
142            &self,
143            edges_adding_layout_margins_to_background_insets: NSDirectionalRectEdge,
144        );
145
146        #[cfg(feature = "UIColor")]
147        /// Configures the color of the background. A nil value uses the view's tint color; use `clearColor` for no color (transparent).
148        #[unsafe(method(backgroundColor))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
151
152        #[cfg(feature = "UIColor")]
153        /// Setter for [`backgroundColor`][Self::backgroundColor].
154        #[unsafe(method(setBackgroundColor:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
157
158        #[cfg(all(
159            feature = "UIColor",
160            feature = "UIConfigurationColorTransformer",
161            feature = "block2"
162        ))]
163        /// Optional color transformer that is used to resolve the background color. A nil value means the `backgroundColor` is used as-is.
164        #[unsafe(method(backgroundColorTransformer))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn backgroundColorTransformer(&self) -> UIConfigurationColorTransformer;
167
168        #[cfg(all(
169            feature = "UIColor",
170            feature = "UIConfigurationColorTransformer",
171            feature = "block2"
172        ))]
173        /// Setter for [`backgroundColorTransformer`][Self::backgroundColorTransformer].
174        #[unsafe(method(setBackgroundColorTransformer:))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn setBackgroundColorTransformer(
177            &self,
178            background_color_transformer: UIConfigurationColorTransformer,
179        );
180
181        #[cfg(feature = "UIColor")]
182        /// Returns the resolved background color for the specified tint color, based on the `backgroundColor` and `backgroundColorTransformer`.
183        #[unsafe(method(resolvedBackgroundColorForTintColor:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn resolvedBackgroundColorForTintColor(
186            &self,
187            tint_color: &UIColor,
188        ) -> Retained<UIColor>;
189
190        #[cfg(feature = "UIVisualEffect")]
191        /// The visual effect to apply to the background. Default is nil.
192        #[unsafe(method(visualEffect))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn visualEffect(&self) -> Option<Retained<UIVisualEffect>>;
195
196        #[cfg(feature = "UIVisualEffect")]
197        /// Setter for [`visualEffect`][Self::visualEffect].
198        #[unsafe(method(setVisualEffect:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn setVisualEffect(&self, visual_effect: Option<&UIVisualEffect>);
201
202        #[cfg(feature = "UIImage")]
203        /// The image to use. Default is nil.
204        #[unsafe(method(image))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
207
208        #[cfg(feature = "UIImage")]
209        /// Setter for [`image`][Self::image].
210        #[unsafe(method(setImage:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn setImage(&self, image: Option<&UIImage>);
213
214        #[cfg(feature = "UIView")]
215        /// The content mode to use when rendering the image. Default is UIViewContentModeScaleToFill.
216        #[unsafe(method(imageContentMode))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn imageContentMode(&self) -> UIViewContentMode;
219
220        #[cfg(feature = "UIView")]
221        /// Setter for [`imageContentMode`][Self::imageContentMode].
222        #[unsafe(method(setImageContentMode:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn setImageContentMode(&self, image_content_mode: UIViewContentMode);
225
226        #[cfg(feature = "UIColor")]
227        /// Configures the color of the stroke. A nil value uses the view's tint color; use `clearColor` for no color (transparent).
228        #[unsafe(method(strokeColor))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn strokeColor(&self) -> Option<Retained<UIColor>>;
231
232        #[cfg(feature = "UIColor")]
233        /// Setter for [`strokeColor`][Self::strokeColor].
234        #[unsafe(method(setStrokeColor:))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn setStrokeColor(&self, stroke_color: Option<&UIColor>);
237
238        #[cfg(all(
239            feature = "UIColor",
240            feature = "UIConfigurationColorTransformer",
241            feature = "block2"
242        ))]
243        /// Optional color transformer that is used to resolve the stroke color. A nil value means the `strokeColor` is used as-is.
244        #[unsafe(method(strokeColorTransformer))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn strokeColorTransformer(&self) -> UIConfigurationColorTransformer;
247
248        #[cfg(all(
249            feature = "UIColor",
250            feature = "UIConfigurationColorTransformer",
251            feature = "block2"
252        ))]
253        /// Setter for [`strokeColorTransformer`][Self::strokeColorTransformer].
254        #[unsafe(method(setStrokeColorTransformer:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn setStrokeColorTransformer(
257            &self,
258            stroke_color_transformer: UIConfigurationColorTransformer,
259        );
260
261        #[cfg(feature = "UIColor")]
262        /// Returns the resolved stroke color for the specified tint color, based on the `strokeColor` and `strokeColorTransformer`.
263        #[unsafe(method(resolvedStrokeColorForTintColor:))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn resolvedStrokeColorForTintColor(
266            &self,
267            tint_color: &UIColor,
268        ) -> Retained<UIColor>;
269
270        #[cfg(feature = "objc2-core-foundation")]
271        /// The width of the stroke. Default is 0.
272        #[unsafe(method(strokeWidth))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn strokeWidth(&self) -> CGFloat;
275
276        #[cfg(feature = "objc2-core-foundation")]
277        /// Setter for [`strokeWidth`][Self::strokeWidth].
278        #[unsafe(method(setStrokeWidth:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setStrokeWidth(&self, stroke_width: CGFloat);
281
282        #[cfg(feature = "objc2-core-foundation")]
283        /// Outset (or inset, if negative) for the stroke, relative to the background (including any backgroundInsets). Default is 0.
284        /// The corner radius of the stroke is adjusted for any outset to remain concentric with the background.
285        #[unsafe(method(strokeOutset))]
286        #[unsafe(method_family = none)]
287        pub unsafe fn strokeOutset(&self) -> CGFloat;
288
289        #[cfg(feature = "objc2-core-foundation")]
290        /// Setter for [`strokeOutset`][Self::strokeOutset].
291        #[unsafe(method(setStrokeOutset:))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn setStrokeOutset(&self, stroke_outset: CGFloat);
294
295        #[cfg(feature = "UIShadowProperties")]
296        /// Describes a shadow applied by the background.
297        /// Defaults to no shadow (i.e. a shadow with an opacity of 0.0).
298        #[unsafe(method(shadowProperties))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn shadowProperties(&self) -> Retained<UIShadowProperties>;
301
302        /// Returns the default configuration for a plain list cell.
303        #[deprecated]
304        #[unsafe(method(listPlainCellConfiguration))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn listPlainCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
307
308        /// Returns the default configuration for a grouped list cell.
309        #[deprecated]
310        #[unsafe(method(listGroupedCellConfiguration))]
311        #[unsafe(method_family = none)]
312        pub unsafe fn listGroupedCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
313
314        /// Returns the default configuration for a sidebar list cell.
315        #[deprecated]
316        #[unsafe(method(listSidebarCellConfiguration))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn listSidebarCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
319
320        /// Returns the default configuration for a plain list header or footer.
321        #[deprecated = "Use +listHeaderConfiguration or +listFooterConfiguration"]
322        #[unsafe(method(listPlainHeaderFooterConfiguration))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn listPlainHeaderFooterConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
325
326        /// Returns the default configuration for a grouped list header or footer.
327        #[deprecated = "Use +listHeaderConfiguration or +listFooterConfiguration"]
328        #[unsafe(method(listGroupedHeaderFooterConfiguration))]
329        #[unsafe(method_family = none)]
330        pub unsafe fn listGroupedHeaderFooterConfiguration(mtm: MainThreadMarker)
331            -> Retained<Self>;
332
333        /// Returns the default configuration for a sidebar list header.
334        #[deprecated = "Use +listHeaderConfiguration or +listFooterConfiguration"]
335        #[unsafe(method(listSidebarHeaderConfiguration))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn listSidebarHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
338    );
339}