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::*;

/// Types of shape used to draw a condensed row element.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemcondensedelementshape?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CPListImageRowItemCondensedElementShape(pub NSInteger);
impl CPListImageRowItemCondensedElementShape {
    /// The list item will render an element with a circular image.
    #[doc(alias = "CPListImageRowItemCondensedElementShapeCircular")]
    pub const Circular: Self = Self(0);
    /// The list item will render an element with a rounded rectangle image.
    #[doc(alias = "CPListImageRowItemCondensedElementShapeRoundedRectangle")]
    pub const RoundedRectangle: Self = Self(1);
}

unsafe impl Encode for CPListImageRowItemCondensedElementShape {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CPListImageRowItemCondensedElementShape {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

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

#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemCondensedElement {
    extern_methods!(
        #[cfg(feature = "objc2-ui-kit")]
        /// Initialize a list image row condensed element with an image, an image shape, a title, subtitle and a system symbol name.
        ///
        ///
        /// Parameter `image`: The image associated to the element.
        ///
        /// Parameter `imageShape`: The
        /// `CPListImageRowItemCondensedElementShape`shape being applied on the image.
        ///
        /// Parameter `title`: The title of the element.
        ///
        /// Parameter `subtitle`: The subtitle of the element.
        ///
        /// Parameter `accessorySymbolName`: The system symbol used as an accessory view.
        #[unsafe(method(initWithImage:imageShape:title:subtitle:accessorySymbolName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithImage_imageShape_title_subtitle_accessorySymbolName(
            this: Allocated<Self>,
            image: &UIImage,
            image_shape: CPListImageRowItemCondensedElementShape,
            title: &NSString,
            subtitle: Option<&NSString>,
            accessory_symbol_name: Option<&NSString>,
        ) -> Retained<Self>;

        /// The title associated with this element.
        #[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);

        /// The subtitle associated with this element.
        #[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>);

        /// The name of the system symbol image to use as accessory.
        #[unsafe(method(accessorySymbolName))]
        #[unsafe(method_family = none)]
        pub unsafe fn accessorySymbolName(&self) -> Option<Retained<NSString>>;

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

        /// Shape used to draw the image of the element.
        #[unsafe(method(imageShape))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageShape(&self) -> CPListImageRowItemCondensedElementShape;
    );
}

/// Methods declared on superclass `CPListImageRowItemElement`.
#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemCondensedElement {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemCondensedElement {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}