objc2_ui_kit/generated/
UIContentUnavailableButtonProperties.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentunavailablebuttonproperties?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UIContentUnavailableButtonProperties;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for UIContentUnavailableButtonProperties {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for UIContentUnavailableButtonProperties {}
24);
25
26unsafe impl CopyingHelper for UIContentUnavailableButtonProperties {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for UIContentUnavailableButtonProperties {}
32);
33
34extern_conformance!(
35    unsafe impl NSSecureCoding for UIContentUnavailableButtonProperties {}
36);
37
38impl UIContentUnavailableButtonProperties {
39    extern_methods!(
40        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
41        /// The primary action of the button.
42        #[unsafe(method(primaryAction))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn primaryAction(&self) -> Option<Retained<UIAction>>;
45
46        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
47        /// Setter for [`primaryAction`][Self::primaryAction].
48        #[unsafe(method(setPrimaryAction:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
51
52        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
53        /// An optional menu for the button to display.
54        #[unsafe(method(menu))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;
57
58        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
59        /// Setter for [`menu`][Self::menu].
60        #[unsafe(method(setMenu:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);
63
64        /// Whether the button is enabled. Default is YES.
65        #[unsafe(method(isEnabled))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn isEnabled(&self) -> bool;
68
69        /// Setter for [`isEnabled`][Self::isEnabled].
70        #[unsafe(method(setEnabled:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setEnabled(&self, enabled: bool);
73
74        #[cfg(feature = "UIButton")]
75        /// The role of the button.
76        #[unsafe(method(role))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn role(&self) -> UIButtonRole;
79
80        #[cfg(feature = "UIButton")]
81        /// Setter for [`role`][Self::role].
82        #[unsafe(method(setRole:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setRole(&self, role: UIButtonRole);
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89impl UIContentUnavailableButtonProperties {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[unsafe(method(new))]
96        #[unsafe(method_family = new)]
97        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
98    );
99}