objc2_ui_kit/generated/
UIContentUnavailableConfiguration.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
12/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentunavailablealignment?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIContentUnavailableAlignment(pub NSInteger);
17impl UIContentUnavailableAlignment {
18    #[doc(alias = "UIContentUnavailableAlignmentCenter")]
19    pub const Center: Self = Self(0);
20    #[doc(alias = "UIContentUnavailableAlignmentNatural")]
21    pub const Natural: Self = Self(1);
22}
23
24unsafe impl Encode for UIContentUnavailableAlignment {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for UIContentUnavailableAlignment {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentunavailableconfiguration?language=objc)
34    #[unsafe(super(NSObject))]
35    #[thread_kind = MainThreadOnly]
36    #[derive(Debug, PartialEq, Eq, Hash)]
37    pub struct UIContentUnavailableConfiguration;
38);
39
40extern_conformance!(
41    unsafe impl NSCoding for UIContentUnavailableConfiguration {}
42);
43
44extern_conformance!(
45    unsafe impl NSCopying for UIContentUnavailableConfiguration {}
46);
47
48unsafe impl CopyingHelper for UIContentUnavailableConfiguration {
49    type Result = Self;
50}
51
52extern_conformance!(
53    unsafe impl NSObjectProtocol for UIContentUnavailableConfiguration {}
54);
55
56extern_conformance!(
57    unsafe impl NSSecureCoding for UIContentUnavailableConfiguration {}
58);
59
60#[cfg(feature = "UIContentConfiguration")]
61extern_conformance!(
62    unsafe impl UIContentConfiguration for UIContentUnavailableConfiguration {}
63);
64
65impl UIContentUnavailableConfiguration {
66    extern_methods!(
67        /// Returns the default configuration for unavailable content.
68        #[unsafe(method(emptyConfiguration))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn emptyConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
71
72        /// Returns the default configuration for content which is loading.
73        #[unsafe(method(loadingConfiguration))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn loadingConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
76
77        /// Returns the default configuration for searches which return no results.
78        #[unsafe(method(searchConfiguration))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn searchConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
81
82        #[unsafe(method(new))]
83        #[unsafe(method_family = new)]
84        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
85
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[cfg(feature = "UIImage")]
91        /// The image to display.
92        #[unsafe(method(image))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
95
96        #[cfg(feature = "UIImage")]
97        /// Setter for [`image`][Self::image].
98        #[unsafe(method(setImage:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setImage(&self, image: Option<&UIImage>);
101
102        #[cfg(feature = "UIContentUnavailableImageProperties")]
103        /// Additional properties to configure the image. When adopting the loading configuration, relevant properties are applied to the activity indicator.
104        #[unsafe(method(imageProperties))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn imageProperties(&self) -> Retained<UIContentUnavailableImageProperties>;
107
108        /// The primary text.
109        #[unsafe(method(text))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn text(&self) -> Option<Retained<NSString>>;
112
113        /// Setter for [`text`][Self::text].
114        #[unsafe(method(setText:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn setText(&self, text: Option<&NSString>);
117
118        /// An attributed variant of the primary text, which supersedes the `text` and some properties of the `textProperties` if set.
119        #[unsafe(method(attributedText))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn attributedText(&self) -> Option<Retained<NSAttributedString>>;
122
123        /// Setter for [`attributedText`][Self::attributedText].
124        #[unsafe(method(setAttributedText:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
127
128        #[cfg(feature = "UIContentUnavailableTextProperties")]
129        /// Additional properties to configure the primary text.
130        #[unsafe(method(textProperties))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn textProperties(&self) -> Retained<UIContentUnavailableTextProperties>;
133
134        /// The secondary text.
135        #[unsafe(method(secondaryText))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn secondaryText(&self) -> Option<Retained<NSString>>;
138
139        /// Setter for [`secondaryText`][Self::secondaryText].
140        #[unsafe(method(setSecondaryText:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setSecondaryText(&self, secondary_text: Option<&NSString>);
143
144        /// An attributed variant of the secondary text, which supersedes the `secondaryText` and some properties of the `secondaryTextProperties` if set.
145        #[unsafe(method(secondaryAttributedText))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn secondaryAttributedText(&self) -> Option<Retained<NSAttributedString>>;
148
149        /// Setter for [`secondaryAttributedText`][Self::secondaryAttributedText].
150        #[unsafe(method(setSecondaryAttributedText:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setSecondaryAttributedText(
153            &self,
154            secondary_attributed_text: Option<&NSAttributedString>,
155        );
156
157        #[cfg(feature = "UIContentUnavailableTextProperties")]
158        /// Additional properties to configure the secondary text.
159        #[unsafe(method(secondaryTextProperties))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn secondaryTextProperties(
162            &self,
163        ) -> Retained<UIContentUnavailableTextProperties>;
164
165        #[cfg(feature = "UIButtonConfiguration")]
166        /// The primary button.
167        #[unsafe(method(button))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn button(&self) -> Retained<UIButtonConfiguration>;
170
171        #[cfg(feature = "UIButtonConfiguration")]
172        /// Setter for [`button`][Self::button].
173        #[unsafe(method(setButton:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setButton(&self, button: &UIButtonConfiguration);
176
177        #[cfg(feature = "UIContentUnavailableButtonProperties")]
178        /// Additional properties to configure the primary button.
179        #[unsafe(method(buttonProperties))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn buttonProperties(&self) -> Retained<UIContentUnavailableButtonProperties>;
182
183        #[cfg(feature = "UIButtonConfiguration")]
184        /// The secondary button.
185        #[unsafe(method(secondaryButton))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn secondaryButton(&self) -> Retained<UIButtonConfiguration>;
188
189        #[cfg(feature = "UIButtonConfiguration")]
190        /// Setter for [`secondaryButton`][Self::secondaryButton].
191        #[unsafe(method(setSecondaryButton:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn setSecondaryButton(&self, secondary_button: &UIButtonConfiguration);
194
195        #[cfg(feature = "UIContentUnavailableButtonProperties")]
196        /// Additional properties to configure the secondary button.
197        #[unsafe(method(secondaryButtonProperties))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn secondaryButtonProperties(
200            &self,
201        ) -> Retained<UIContentUnavailableButtonProperties>;
202
203        /// The alignment of the image, text and buttons.
204        #[unsafe(method(alignment))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn alignment(&self) -> UIContentUnavailableAlignment;
207
208        /// Setter for [`alignment`][Self::alignment].
209        #[unsafe(method(setAlignment:))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn setAlignment(&self, alignment: UIContentUnavailableAlignment);
212
213        #[cfg(feature = "UIGeometry")]
214        /// Whether the content view will preserve inherited layout margins from its superview on the horizontal and/or vertical axes.
215        #[unsafe(method(axesPreservingSuperviewLayoutMargins))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn axesPreservingSuperviewLayoutMargins(&self) -> UIAxis;
218
219        #[cfg(feature = "UIGeometry")]
220        /// Setter for [`axesPreservingSuperviewLayoutMargins`][Self::axesPreservingSuperviewLayoutMargins].
221        #[unsafe(method(setAxesPreservingSuperviewLayoutMargins:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn setAxesPreservingSuperviewLayoutMargins(
224            &self,
225            axes_preserving_superview_layout_margins: UIAxis,
226        );
227
228        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
229        /// 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.)
230        #[unsafe(method(directionalLayoutMargins))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets;
233
234        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
235        /// Setter for [`directionalLayoutMargins`][Self::directionalLayoutMargins].
236        #[unsafe(method(setDirectionalLayoutMargins:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setDirectionalLayoutMargins(
239            &self,
240            directional_layout_margins: NSDirectionalEdgeInsets,
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 unsafe 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 unsafe fn setImageToTextPadding(&self, image_to_text_padding: CGFloat);
254
255        #[cfg(feature = "objc2-core-foundation")]
256        /// Padding between the text and secondary text. Only applies when there is both text and secondary text.
257        #[unsafe(method(textToSecondaryTextPadding))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn textToSecondaryTextPadding(&self) -> CGFloat;
260
261        #[cfg(feature = "objc2-core-foundation")]
262        /// Setter for [`textToSecondaryTextPadding`][Self::textToSecondaryTextPadding].
263        #[unsafe(method(setTextToSecondaryTextPadding:))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn setTextToSecondaryTextPadding(&self, text_to_secondary_text_padding: CGFloat);
266
267        #[cfg(feature = "objc2-core-foundation")]
268        /// Padding between the button and text. Only applies when there is both a button and text.
269        #[unsafe(method(textToButtonPadding))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn textToButtonPadding(&self) -> CGFloat;
272
273        #[cfg(feature = "objc2-core-foundation")]
274        /// Setter for [`textToButtonPadding`][Self::textToButtonPadding].
275        #[unsafe(method(setTextToButtonPadding:))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn setTextToButtonPadding(&self, text_to_button_padding: CGFloat);
278
279        #[cfg(feature = "objc2-core-foundation")]
280        /// Padding between the button and secondary button. Only applies when there is both a button and a secondary button.
281        #[unsafe(method(buttonToSecondaryButtonPadding))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn buttonToSecondaryButtonPadding(&self) -> CGFloat;
284
285        #[cfg(feature = "objc2-core-foundation")]
286        /// Setter for [`buttonToSecondaryButtonPadding`][Self::buttonToSecondaryButtonPadding].
287        #[unsafe(method(setButtonToSecondaryButtonPadding:))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn setButtonToSecondaryButtonPadding(
290            &self,
291            button_to_secondary_button_padding: CGFloat,
292        );
293
294        #[cfg(feature = "UIBackgroundConfiguration")]
295        /// The background configuration.
296        #[unsafe(method(background))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn background(&self) -> Retained<UIBackgroundConfiguration>;
299
300        #[cfg(feature = "UIBackgroundConfiguration")]
301        /// Setter for [`background`][Self::background].
302        #[unsafe(method(setBackground:))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn setBackground(&self, background: &UIBackgroundConfiguration);
305    );
306}