1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpmapbutton?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CPMapButton;
);
extern_conformance!(
unsafe impl NSCoding for CPMapButton {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for CPMapButton {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CPMapButton {}
);
impl CPMapButton {
extern_methods!(
#[cfg(feature = "block2")]
/// Initializes a new map button.
///
///
/// Parameter `handler`: A block to execute when the user selects the button. The block has no return value and takes the selected button as its only parameter.
#[unsafe(method(initWithHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithHandler(
this: Allocated<Self>,
handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPMapButton>)>>,
) -> Retained<Self>;
/// A Boolean value indicating whether the button is enabled.
///
///
/// Set the value of this property to
/// `YES`to enable the button or
/// `NO`to disable it. The default value of this property is
/// `YES.`
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnabled(&self) -> bool;
/// Setter for [`isEnabled`][Self::isEnabled].
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnabled(&self, enabled: bool);
/// A Boolean value indicating whether the button is hidden.
///
///
/// Setting the value of this property to
/// `YES`hides the button and setting it to
/// `NO`shows it. The default value is
/// `NO.`
#[unsafe(method(isHidden))]
#[unsafe(method_family = none)]
pub unsafe fn isHidden(&self) -> bool;
/// Setter for [`isHidden`][Self::isHidden].
#[unsafe(method(setHidden:))]
#[unsafe(method_family = none)]
pub unsafe fn setHidden(&self, hidden: bool);
#[cfg(feature = "objc2-ui-kit")]
/// The image displayed on the button.
///
///
/// Animated images are not supported. If an animated image is assigned, only the first image will be used.
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "objc2-ui-kit")]
/// Setter for [`image`][Self::image].
#[unsafe(method(setImage:))]
#[unsafe(method_family = none)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[cfg(feature = "objc2-ui-kit")]
/// The image displayed on the button when focused.
///
///
/// The button will automatically create a focused image using the alpha values from the source image.
///
///
/// Note: If unspecified, the button will use the default
/// `image`
#[unsafe(method(focusedImage))]
#[unsafe(method_family = none)]
pub unsafe fn focusedImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "objc2-ui-kit")]
/// Setter for [`focusedImage`][Self::focusedImage].
#[unsafe(method(setFocusedImage:))]
#[unsafe(method_family = none)]
pub unsafe fn setFocusedImage(&self, focused_image: Option<&UIImage>);
);
}
/// Methods declared on superclass `NSObject`.
impl CPMapButton {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}