objc2_car_play/generated/
CPListImageRowItemElement.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-ui-kit")]
9use objc2_ui_kit::*;
10
11use crate::*;
12
13extern_class!(
14    /// Abstract superclass for a a row item element object.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemelement?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct CPListImageRowItemElement;
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for CPListImageRowItemElement {}
25);
26
27impl CPListImageRowItemElement {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[cfg(feature = "objc2-ui-kit")]
34        /// The image associated with this element.
35        #[unsafe(method(image))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn image(&self) -> Retained<UIImage>;
38
39        #[cfg(feature = "objc2-ui-kit")]
40        /// Setter for [`image`][Self::image].
41        ///
42        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
43        #[unsafe(method(setImage:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setImage(&self, image: &UIImage);
46
47        #[cfg(feature = "objc2-core-foundation")]
48        /// The expected image size for the image in your
49        /// `CPListImageRowItemElement.`Images provided
50        /// will be resized to this size.
51        ///
52        ///
53        /// To properly size your images, your app should size them to the display scale of the car screen.
54        /// See -[CPInterfaceController carTraitCollection].
55        #[unsafe(method(maximumImageSize))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn maximumImageSize(mtm: MainThreadMarker) -> CGSize;
58
59        /// A Boolean value indicating whether the list element is enabled.
60        ///
61        ///
62        /// Set the value of this property to
63        /// `YES`to enable the list element or
64        /// `NO`to disable it. The default value of this property is
65        /// `YES.`
66        #[unsafe(method(isEnabled))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn isEnabled(&self) -> bool;
69
70        /// Setter for [`isEnabled`][Self::isEnabled].
71        #[unsafe(method(setEnabled:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setEnabled(&self, enabled: bool);
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl CPListImageRowItemElement {
79    extern_methods!(
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
83    );
84}