objc2-car-play 0.3.2

Bindings to the CarPlay framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// `CPActionSheetTemplate`represents an action sheet that must be dismissed with a button press
    /// before the user may return to using the app.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cpactionsheettemplate?language=objc)
    #[unsafe(super(CPTemplate, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CPTemplate")]
    pub struct CPActionSheetTemplate;
);

#[cfg(feature = "CPTemplate")]
extern_conformance!(
    unsafe impl NSCoding for CPActionSheetTemplate {}
);

#[cfg(feature = "CPTemplate")]
extern_conformance!(
    unsafe impl NSObjectProtocol for CPActionSheetTemplate {}
);

#[cfg(feature = "CPTemplate")]
extern_conformance!(
    unsafe impl NSSecureCoding for CPActionSheetTemplate {}
);

#[cfg(feature = "CPTemplate")]
impl CPActionSheetTemplate {
    extern_methods!(
        #[cfg(feature = "CPAlertAction")]
        /// Initialize a
        /// `CPActionSheetTemplate`with a title and/or message, and at least one action.
        ///
        ///
        /// Parameter `title`: The title of the action sheet.
        ///
        /// Parameter `message`: Descriptive message that provides more detail about the reason for the action sheet.
        ///
        /// Parameter `actions`: The actions for the action sheet.
        #[unsafe(method(initWithTitle:message:actions:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_message_actions(
            this: Allocated<Self>,
            title: Option<&NSString>,
            message: Option<&NSString>,
            actions: &NSArray<CPAlertAction>,
        ) -> Retained<Self>;

        #[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>;

        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(message))]
        #[unsafe(method_family = none)]
        pub unsafe fn message(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "CPAlertAction")]
        #[unsafe(method(actions))]
        #[unsafe(method_family = none)]
        pub unsafe fn actions(&self) -> Retained<NSArray<CPAlertAction>>;
    );
}