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