objc2_car_play/generated/
CPListImageRowItemRowElement.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::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemrowelement?language=objc)
14    #[unsafe(super(CPListImageRowItemElement, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "CPListImageRowItemElement")]
18    pub struct CPListImageRowItemRowElement;
19);
20
21#[cfg(feature = "CPListImageRowItemElement")]
22extern_conformance!(
23    unsafe impl NSObjectProtocol for CPListImageRowItemRowElement {}
24);
25
26#[cfg(feature = "CPListImageRowItemElement")]
27impl CPListImageRowItemRowElement {
28    extern_methods!(
29        #[cfg(feature = "objc2-ui-kit")]
30        /// Initialize an element that is constituted of an image, title and subtitle. Only image is required while the two others can be omitted.
31        ///
32        /// When providing an image, your app should provide a
33        /// `UIImage`that is display-ready. If necessary for the image, provide
34        /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
35        /// or by using
36        /// `UIImageAsset`to combine two
37        /// `UIImage`instances into a single image with
38        /// both styles.
39        ///
40        /// UIImageAsset is used to combine multiple UIImages with different trait collections into a single UIImage.
41        ///
42        ///
43        /// Note: The expected image size is given by +[CPListImageRowItemRowElement maximumImageSize]. Images provided will be resized to this size if necessary.
44        ///
45        ///
46        /// To properly size your images, your app should size them to the display scale of the car screen.
47        /// See -[CPInterfaceController carTraitCollection].
48        ///
49        ///
50        /// Parameter `image`: The image associated to the element.
51        ///
52        /// Parameter `title`: The title of the element.
53        ///
54        /// Parameter `subtitle`: The subtitle of the element.
55        #[unsafe(method(initWithImage:title:subtitle:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithImage_title_subtitle(
58            this: Allocated<Self>,
59            image: &UIImage,
60            title: Option<&NSString>,
61            subtitle: Option<&NSString>,
62        ) -> Retained<Self>;
63
64        /// The title associated with this element.
65        #[unsafe(method(title))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
68
69        /// Setter for [`title`][Self::title].
70        ///
71        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
72        #[unsafe(method(setTitle:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setTitle(&self, title: Option<&NSString>);
75
76        /// The subtitle associated with this element.
77        #[unsafe(method(subtitle))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
80
81        /// Setter for [`subtitle`][Self::subtitle].
82        ///
83        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
84        #[unsafe(method(setSubtitle:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
87    );
88}
89
90/// Methods declared on superclass `CPListImageRowItemElement`.
91#[cfg(feature = "CPListImageRowItemElement")]
92impl CPListImageRowItemRowElement {
93    extern_methods!(
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101#[cfg(feature = "CPListImageRowItemElement")]
102impl CPListImageRowItemRowElement {
103    extern_methods!(
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
107    );
108}