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

use crate::*;

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

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

impl CPListImageRowItemElement {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "objc2-ui-kit")]
        /// The image associated with this element.
        #[unsafe(method(image))]
        #[unsafe(method_family = none)]
        pub unsafe fn image(&self) -> Retained<UIImage>;

        #[cfg(feature = "objc2-ui-kit")]
        /// Setter for [`image`][Self::image].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImage(&self, image: &UIImage);

        #[cfg(feature = "objc2-core-foundation")]
        /// The expected image size for the image in your
        /// `CPListImageRowItemElement.`Images provided
        /// will be resized to this size.
        ///
        ///
        /// To properly size your images, your app should size them to the display scale of the car screen.
        /// See -[CPInterfaceController carTraitCollection].
        #[unsafe(method(maximumImageSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumImageSize(mtm: MainThreadMarker) -> CGSize;

        /// A Boolean value indicating whether the list element is enabled.
        ///
        ///
        /// Set the value of this property to
        /// `YES`to enable the list element or
        /// `NO`to disable it. The default value of this property is
        /// `YES.`
        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEnabled(&self) -> bool;

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

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