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
18unsafe impl NSCoding for UIContentUnavailableButtonProperties {}
19
20unsafe impl NSCopying for UIContentUnavailableButtonProperties {}
21
22unsafe impl CopyingHelper for UIContentUnavailableButtonProperties {
23    type Result = Self;
24}
25
26unsafe impl NSObjectProtocol for UIContentUnavailableButtonProperties {}
27
28unsafe impl NSSecureCoding for UIContentUnavailableButtonProperties {}
29
30impl UIContentUnavailableButtonProperties {
31    extern_methods!(
32        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
33        /// The primary action of the button.
34        #[unsafe(method(primaryAction))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn primaryAction(&self) -> Option<Retained<UIAction>>;
37
38        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
39        /// Setter for [`primaryAction`][Self::primaryAction].
40        #[unsafe(method(setPrimaryAction:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
43
44        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
45        /// An optional menu for the button to display.
46        #[unsafe(method(menu))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;
49
50        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
51        /// Setter for [`menu`][Self::menu].
52        #[unsafe(method(setMenu:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);
55
56        /// Whether the button is enabled. Default is YES.
57        #[unsafe(method(isEnabled))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn isEnabled(&self) -> bool;
60
61        /// Setter for [`isEnabled`][Self::isEnabled].
62        #[unsafe(method(setEnabled:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setEnabled(&self, enabled: bool);
65
66        #[cfg(feature = "UIButton")]
67        /// The role of the button.
68        #[unsafe(method(role))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn role(&self) -> UIButtonRole;
71
72        #[cfg(feature = "UIButton")]
73        /// Setter for [`role`][Self::role].
74        #[unsafe(method(setRole:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setRole(&self, role: UIButtonRole);
77    );
78}
79
80/// Methods declared on superclass `NSObject`.
81impl UIContentUnavailableButtonProperties {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
90    );
91}