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