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 fn primaryAction(&self) -> Option<Retained<UIAction>>;
45
46        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
47        /// Setter for [`primaryAction`][Self::primaryAction].
48        ///
49        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
50        #[unsafe(method(setPrimaryAction:))]
51        #[unsafe(method_family = none)]
52        pub fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
53
54        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
55        /// An optional menu for the button to display.
56        #[unsafe(method(menu))]
57        #[unsafe(method_family = none)]
58        pub fn menu(&self) -> Option<Retained<UIMenu>>;
59
60        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
61        /// Setter for [`menu`][Self::menu].
62        ///
63        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
64        #[unsafe(method(setMenu:))]
65        #[unsafe(method_family = none)]
66        pub fn setMenu(&self, menu: Option<&UIMenu>);
67
68        /// Whether the button is enabled. Default is YES.
69        #[unsafe(method(isEnabled))]
70        #[unsafe(method_family = none)]
71        pub fn isEnabled(&self) -> bool;
72
73        /// Setter for [`isEnabled`][Self::isEnabled].
74        #[unsafe(method(setEnabled:))]
75        #[unsafe(method_family = none)]
76        pub fn setEnabled(&self, enabled: bool);
77
78        #[cfg(feature = "UIButton")]
79        /// The role of the button.
80        #[unsafe(method(role))]
81        #[unsafe(method_family = none)]
82        pub fn role(&self) -> UIButtonRole;
83
84        #[cfg(feature = "UIButton")]
85        /// Setter for [`role`][Self::role].
86        #[unsafe(method(setRole:))]
87        #[unsafe(method_family = none)]
88        pub fn setRole(&self, role: UIButtonRole);
89    );
90}
91
92/// Methods declared on superclass `NSObject`.
93impl UIContentUnavailableButtonProperties {
94    extern_methods!(
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub fn init(this: Allocated<Self>) -> Retained<Self>;
98
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
102    );
103}