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