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