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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpcontacttemplate?language=objc)
    #[unsafe(super(CPTemplate, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CPTemplate")]
    pub struct CPContactTemplate;
);

#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
extern_conformance!(
    unsafe impl CPBarButtonProviding for CPContactTemplate {}
);

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

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

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

#[cfg(feature = "CPTemplate")]
impl CPContactTemplate {
    extern_methods!(
        #[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>;

        #[cfg(feature = "CPContact")]
        /// Initialize a
        /// `CPContactTemplate`by providing a
        /// `CPContact.`
        #[unsafe(method(initWithContact:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContact(this: Allocated<Self>, contact: &CPContact)
            -> Retained<Self>;

        #[cfg(feature = "CPContact")]
        /// The contact currently displayed by this template. Assigning a new contact
        /// will update the template.
        #[unsafe(method(contact))]
        #[unsafe(method_family = none)]
        pub unsafe fn contact(&self) -> Retained<CPContact>;

        #[cfg(feature = "CPContact")]
        /// Setter for [`contact`][Self::contact].
        #[unsafe(method(setContact:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContact(&self, contact: &CPContact);
    );
}