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 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 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 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 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 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 fn imageProperties(&self) -> Retained<UIContentUnavailableImageProperties>;
107
108        /// The primary text.
109        #[unsafe(method(text))]
110        #[unsafe(method_family = none)]
111        pub fn text(&self) -> Option<Retained<NSString>>;
112
113        /// Setter for [`text`][Self::text].
114        ///
115        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
116        #[unsafe(method(setText:))]
117        #[unsafe(method_family = none)]
118        pub fn setText(&self, text: Option<&NSString>);
119
120        /// An attributed variant of the primary text, which supersedes the `text` and some properties of the `textProperties` if set.
121        #[unsafe(method(attributedText))]
122        #[unsafe(method_family = none)]
123        pub fn attributedText(&self) -> Option<Retained<NSAttributedString>>;
124
125        /// Setter for [`attributedText`][Self::attributedText].
126        ///
127        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
128        #[unsafe(method(setAttributedText:))]
129        #[unsafe(method_family = none)]
130        pub fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
131
132        #[cfg(feature = "UIContentUnavailableTextProperties")]
133        /// Additional properties to configure the primary text.
134        #[unsafe(method(textProperties))]
135        #[unsafe(method_family = none)]
136        pub fn textProperties(&self) -> Retained<UIContentUnavailableTextProperties>;
137
138        /// The secondary text.
139        #[unsafe(method(secondaryText))]
140        #[unsafe(method_family = none)]
141        pub fn secondaryText(&self) -> Option<Retained<NSString>>;
142
143        /// Setter for [`secondaryText`][Self::secondaryText].
144        ///
145        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
146        #[unsafe(method(setSecondaryText:))]
147        #[unsafe(method_family = none)]
148        pub fn setSecondaryText(&self, secondary_text: Option<&NSString>);
149
150        /// An attributed variant of the secondary text, which supersedes the `secondaryText` and some properties of the `secondaryTextProperties` if set.
151        #[unsafe(method(secondaryAttributedText))]
152        #[unsafe(method_family = none)]
153        pub fn secondaryAttributedText(&self) -> Option<Retained<NSAttributedString>>;
154
155        /// Setter for [`secondaryAttributedText`][Self::secondaryAttributedText].
156        ///
157        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
158        #[unsafe(method(setSecondaryAttributedText:))]
159        #[unsafe(method_family = none)]
160        pub fn setSecondaryAttributedText(
161            &self,
162            secondary_attributed_text: Option<&NSAttributedString>,
163        );
164
165        #[cfg(feature = "UIContentUnavailableTextProperties")]
166        /// Additional properties to configure the secondary text.
167        #[unsafe(method(secondaryTextProperties))]
168        #[unsafe(method_family = none)]
169        pub fn secondaryTextProperties(&self) -> Retained<UIContentUnavailableTextProperties>;
170
171        #[cfg(feature = "UIButtonConfiguration")]
172        /// The primary button.
173        #[unsafe(method(button))]
174        #[unsafe(method_family = none)]
175        pub fn button(&self) -> Retained<UIButtonConfiguration>;
176
177        #[cfg(feature = "UIButtonConfiguration")]
178        /// Setter for [`button`][Self::button].
179        #[unsafe(method(setButton:))]
180        #[unsafe(method_family = none)]
181        pub fn setButton(&self, button: &UIButtonConfiguration);
182
183        #[cfg(feature = "UIContentUnavailableButtonProperties")]
184        /// Additional properties to configure the primary button.
185        #[unsafe(method(buttonProperties))]
186        #[unsafe(method_family = none)]
187        pub fn buttonProperties(&self) -> Retained<UIContentUnavailableButtonProperties>;
188
189        #[cfg(feature = "UIButtonConfiguration")]
190        /// The secondary button.
191        #[unsafe(method(secondaryButton))]
192        #[unsafe(method_family = none)]
193        pub fn secondaryButton(&self) -> Retained<UIButtonConfiguration>;
194
195        #[cfg(feature = "UIButtonConfiguration")]
196        /// Setter for [`secondaryButton`][Self::secondaryButton].
197        #[unsafe(method(setSecondaryButton:))]
198        #[unsafe(method_family = none)]
199        pub fn setSecondaryButton(&self, secondary_button: &UIButtonConfiguration);
200
201        #[cfg(feature = "UIContentUnavailableButtonProperties")]
202        /// Additional properties to configure the secondary button.
203        #[unsafe(method(secondaryButtonProperties))]
204        #[unsafe(method_family = none)]
205        pub fn secondaryButtonProperties(&self) -> Retained<UIContentUnavailableButtonProperties>;
206
207        /// The alignment of the image, text and buttons.
208        #[unsafe(method(alignment))]
209        #[unsafe(method_family = none)]
210        pub fn alignment(&self) -> UIContentUnavailableAlignment;
211
212        /// Setter for [`alignment`][Self::alignment].
213        #[unsafe(method(setAlignment:))]
214        #[unsafe(method_family = none)]
215        pub fn setAlignment(&self, alignment: UIContentUnavailableAlignment);
216
217        #[cfg(feature = "UIGeometry")]
218        /// Whether the content view will preserve inherited layout margins from its superview on the horizontal and/or vertical axes.
219        #[unsafe(method(axesPreservingSuperviewLayoutMargins))]
220        #[unsafe(method_family = none)]
221        pub fn axesPreservingSuperviewLayoutMargins(&self) -> UIAxis;
222
223        #[cfg(feature = "UIGeometry")]
224        /// Setter for [`axesPreservingSuperviewLayoutMargins`][Self::axesPreservingSuperviewLayoutMargins].
225        #[unsafe(method(setAxesPreservingSuperviewLayoutMargins:))]
226        #[unsafe(method_family = none)]
227        pub fn setAxesPreservingSuperviewLayoutMargins(
228            &self,
229            axes_preserving_superview_layout_margins: UIAxis,
230        );
231
232        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
233        /// 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.)
234        #[unsafe(method(directionalLayoutMargins))]
235        #[unsafe(method_family = none)]
236        pub fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets;
237
238        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
239        /// Setter for [`directionalLayoutMargins`][Self::directionalLayoutMargins].
240        #[unsafe(method(setDirectionalLayoutMargins:))]
241        #[unsafe(method_family = none)]
242        pub fn setDirectionalLayoutMargins(
243            &self,
244            directional_layout_margins: NSDirectionalEdgeInsets,
245        );
246
247        #[cfg(feature = "objc2-core-foundation")]
248        /// Padding between the image and text. Only applies when there is both an image and text.
249        #[unsafe(method(imageToTextPadding))]
250        #[unsafe(method_family = none)]
251        pub fn imageToTextPadding(&self) -> CGFloat;
252
253        #[cfg(feature = "objc2-core-foundation")]
254        /// Setter for [`imageToTextPadding`][Self::imageToTextPadding].
255        #[unsafe(method(setImageToTextPadding:))]
256        #[unsafe(method_family = none)]
257        pub fn setImageToTextPadding(&self, image_to_text_padding: CGFloat);
258
259        #[cfg(feature = "objc2-core-foundation")]
260        /// Padding between the text and secondary text. Only applies when there is both text and secondary text.
261        #[unsafe(method(textToSecondaryTextPadding))]
262        #[unsafe(method_family = none)]
263        pub fn textToSecondaryTextPadding(&self) -> CGFloat;
264
265        #[cfg(feature = "objc2-core-foundation")]
266        /// Setter for [`textToSecondaryTextPadding`][Self::textToSecondaryTextPadding].
267        #[unsafe(method(setTextToSecondaryTextPadding:))]
268        #[unsafe(method_family = none)]
269        pub fn setTextToSecondaryTextPadding(&self, text_to_secondary_text_padding: CGFloat);
270
271        #[cfg(feature = "objc2-core-foundation")]
272        /// Padding between the button and text. Only applies when there is both a button and text.
273        #[unsafe(method(textToButtonPadding))]
274        #[unsafe(method_family = none)]
275        pub fn textToButtonPadding(&self) -> CGFloat;
276
277        #[cfg(feature = "objc2-core-foundation")]
278        /// Setter for [`textToButtonPadding`][Self::textToButtonPadding].
279        #[unsafe(method(setTextToButtonPadding:))]
280        #[unsafe(method_family = none)]
281        pub fn setTextToButtonPadding(&self, text_to_button_padding: CGFloat);
282
283        #[cfg(feature = "objc2-core-foundation")]
284        /// Padding between the button and secondary button. Only applies when there is both a button and a secondary button.
285        #[unsafe(method(buttonToSecondaryButtonPadding))]
286        #[unsafe(method_family = none)]
287        pub fn buttonToSecondaryButtonPadding(&self) -> CGFloat;
288
289        #[cfg(feature = "objc2-core-foundation")]
290        /// Setter for [`buttonToSecondaryButtonPadding`][Self::buttonToSecondaryButtonPadding].
291        #[unsafe(method(setButtonToSecondaryButtonPadding:))]
292        #[unsafe(method_family = none)]
293        pub fn setButtonToSecondaryButtonPadding(
294            &self,
295            button_to_secondary_button_padding: CGFloat,
296        );
297
298        #[cfg(feature = "UIBackgroundConfiguration")]
299        /// The background configuration.
300        #[unsafe(method(background))]
301        #[unsafe(method_family = none)]
302        pub fn background(&self) -> Retained<UIBackgroundConfiguration>;
303
304        #[cfg(feature = "UIBackgroundConfiguration")]
305        /// Setter for [`background`][Self::background].
306        #[unsafe(method(setBackground:))]
307        #[unsafe(method_family = none)]
308        pub fn setBackground(&self, background: &UIBackgroundConfiguration);
309    );
310}