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
//! 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/cpdashboardbutton?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CPDashboardButton;
);
extern_conformance!(
unsafe impl NSCoding for CPDashboardButton {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for CPDashboardButton {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CPDashboardButton {}
);
impl CPDashboardButton {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
/// Initialize a button with title variants, optional subtitle variants, and image.
///
///
/// Parameter `titleVariants`: An array of title variants for this button, arranged from longest to shortest. You must provide at least one title.
///
/// Parameter `subtitleVariants`: An array of subtitle variants for this button, arranged from longest to shortest.
///
/// Parameter `image`: The image displayed on the button. It must be non-nil for the button to be displayed.
///
/// 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.
/// The image must be non-nil and the title must be a non-zero length string for the button to be displayed.
#[unsafe(method(initWithTitleVariants:subtitleVariants:image:handler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTitleVariants_subtitleVariants_image_handler(
this: Allocated<Self>,
title_variants: &NSArray<NSString>,
subtitle_variants: &NSArray<NSString>,
image: &UIImage,
handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPDashboardButton>)>>,
) -> Retained<Self>;
#[cfg(feature = "objc2-ui-kit")]
/// The image displayed on the button. Maximum supported size is 30x30 points.
///
///
/// 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) -> Retained<UIImage>;
/// An array of title variants for this button, arranged from most to least preferred.
/// The system will select a title from your list of provided variants that fits the available space.
/// The variant strings should be provided as localized, displayable content.
#[unsafe(method(titleVariants))]
#[unsafe(method_family = none)]
pub unsafe fn titleVariants(&self) -> Retained<NSArray<NSString>>;
/// An array of subtitle variants for this button, arranged from most to least preferred.
/// The system will select a title from your list of provided variants that fits the available space.
/// The variant strings should be provided as localized, displayable content.
#[unsafe(method(subtitleVariants))]
#[unsafe(method_family = none)]
pub unsafe fn subtitleVariants(&self) -> Retained<NSArray<NSString>>;
);
}