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