objc2_car_play/generated/CPListImageRowItemCardElement.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::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14extern_class!(
15 /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemcardelement?language=objc)
16 #[unsafe(super(CPListImageRowItemElement, NSObject))]
17 #[thread_kind = MainThreadOnly]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "CPListImageRowItemElement")]
20 pub struct CPListImageRowItemCardElement;
21);
22
23#[cfg(feature = "CPListImageRowItemElement")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for CPListImageRowItemCardElement {}
26);
27
28#[cfg(feature = "CPListImageRowItemElement")]
29impl CPListImageRowItemCardElement {
30 extern_methods!(
31 #[cfg(feature = "objc2-ui-kit")]
32 /// Initialize an element that is constituted of an image, boolean to entirely cover the element with the image, title, subtitle and a tint color.
33 ///
34 /// When providing an image, your app should provide a
35 /// `UIImage`that is display-ready. If necessary for the image, provide
36 /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
37 /// or by using
38 /// `UIImageAsset`to combine two
39 /// `UIImage`instances into a single image with
40 /// both styles.
41 ///
42 /// UIImageAsset is used to combine multiple UIImages with different trait collections into a single UIImage.
43 ///
44 ///
45 /// Note: The expected image size is given by +[CPListImageRowItemCardElement maximumImageSize] or by +[CPListImageRowItemCardElement maximumFullHeightImageSize] if
46 /// `showsImageFullHeight`is true. Images provided will be resized to this size if necessary.
47 ///
48 ///
49 /// To properly size your images, your app should size them to the display scale of the car screen.
50 /// See -[CPInterfaceController carTraitCollection].
51 ///
52 ///
53 /// Parameter `image`: The image associated to the element.
54 ///
55 /// Parameter `showsImageFullHeight`: Determines if the image should entirely cover the card
56 ///
57 /// Parameter `title`: The title of the element.
58 ///
59 /// Parameter `subtitle`: The subtitle of the element.
60 ///
61 /// Parameter `tintColor`: The color used as background if
62 /// `showsImageFullHeight`is true, part of the gradient color at the bottom of the card otherwise.
63 #[unsafe(method(initWithImage:showsImageFullHeight:title:subtitle:tintColor:))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn initWithImage_showsImageFullHeight_title_subtitle_tintColor(
66 this: Allocated<Self>,
67 image: &UIImage,
68 shows_image_full_height: bool,
69 title: Option<&NSString>,
70 subtitle: Option<&NSString>,
71 tint_color: Option<&UIColor>,
72 ) -> Retained<Self>;
73
74 /// The title associated with this element.
75 #[unsafe(method(title))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn title(&self) -> Retained<NSString>;
78
79 /// Setter for [`title`][Self::title].
80 ///
81 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
82 #[unsafe(method(setTitle:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn setTitle(&self, title: &NSString);
85
86 /// The subtitle associated with this element.
87 #[unsafe(method(subtitle))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
90
91 /// Setter for [`subtitle`][Self::subtitle].
92 ///
93 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
94 #[unsafe(method(setSubtitle:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
97
98 /// A Boolean value indicating whether the element should be fill with the image.
99 ///
100 ///
101 /// Set the value of this property to
102 /// `YES`to fill the element with the image or
103 /// `NO`to use a rounded square image that does not fill the card.
104 #[unsafe(method(showsImageFullHeight))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn showsImageFullHeight(&self) -> bool;
107
108 #[cfg(feature = "objc2-ui-kit")]
109 /// A UIColor used to tint the element. When
110 /// `showsImageFullHeight`is true, the tint color is applied behind the labels at the bottom of the card. Otherwise, this color is part of the gradient color at the bottom of the card.
111 ///
112 /// If this value is nil, iOS will use secondarySystemBackground color.
113 #[unsafe(method(tintColor))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
116
117 #[cfg(feature = "objc2-ui-kit")]
118 /// Setter for [`tintColor`][Self::tintColor].
119 ///
120 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
121 #[unsafe(method(setTintColor:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
124
125 #[cfg(feature = "objc2-core-foundation")]
126 /// The expected image size for the image in your
127 /// `CPListImageRowItemCardElement`when
128 /// `showsImageFullHeight`is false. Images provided
129 /// will be resized to this size.
130 ///
131 ///
132 /// To properly size your images, your app should size them to the display scale of the car screen.
133 /// See -[CPInterfaceController carTraitCollection].
134 #[unsafe(method(maximumImageSize))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn maximumImageSize(mtm: MainThreadMarker) -> CGSize;
137
138 #[cfg(feature = "objc2-core-foundation")]
139 /// The expected image size for the image in your
140 /// `CPListImageRowItemCardElement`when
141 /// `showsImageFullHeight`is true. Images provided
142 /// will be resized to this size.
143 ///
144 ///
145 /// To properly size your images, your app should size them to the display scale of the car screen.
146 /// See -[CPInterfaceController carTraitCollection].
147 #[unsafe(method(maximumFullHeightImageSize))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn maximumFullHeightImageSize(mtm: MainThreadMarker) -> CGSize;
150 );
151}
152
153/// Methods declared on superclass `CPListImageRowItemElement`.
154#[cfg(feature = "CPListImageRowItemElement")]
155impl CPListImageRowItemCardElement {
156 extern_methods!(
157 #[unsafe(method(init))]
158 #[unsafe(method_family = init)]
159 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
160 );
161}
162
163/// Methods declared on superclass `NSObject`.
164#[cfg(feature = "CPListImageRowItemElement")]
165impl CPListImageRowItemCardElement {
166 extern_methods!(
167 #[unsafe(method(new))]
168 #[unsafe(method_family = new)]
169 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
170 );
171}