objc2_car_play/generated/
CPActionSheetTemplate.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    /// `CPActionSheetTemplate`represents an action sheet 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/cpactionsheettemplate?language=objc)
14    #[unsafe(super(CPTemplate, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "CPTemplate")]
18    pub struct CPActionSheetTemplate;
19);
20
21#[cfg(feature = "CPTemplate")]
22extern_conformance!(
23    unsafe impl NSCoding for CPActionSheetTemplate {}
24);
25
26#[cfg(feature = "CPTemplate")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for CPActionSheetTemplate {}
29);
30
31#[cfg(feature = "CPTemplate")]
32extern_conformance!(
33    unsafe impl NSSecureCoding for CPActionSheetTemplate {}
34);
35
36#[cfg(feature = "CPTemplate")]
37impl CPActionSheetTemplate {
38    extern_methods!(
39        #[cfg(feature = "CPAlertAction")]
40        /// Initialize a
41        /// `CPActionSheetTemplate`with a title and/or message, and at least one action.
42        ///
43        ///
44        /// Parameter `title`: The title of the action sheet.
45        ///
46        /// Parameter `message`: Descriptive message that provides more detail about the reason for the action sheet.
47        ///
48        /// Parameter `actions`: The actions for the action sheet.
49        #[unsafe(method(initWithTitle:message:actions:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithTitle_message_actions(
52            this: Allocated<Self>,
53            title: Option<&NSString>,
54            message: Option<&NSString>,
55            actions: &NSArray<CPAlertAction>,
56        ) -> Retained<Self>;
57
58        #[unsafe(method(init))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
61
62        #[unsafe(method(new))]
63        #[unsafe(method_family = new)]
64        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
65
66        #[unsafe(method(title))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
69
70        #[unsafe(method(message))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn message(&self) -> Option<Retained<NSString>>;
73
74        #[cfg(feature = "CPAlertAction")]
75        #[unsafe(method(actions))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn actions(&self) -> Retained<NSArray<CPAlertAction>>;
78    );
79}