objc2_car_play/generated/
CPAlertTemplate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// `CPAlertTemplate`represents a modal alert that must be dismissed with a button press
11    /// before the user may return to using the app.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cpalerttemplate?language=objc)
14    #[unsafe(super(CPTemplate, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "CPTemplate")]
18    pub struct CPAlertTemplate;
19);
20
21#[cfg(feature = "CPTemplate")]
22extern_conformance!(
23    unsafe impl NSCoding for CPAlertTemplate {}
24);
25
26#[cfg(feature = "CPTemplate")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for CPAlertTemplate {}
29);
30
31#[cfg(feature = "CPTemplate")]
32extern_conformance!(
33    unsafe impl NSSecureCoding for CPAlertTemplate {}
34);
35
36#[cfg(feature = "CPTemplate")]
37impl CPAlertTemplate {
38    extern_methods!(
39        #[cfg(feature = "CPAlertAction")]
40        /// Initialize a
41        /// `CPAlertTemplate`by specifying a list of title variants and at least one action.
42        ///
43        ///
44        /// Parameter `titleVariants`: An array of strings, ordered longest to shortest. The template will display
45        /// the longest string that fits in the available space on the current size of the car screen,
46        /// dropping down to shorter strings as necessary.
47        ///
48        ///
49        /// Parameter `actions`: An array of alert actions to display in this alert template. You must specify at
50        /// least one action.
51        #[unsafe(method(initWithTitleVariants:actions:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithTitleVariants_actions(
54            this: Allocated<Self>,
55            title_variants: &NSArray<NSString>,
56            actions: &NSArray<CPAlertAction>,
57        ) -> Retained<Self>;
58
59        #[unsafe(method(init))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
62
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
66
67        #[unsafe(method(titleVariants))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn titleVariants(&self) -> Retained<NSArray<NSString>>;
70
71        /// Maximum number of action buttons that may appear in any
72        /// `CPAlertTemplate.`If you add more than this number of buttons, only the most recently-added buttons
73        /// (up to this count) will be kept.
74        #[unsafe(method(maximumActionCount))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn maximumActionCount(mtm: MainThreadMarker) -> NSUInteger;
77
78        #[cfg(feature = "CPAlertAction")]
79        #[unsafe(method(actions))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn actions(&self) -> Retained<NSArray<CPAlertAction>>;
82    );
83}