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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-map-kit")]
use objc2_map_kit::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinterest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CPPointOfInterest;
);

extern_conformance!(
    unsafe impl NSCoding for CPPointOfInterest {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CPPointOfInterest {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CPPointOfInterest {}
);

impl CPPointOfInterest {
    extern_methods!(
        #[cfg(all(feature = "objc2-map-kit", feature = "objc2-ui-kit"))]
        /// Initializes a point of interest to be used with
        /// `CPPointOfInterestTemplate`.
        ///
        ///
        /// Parameter `location`: Location indicator use by map annotations.
        ///
        /// Parameter `title`: Primary title for this point of interest.
        ///
        /// Parameter `subtitle`: Optional: Secondary title for this point of interest.
        ///
        /// Parameter `summary`: Optional: Summary text for this point of interest.
        ///
        /// Parameter `detailTitle`: Optional: Title to be used when POI detail card is visible.
        ///
        /// Parameter `detailSubtitle`: Optional: Subtitle to be used when POI detail card is visible.
        ///
        /// Parameter `detailSummary`: Optional: Summary text to be used when POI detail card is visible.
        ///
        /// Parameter `pinImage`: Optional: a custom unselected map annotation image.
        ///
        /// Parameter `selectedPinImage`: Optional: a custom selected map annotation image.
        ///
        ///
        /// Note: When providing an image, your app should provide a
        /// `UIImage`that is display-ready. If necessary for the image, provide
        /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
        /// or by using
        /// `UIImageAsset`to combine two
        /// `UIImage`instances into a single image with
        /// both styles.
        ///
        /// CPPointOfInterest instances appear on the Point of Interest map view as both selectable items in the table view overlay and as map annotations.
        ///
        ///
        /// To properly size your pin images, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
        #[unsafe(method(initWithLocation:title:subtitle:summary:detailTitle:detailSubtitle:detailSummary:pinImage:selectedPinImage:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_title_subtitle_summary_detailTitle_detailSubtitle_detailSummary_pinImage_selectedPinImage(
            this: Allocated<Self>,
            location: &MKMapItem,
            title: &NSString,
            subtitle: Option<&NSString>,
            summary: Option<&NSString>,
            detail_title: Option<&NSString>,
            detail_subtitle: Option<&NSString>,
            detail_summary: Option<&NSString>,
            pin_image: Option<&UIImage>,
            selected_pin_image: Option<&UIImage>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "objc2-map-kit", feature = "objc2-ui-kit"))]
        /// Initializes a point of interest to be used with
        /// `CPPointOfInterestTemplate.`
        ///
        /// Parameter `location`: Location indicator use by map annotations.
        ///
        /// Parameter `title`: Primary title for this point of interest.
        ///
        /// Parameter `subtitle`: Optional: Secondary title for this point of interest.
        ///
        /// Parameter `summary`: Optional: Summary text for this point of interest.
        ///
        /// Parameter `detailTitle`: Optional: Title to be used when POI detail card is visible.
        ///
        /// Parameter `detailSubtitle`: Optional: Subtitle to be used when POI detail card is visible.
        ///
        /// Parameter `detailSummary`: Optional: Summary text to be used when POI detail card is visible.
        ///
        /// Parameter `pinImage`: Optional: a custom map annotation image.
        ///
        ///
        /// Note: When providing an image, your app should provide a
        /// `UIImage`that is display-ready. If necessary for the image, provide
        /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
        /// or by using
        /// `UIImageAsset`to combine two
        /// `UIImage`instances into a single image with
        /// both styles.
        ///
        /// CPPointOfInterest instances appear on the Point of Interest map view as both selectable items in the table view overlay and as map annotations.
        ///
        ///
        /// To properly size your pin images, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
        #[unsafe(method(initWithLocation:title:subtitle:summary:detailTitle:detailSubtitle:detailSummary:pinImage:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_title_subtitle_summary_detailTitle_detailSubtitle_detailSummary_pinImage(
            this: Allocated<Self>,
            location: &MKMapItem,
            title: &NSString,
            subtitle: Option<&NSString>,
            summary: Option<&NSString>,
            detail_title: Option<&NSString>,
            detail_subtitle: Option<&NSString>,
            detail_summary: Option<&NSString>,
            pin_image: Option<&UIImage>,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        /// If you provide a custom image for this point of interest, the unselected image must be this size. Any image larger than this size will be resized.
        #[unsafe(method(pinImageSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn pinImageSize() -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// If you provide a custom image for this point of interest, the selected image must be this size. Any image larger than this size will be resized.
        #[unsafe(method(selectedPinImageSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedPinImageSize() -> CGSize;

        #[cfg(feature = "objc2-map-kit")]
        /// Location associated with this point of interest.
        #[unsafe(method(location))]
        #[unsafe(method_family = none)]
        pub unsafe fn location(&self) -> Retained<MKMapItem>;

        #[cfg(feature = "objc2-map-kit")]
        /// Setter for [`location`][Self::location].
        #[unsafe(method(setLocation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocation(&self, location: &MKMapItem);

        /// Primary title for this point of interest.
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Retained<NSString>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitle(&self, title: &NSString);

        /// Subtitle for this point of interest.
        #[unsafe(method(subtitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`subtitle`][Self::subtitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSubtitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);

        /// Summary text for this point of interest.
        #[unsafe(method(summary))]
        #[unsafe(method_family = none)]
        pub unsafe fn summary(&self) -> Option<Retained<NSString>>;

        /// Setter for [`summary`][Self::summary].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSummary:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSummary(&self, summary: Option<&NSString>);

        /// Title to be used when POI detail card is visible.
        ///
        ///
        /// Note: If not provided, the point of interest will fall back to displaying
        /// `title.`
        #[unsafe(method(detailTitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn detailTitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`detailTitle`][Self::detailTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDetailTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDetailTitle(&self, detail_title: Option<&NSString>);

        /// Subtitle to be used when POI detail card is visible.
        ///
        ///
        /// Note: If not provided, the point of interest will fall back to displaying
        /// `subtitle.`
        #[unsafe(method(detailSubtitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn detailSubtitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`detailSubtitle`][Self::detailSubtitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDetailSubtitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDetailSubtitle(&self, detail_subtitle: Option<&NSString>);

        /// Summary text to be used when POI detail card is visible.
        ///
        ///
        /// Note: If not provided, the point of interest will fall back to displaying
        /// `summary.`
        #[unsafe(method(detailSummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn detailSummary(&self) -> Option<Retained<NSString>>;

        /// Setter for [`detailSummary`][Self::detailSummary].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDetailSummary:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDetailSummary(&self, detail_summary: Option<&NSString>);

        #[cfg(feature = "objc2-ui-kit")]
        /// Image used for map view unselected annotations.
        ///
        ///
        /// To properly size your pin image, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
        #[unsafe(method(pinImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn pinImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "objc2-ui-kit")]
        /// Setter for [`pinImage`][Self::pinImage].
        #[unsafe(method(setPinImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPinImage(&self, pin_image: Option<&UIImage>);

        #[cfg(feature = "objc2-ui-kit")]
        /// Image used for map view selected annotation.
        ///
        ///
        /// To properly size your pin image, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
        #[unsafe(method(selectedPinImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedPinImage(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "objc2-ui-kit")]
        /// Setter for [`selectedPinImage`][Self::selectedPinImage].
        #[unsafe(method(setSelectedPinImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectedPinImage(&self, selected_pin_image: Option<&UIImage>);

        #[cfg(feature = "CPTextButton")]
        /// Point of Interest detail card buttons.
        #[unsafe(method(primaryButton))]
        #[unsafe(method_family = none)]
        pub unsafe fn primaryButton(&self) -> Option<Retained<CPTextButton>>;

        #[cfg(feature = "CPTextButton")]
        /// Setter for [`primaryButton`][Self::primaryButton].
        #[unsafe(method(setPrimaryButton:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPrimaryButton(&self, primary_button: Option<&CPTextButton>);

        #[cfg(feature = "CPTextButton")]
        #[unsafe(method(secondaryButton))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondaryButton(&self) -> Option<Retained<CPTextButton>>;

        #[cfg(feature = "CPTextButton")]
        /// Setter for [`secondaryButton`][Self::secondaryButton].
        #[unsafe(method(setSecondaryButton:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSecondaryButton(&self, secondary_button: Option<&CPTextButton>);

        /// Any custom data or an object associated with this Point of Interest.
        #[unsafe(method(userInfo))]
        #[unsafe(method_family = none)]
        pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`userInfo`][Self::userInfo].
        ///
        /// # Safety
        ///
        /// `user_info` should be of the correct type.
        #[unsafe(method(setUserInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);

        #[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() -> Retained<Self>;
    );
}