objc2_ui_kit/generated/
UIListContentConfiguration.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#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistcontentconfiguration?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct UIListContentConfiguration;
21);
22
23unsafe impl NSCoding for UIListContentConfiguration {}
24
25unsafe impl NSCopying for UIListContentConfiguration {}
26
27unsafe impl CopyingHelper for UIListContentConfiguration {
28    type Result = Self;
29}
30
31unsafe impl NSObjectProtocol for UIListContentConfiguration {}
32
33unsafe impl NSSecureCoding for UIListContentConfiguration {}
34
35#[cfg(feature = "UIContentConfiguration")]
36unsafe impl UIContentConfiguration for UIListContentConfiguration {}
37
38impl UIListContentConfiguration {
39    extern_methods!(
40        /// Returns the default configuration for a list cell.
41        /// From iOS 18 onwards, the configuration will automatically adopt the appropriate style for a list when updating for a
42        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
43        /// Defaults to a cell in a plain-style list.
44        #[unsafe(method(cellConfiguration))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn cellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
47
48        /// Returns the default configuration for a list cell with subtitle text.
49        /// From iOS 18 onwards, the configuration will automatically adopt the appropriate style for a list when updating for a
50        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
51        /// Defaults to a subtitle cell in a plain-style list.
52        #[unsafe(method(subtitleCellConfiguration))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn subtitleCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
55
56        /// Returns the default configuration for a list cell with side-by-side value text.
57        /// From iOS 18 onwards, the configuration will automatically adopt the appropriate style for a list when updating for a
58        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
59        /// Defaults to the appearance of a value cell in a plain-style list.
60        #[unsafe(method(valueCellConfiguration))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn valueCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
63
64        /// Represents a generic header configuration that automatically adopts the style of a containing list when updating for a
65        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
66        /// Defaults to the header configuration for a plain-style list.
67        #[unsafe(method(headerConfiguration))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn headerConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
70
71        /// Represents a generic footer configuration that automatically adopts the style of a containing list when updating for a
72        /// new configuration state, by reading the `listEnvironment` trait from the state's trait collection.
73        /// Defaults to the footer configuration for a plain-style list.
74        #[unsafe(method(footerConfiguration))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn footerConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
77
78        /// Returns the default configuration for a prominent inset grouped list header.
79        #[unsafe(method(prominentInsetGroupedHeaderConfiguration))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn prominentInsetGroupedHeaderConfiguration(
82            mtm: MainThreadMarker,
83        ) -> Retained<Self>;
84
85        /// Returns the default configuration for an extra prominent inset grouped list header.
86        #[unsafe(method(extraProminentInsetGroupedHeaderConfiguration))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn extraProminentInsetGroupedHeaderConfiguration(
89            mtm: MainThreadMarker,
90        ) -> Retained<Self>;
91
92        /// Returns the default configuration for an accompanied sidebar list cell.
93        #[unsafe(method(accompaniedSidebarCellConfiguration))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn accompaniedSidebarCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
96
97        /// Returns the default configuration for an accompanied sidebar list cell with subtitle text.
98        #[unsafe(method(accompaniedSidebarSubtitleCellConfiguration))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn accompaniedSidebarSubtitleCellConfiguration(
101            mtm: MainThreadMarker,
102        ) -> Retained<Self>;
103
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
107
108        #[unsafe(method(init))]
109        #[unsafe(method_family = init)]
110        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
111
112        #[cfg(feature = "UIImage")]
113        /// The image to display.
114        #[unsafe(method(image))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
117
118        #[cfg(feature = "UIImage")]
119        /// Setter for [`image`][Self::image].
120        #[unsafe(method(setImage:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn setImage(&self, image: Option<&UIImage>);
123
124        #[cfg(feature = "UIListContentImageProperties")]
125        /// Additional properties to configure the image.
126        #[unsafe(method(imageProperties))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn imageProperties(&self) -> Retained<UIListContentImageProperties>;
129
130        /// The primary text.
131        #[unsafe(method(text))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn text(&self) -> Option<Retained<NSString>>;
134
135        /// Setter for [`text`][Self::text].
136        #[unsafe(method(setText:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setText(&self, text: Option<&NSString>);
139
140        /// An attributed variant of the primary text, which supersedes the `text` and some properties of the `textProperties` if set.
141        #[unsafe(method(attributedText))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn attributedText(&self) -> Option<Retained<NSAttributedString>>;
144
145        /// Setter for [`attributedText`][Self::attributedText].
146        #[unsafe(method(setAttributedText:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
149
150        #[cfg(feature = "UIListContentTextProperties")]
151        /// Additional properties to configure the primary text.
152        #[unsafe(method(textProperties))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn textProperties(&self) -> Retained<UIListContentTextProperties>;
155
156        /// The secondary text.
157        #[unsafe(method(secondaryText))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn secondaryText(&self) -> Option<Retained<NSString>>;
160
161        /// Setter for [`secondaryText`][Self::secondaryText].
162        #[unsafe(method(setSecondaryText:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setSecondaryText(&self, secondary_text: Option<&NSString>);
165
166        /// An attributed variant of the secondary text, which supersedes the `secondaryText` and some properties of the `secondaryTextProperties` if set.
167        #[unsafe(method(secondaryAttributedText))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn secondaryAttributedText(&self) -> Option<Retained<NSAttributedString>>;
170
171        /// Setter for [`secondaryAttributedText`][Self::secondaryAttributedText].
172        #[unsafe(method(setSecondaryAttributedText:))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn setSecondaryAttributedText(
175            &self,
176            secondary_attributed_text: Option<&NSAttributedString>,
177        );
178
179        #[cfg(feature = "UIListContentTextProperties")]
180        /// Additional properties to configure the secondary text.
181        #[unsafe(method(secondaryTextProperties))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn secondaryTextProperties(&self) -> Retained<UIListContentTextProperties>;
184
185        #[cfg(feature = "UIGeometry")]
186        /// Whether the content view will preserve inherited layout margins from its superview on the horizontal and/or vertical axes.
187        #[unsafe(method(axesPreservingSuperviewLayoutMargins))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn axesPreservingSuperviewLayoutMargins(&self) -> UIAxis;
190
191        #[cfg(feature = "UIGeometry")]
192        /// Setter for [`axesPreservingSuperviewLayoutMargins`][Self::axesPreservingSuperviewLayoutMargins].
193        #[unsafe(method(setAxesPreservingSuperviewLayoutMargins:))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn setAxesPreservingSuperviewLayoutMargins(
196            &self,
197            axes_preserving_superview_layout_margins: UIAxis,
198        );
199
200        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
201        /// The margins for the content to the edges of the content view. (When preserving superview layout margins on one or both axes, these are just minimum margins, as inherited margins may be larger.)
202        #[unsafe(method(directionalLayoutMargins))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets;
205
206        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
207        /// Setter for [`directionalLayoutMargins`][Self::directionalLayoutMargins].
208        #[unsafe(method(setDirectionalLayoutMargins:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn setDirectionalLayoutMargins(
211            &self,
212            directional_layout_margins: NSDirectionalEdgeInsets,
213        );
214
215        /// When YES, the text and secondary text will be positioned side-by-side if there is sufficient space. Otherwise, the text will be stacked in a vertical layout.
216        #[unsafe(method(prefersSideBySideTextAndSecondaryText))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn prefersSideBySideTextAndSecondaryText(&self) -> bool;
219
220        /// Setter for [`prefersSideBySideTextAndSecondaryText`][Self::prefersSideBySideTextAndSecondaryText].
221        #[unsafe(method(setPrefersSideBySideTextAndSecondaryText:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn setPrefersSideBySideTextAndSecondaryText(
224            &self,
225            prefers_side_by_side_text_and_secondary_text: bool,
226        );
227
228        #[cfg(feature = "objc2-core-foundation")]
229        /// Padding between the image and text. Only applies when there is both an image and text.
230        #[unsafe(method(imageToTextPadding))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn imageToTextPadding(&self) -> CGFloat;
233
234        #[cfg(feature = "objc2-core-foundation")]
235        /// Setter for [`imageToTextPadding`][Self::imageToTextPadding].
236        #[unsafe(method(setImageToTextPadding:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setImageToTextPadding(&self, image_to_text_padding: CGFloat);
239
240        #[cfg(feature = "objc2-core-foundation")]
241        /// Horizontal (minimum) padding between the text and secondary text. Only applies when there is both text and secondary text, and they are in a side-by-side layout.
242        #[unsafe(method(textToSecondaryTextHorizontalPadding))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn textToSecondaryTextHorizontalPadding(&self) -> CGFloat;
245
246        #[cfg(feature = "objc2-core-foundation")]
247        /// Setter for [`textToSecondaryTextHorizontalPadding`][Self::textToSecondaryTextHorizontalPadding].
248        #[unsafe(method(setTextToSecondaryTextHorizontalPadding:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setTextToSecondaryTextHorizontalPadding(
251            &self,
252            text_to_secondary_text_horizontal_padding: CGFloat,
253        );
254
255        #[cfg(feature = "objc2-core-foundation")]
256        /// Vertical padding between the text and secondary text. Only applies when there is both text and secondary text, and they are in a stacked layout.
257        #[unsafe(method(textToSecondaryTextVerticalPadding))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn textToSecondaryTextVerticalPadding(&self) -> CGFloat;
260
261        #[cfg(feature = "objc2-core-foundation")]
262        /// Setter for [`textToSecondaryTextVerticalPadding`][Self::textToSecondaryTextVerticalPadding].
263        #[unsafe(method(setTextToSecondaryTextVerticalPadding:))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn setTextToSecondaryTextVerticalPadding(
266            &self,
267            text_to_secondary_text_vertical_padding: CGFloat,
268        );
269
270        #[cfg(feature = "objc2-core-foundation")]
271        /// The alpha to apply to the entire content view. Defaults to 1.0.
272        #[unsafe(method(alpha))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn alpha(&self) -> CGFloat;
275
276        #[cfg(feature = "objc2-core-foundation")]
277        /// Setter for [`alpha`][Self::alpha].
278        #[unsafe(method(setAlpha:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setAlpha(&self, alpha: CGFloat);
281
282        /// Returns the default configuration for a sidebar list cell.
283        #[deprecated]
284        #[unsafe(method(sidebarCellConfiguration))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn sidebarCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
287
288        /// Returns the default configuration for a sidebar list cell with subtitle text.
289        #[deprecated]
290        #[unsafe(method(sidebarSubtitleCellConfiguration))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn sidebarSubtitleCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
293
294        /// Returns the default configuration for a plain list header.
295        #[deprecated]
296        #[unsafe(method(plainHeaderConfiguration))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn plainHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
299
300        /// Returns the default configuration for a plain list footer.
301        #[deprecated]
302        #[unsafe(method(plainFooterConfiguration))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn plainFooterConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
305
306        /// Returns the default configuration for a grouped list header.
307        #[deprecated]
308        #[unsafe(method(groupedHeaderConfiguration))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn groupedHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
311
312        /// Returns the default configuration for a grouped list footer.
313        #[deprecated]
314        #[unsafe(method(groupedFooterConfiguration))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn groupedFooterConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
317
318        /// Returns the default configuration for a sidebar list header.
319        #[deprecated]
320        #[unsafe(method(sidebarHeaderConfiguration))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn sidebarHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
323    );
324}
325
326extern_class!(
327    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilistcontentview?language=objc)
328    #[unsafe(super(UIView, UIResponder, NSObject))]
329    #[thread_kind = MainThreadOnly]
330    #[derive(Debug, PartialEq, Eq, Hash)]
331    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
332    pub struct UIListContentView;
333);
334
335#[cfg(all(
336    feature = "UIResponder",
337    feature = "UIView",
338    feature = "objc2-quartz-core"
339))]
340#[cfg(not(target_os = "watchos"))]
341unsafe impl CALayerDelegate for UIListContentView {}
342
343#[cfg(all(feature = "UIResponder", feature = "UIView"))]
344unsafe impl NSCoding for UIListContentView {}
345
346#[cfg(all(feature = "UIResponder", feature = "UIView"))]
347unsafe impl NSObjectProtocol for UIListContentView {}
348
349#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
350unsafe impl UIAppearance for UIListContentView {}
351
352#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
353unsafe impl UIAppearanceContainer for UIListContentView {}
354
355#[cfg(all(
356    feature = "UIContentConfiguration",
357    feature = "UIResponder",
358    feature = "UIView"
359))]
360unsafe impl UIContentView for UIListContentView {}
361
362#[cfg(all(feature = "UIResponder", feature = "UIView"))]
363unsafe impl UICoordinateSpace for UIListContentView {}
364
365#[cfg(all(
366    feature = "UIDynamicBehavior",
367    feature = "UIResponder",
368    feature = "UIView"
369))]
370unsafe impl UIDynamicItem for UIListContentView {}
371
372#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
373unsafe impl UIFocusEnvironment for UIListContentView {}
374
375#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
376unsafe impl UIFocusItem for UIListContentView {}
377
378#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
379unsafe impl UIFocusItemContainer for UIListContentView {}
380
381#[cfg(all(feature = "UIResponder", feature = "UIView"))]
382unsafe impl UIResponderStandardEditActions for UIListContentView {}
383
384#[cfg(all(
385    feature = "UIResponder",
386    feature = "UITraitCollection",
387    feature = "UIView"
388))]
389unsafe impl UITraitEnvironment for UIListContentView {}
390
391#[cfg(all(feature = "UIResponder", feature = "UIView"))]
392impl UIListContentView {
393    extern_methods!(
394        #[unsafe(method(initWithConfiguration:))]
395        #[unsafe(method_family = init)]
396        pub unsafe fn initWithConfiguration(
397            this: Allocated<Self>,
398            configuration: &UIListContentConfiguration,
399        ) -> Retained<Self>;
400
401        #[unsafe(method(initWithCoder:))]
402        #[unsafe(method_family = init)]
403        pub unsafe fn initWithCoder(
404            this: Allocated<Self>,
405            coder: &NSCoder,
406        ) -> Option<Retained<Self>>;
407
408        #[cfg(feature = "objc2-core-foundation")]
409        #[unsafe(method(initWithFrame:))]
410        #[unsafe(method_family = init)]
411        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
412
413        #[unsafe(method(init))]
414        #[unsafe(method_family = init)]
415        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
416
417        #[unsafe(method(new))]
418        #[unsafe(method_family = new)]
419        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
420
421        #[unsafe(method(configuration))]
422        #[unsafe(method_family = none)]
423        pub unsafe fn configuration(&self) -> Retained<UIListContentConfiguration>;
424
425        /// Setter for [`configuration`][Self::configuration].
426        #[unsafe(method(setConfiguration:))]
427        #[unsafe(method_family = none)]
428        pub unsafe fn setConfiguration(&self, configuration: &UIListContentConfiguration);
429
430        #[cfg(feature = "UILayoutGuide")]
431        /// This guide reflects the positioning of the primary text rendered by this content view, if specified by the configuration.
432        ///
433        /// Returns nil if there is no primary text. If a new configuration is applied that does not contain primary text, then this layout
434        /// guide is removed from the view, and any constraints associated with it will be deactivated.
435        #[unsafe(method(textLayoutGuide))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn textLayoutGuide(&self) -> Option<Retained<UILayoutGuide>>;
438
439        #[cfg(feature = "UILayoutGuide")]
440        /// This guide reflects the positioning of the secondary text rendered by this content view, if specified by the configuration.
441        ///
442        /// Returns nil if there is no secondary text. If a new configuration is applied that does not contain secondary text, then this layout
443        /// guide is removed from the view, and any constraints associated with it will be deactivated.
444        #[unsafe(method(secondaryTextLayoutGuide))]
445        #[unsafe(method_family = none)]
446        pub unsafe fn secondaryTextLayoutGuide(&self) -> Option<Retained<UILayoutGuide>>;
447
448        #[cfg(feature = "UILayoutGuide")]
449        /// This guide reflects the positioning of the image rendered by this content view, if specified by the configuration.
450        ///
451        /// Returns nil if there is no image. If a new configuration is applied that does contain an image, then this layout
452        /// guide is removed from the view, and any constraints associated with it will be deactivated.
453        #[unsafe(method(imageLayoutGuide))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn imageLayoutGuide(&self) -> Option<Retained<UILayoutGuide>>;
456    );
457}