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

use crate::*;

extern_class!(
    /// Abstract superclass for a template object.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplate?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CPTemplate;
);

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

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

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

impl CPTemplate {
    extern_methods!(
        /// Any custom data or an object associated with this template can be stored in this property.
        #[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>);

        /// When this template is the first template displayed in a
        /// `CPTabBarTemplate's`tab, the tab will inherit
        /// the
        /// `tabTitle`specified in this template.
        ///
        ///
        /// Note: If no
        /// `tabTitle`is specified, the tab will inherit the template's title, if any.
        ///
        ///
        /// Note: Your template should specify either a
        /// `tabSystemItem`OR both a
        /// `tabImage`and
        /// `tabTitle.`
        #[unsafe(method(tabTitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn tabTitle(&self) -> Option<Retained<NSString>>;

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

        #[cfg(feature = "objc2-ui-kit")]
        /// When this template is the first template displayed in a
        /// `CPTabBarTemplate's`tab, the tab will inherit
        /// the image specified in this template. If a tabSystemItem is also specified, tabImage will take precedence.
        ///
        ///
        /// Note: Your template should specify either a
        /// `tabSystemItem`OR both a
        /// `tabImage`and
        /// `tabTitle.`
        #[unsafe(method(tabImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn tabImage(&self) -> Option<Retained<UIImage>>;

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

        #[cfg(feature = "objc2-ui-kit")]
        /// When this template is the first template displayed in a
        /// `CPTabBarTemplate's`tab, the tab will inherit
        /// the system image AND system title specified in this template.
        ///
        ///
        /// Note: Your template should specify either a
        /// `tabSystemItem`OR both a
        /// `tabImage`and
        /// `tabTitle.`
        #[unsafe(method(tabSystemItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn tabSystemItem(&self) -> UITabBarSystemItem;

        #[cfg(feature = "objc2-ui-kit")]
        /// Setter for [`tabSystemItem`][Self::tabSystemItem].
        #[unsafe(method(setTabSystemItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTabSystemItem(&self, tab_system_item: UITabBarSystemItem);

        /// When this template is the first template displayed in a
        /// `CPTabBarTemplate's`tab, the tab may optionally
        /// display a badge indicator.
        ///
        ///
        /// Note: This defaults to NO. Specify YES to display a badge indicator on this tab.
        #[unsafe(method(showsTabBadge))]
        #[unsafe(method_family = none)]
        pub unsafe fn showsTabBadge(&self) -> bool;

        /// Setter for [`showsTabBadge`][Self::showsTabBadge].
        #[unsafe(method(setShowsTabBadge:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShowsTabBadge(&self, shows_tab_badge: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl CPTemplate {
    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>;
    );
}