objc2_car_play/generated/CPPointOfInterest.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-map-kit")]
10use objc2_map_kit::*;
11#[cfg(feature = "objc2-ui-kit")]
12use objc2_ui_kit::*;
13
14use crate::*;
15
16extern_class!(
17 /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinterest?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct CPPointOfInterest;
21);
22
23extern_conformance!(
24 unsafe impl NSCoding for CPPointOfInterest {}
25);
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for CPPointOfInterest {}
29);
30
31extern_conformance!(
32 unsafe impl NSSecureCoding for CPPointOfInterest {}
33);
34
35impl CPPointOfInterest {
36 extern_methods!(
37 #[cfg(all(feature = "objc2-map-kit", feature = "objc2-ui-kit"))]
38 /// Initializes a point of interest to be used with
39 /// `CPPointOfInterestTemplate`.
40 ///
41 ///
42 /// Parameter `location`: Location indicator use by map annotations.
43 ///
44 /// Parameter `title`: Primary title for this point of interest.
45 ///
46 /// Parameter `subtitle`: Optional: Secondary title for this point of interest.
47 ///
48 /// Parameter `summary`: Optional: Summary text for this point of interest.
49 ///
50 /// Parameter `detailTitle`: Optional: Title to be used when POI detail card is visible.
51 ///
52 /// Parameter `detailSubtitle`: Optional: Subtitle to be used when POI detail card is visible.
53 ///
54 /// Parameter `detailSummary`: Optional: Summary text to be used when POI detail card is visible.
55 ///
56 /// Parameter `pinImage`: Optional: a custom unselected map annotation image.
57 ///
58 /// Parameter `selectedPinImage`: Optional: a custom selected map annotation image.
59 ///
60 ///
61 /// Note: When providing an image, your app should provide a
62 /// `UIImage`that is display-ready. If necessary for the image, provide
63 /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
64 /// or by using
65 /// `UIImageAsset`to combine two
66 /// `UIImage`instances into a single image with
67 /// both styles.
68 ///
69 /// CPPointOfInterest instances appear on the Point of Interest map view as both selectable items in the table view overlay and as map annotations.
70 ///
71 ///
72 /// To properly size your pin images, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
73 #[unsafe(method(initWithLocation:title:subtitle:summary:detailTitle:detailSubtitle:detailSummary:pinImage:selectedPinImage:))]
74 #[unsafe(method_family = init)]
75 pub unsafe fn initWithLocation_title_subtitle_summary_detailTitle_detailSubtitle_detailSummary_pinImage_selectedPinImage(
76 this: Allocated<Self>,
77 location: &MKMapItem,
78 title: &NSString,
79 subtitle: Option<&NSString>,
80 summary: Option<&NSString>,
81 detail_title: Option<&NSString>,
82 detail_subtitle: Option<&NSString>,
83 detail_summary: Option<&NSString>,
84 pin_image: Option<&UIImage>,
85 selected_pin_image: Option<&UIImage>,
86 ) -> Retained<Self>;
87
88 #[cfg(all(feature = "objc2-map-kit", feature = "objc2-ui-kit"))]
89 /// Initializes a point of interest to be used with
90 /// `CPPointOfInterestTemplate.`
91 ///
92 /// Parameter `location`: Location indicator use by map annotations.
93 ///
94 /// Parameter `title`: Primary title for this point of interest.
95 ///
96 /// Parameter `subtitle`: Optional: Secondary title for this point of interest.
97 ///
98 /// Parameter `summary`: Optional: Summary text for this point of interest.
99 ///
100 /// Parameter `detailTitle`: Optional: Title to be used when POI detail card is visible.
101 ///
102 /// Parameter `detailSubtitle`: Optional: Subtitle to be used when POI detail card is visible.
103 ///
104 /// Parameter `detailSummary`: Optional: Summary text to be used when POI detail card is visible.
105 ///
106 /// Parameter `pinImage`: Optional: a custom map annotation image.
107 ///
108 ///
109 /// Note: When providing an image, your app should provide a
110 /// `UIImage`that is display-ready. If necessary for the image, provide
111 /// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
112 /// or by using
113 /// `UIImageAsset`to combine two
114 /// `UIImage`instances into a single image with
115 /// both styles.
116 ///
117 /// CPPointOfInterest instances appear on the Point of Interest map view as both selectable items in the table view overlay and as map annotations.
118 ///
119 ///
120 /// To properly size your pin images, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
121 #[unsafe(method(initWithLocation:title:subtitle:summary:detailTitle:detailSubtitle:detailSummary:pinImage:))]
122 #[unsafe(method_family = init)]
123 pub unsafe fn initWithLocation_title_subtitle_summary_detailTitle_detailSubtitle_detailSummary_pinImage(
124 this: Allocated<Self>,
125 location: &MKMapItem,
126 title: &NSString,
127 subtitle: Option<&NSString>,
128 summary: Option<&NSString>,
129 detail_title: Option<&NSString>,
130 detail_subtitle: Option<&NSString>,
131 detail_summary: Option<&NSString>,
132 pin_image: Option<&UIImage>,
133 ) -> Retained<Self>;
134
135 #[cfg(feature = "objc2-core-foundation")]
136 /// If you provide a custom image for this point of interest, the unselected image must be this size. Any image larger than this size will be resized.
137 #[unsafe(method(pinImageSize))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn pinImageSize() -> CGSize;
140
141 #[cfg(feature = "objc2-core-foundation")]
142 /// If you provide a custom image for this point of interest, the selected image must be this size. Any image larger than this size will be resized.
143 #[unsafe(method(selectedPinImageSize))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn selectedPinImageSize() -> CGSize;
146
147 #[cfg(feature = "objc2-map-kit")]
148 /// Location associated with this point of interest.
149 #[unsafe(method(location))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn location(&self) -> Retained<MKMapItem>;
152
153 #[cfg(feature = "objc2-map-kit")]
154 /// Setter for [`location`][Self::location].
155 #[unsafe(method(setLocation:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn setLocation(&self, location: &MKMapItem);
158
159 /// Primary title for this point of interest.
160 #[unsafe(method(title))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn title(&self) -> Retained<NSString>;
163
164 /// Setter for [`title`][Self::title].
165 ///
166 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
167 #[unsafe(method(setTitle:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setTitle(&self, title: &NSString);
170
171 /// Subtitle for this point of interest.
172 #[unsafe(method(subtitle))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
175
176 /// Setter for [`subtitle`][Self::subtitle].
177 ///
178 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
179 #[unsafe(method(setSubtitle:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
182
183 /// Summary text for this point of interest.
184 #[unsafe(method(summary))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn summary(&self) -> Option<Retained<NSString>>;
187
188 /// Setter for [`summary`][Self::summary].
189 ///
190 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
191 #[unsafe(method(setSummary:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn setSummary(&self, summary: Option<&NSString>);
194
195 /// Title to be used when POI detail card is visible.
196 ///
197 ///
198 /// Note: If not provided, the point of interest will fall back to displaying
199 /// `title.`
200 #[unsafe(method(detailTitle))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn detailTitle(&self) -> Option<Retained<NSString>>;
203
204 /// Setter for [`detailTitle`][Self::detailTitle].
205 ///
206 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
207 #[unsafe(method(setDetailTitle:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn setDetailTitle(&self, detail_title: Option<&NSString>);
210
211 /// Subtitle to be used when POI detail card is visible.
212 ///
213 ///
214 /// Note: If not provided, the point of interest will fall back to displaying
215 /// `subtitle.`
216 #[unsafe(method(detailSubtitle))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn detailSubtitle(&self) -> Option<Retained<NSString>>;
219
220 /// Setter for [`detailSubtitle`][Self::detailSubtitle].
221 ///
222 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
223 #[unsafe(method(setDetailSubtitle:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setDetailSubtitle(&self, detail_subtitle: Option<&NSString>);
226
227 /// Summary text to be used when POI detail card is visible.
228 ///
229 ///
230 /// Note: If not provided, the point of interest will fall back to displaying
231 /// `summary.`
232 #[unsafe(method(detailSummary))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn detailSummary(&self) -> Option<Retained<NSString>>;
235
236 /// Setter for [`detailSummary`][Self::detailSummary].
237 ///
238 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
239 #[unsafe(method(setDetailSummary:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn setDetailSummary(&self, detail_summary: Option<&NSString>);
242
243 #[cfg(feature = "objc2-ui-kit")]
244 /// Image used for map view unselected annotations.
245 ///
246 ///
247 /// To properly size your pin image, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
248 #[unsafe(method(pinImage))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn pinImage(&self) -> Option<Retained<UIImage>>;
251
252 #[cfg(feature = "objc2-ui-kit")]
253 /// Setter for [`pinImage`][Self::pinImage].
254 #[unsafe(method(setPinImage:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn setPinImage(&self, pin_image: Option<&UIImage>);
257
258 #[cfg(feature = "objc2-ui-kit")]
259 /// Image used for map view selected annotation.
260 ///
261 ///
262 /// To properly size your pin image, your app should size them to the display scale of the car screen. See -[CPInterfaceController carTraitCollection].
263 #[unsafe(method(selectedPinImage))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn selectedPinImage(&self) -> Option<Retained<UIImage>>;
266
267 #[cfg(feature = "objc2-ui-kit")]
268 /// Setter for [`selectedPinImage`][Self::selectedPinImage].
269 #[unsafe(method(setSelectedPinImage:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setSelectedPinImage(&self, selected_pin_image: Option<&UIImage>);
272
273 #[cfg(feature = "CPTextButton")]
274 /// Point of Interest detail card buttons.
275 #[unsafe(method(primaryButton))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn primaryButton(&self) -> Option<Retained<CPTextButton>>;
278
279 #[cfg(feature = "CPTextButton")]
280 /// Setter for [`primaryButton`][Self::primaryButton].
281 #[unsafe(method(setPrimaryButton:))]
282 #[unsafe(method_family = none)]
283 pub unsafe fn setPrimaryButton(&self, primary_button: Option<&CPTextButton>);
284
285 #[cfg(feature = "CPTextButton")]
286 #[unsafe(method(secondaryButton))]
287 #[unsafe(method_family = none)]
288 pub unsafe fn secondaryButton(&self) -> Option<Retained<CPTextButton>>;
289
290 #[cfg(feature = "CPTextButton")]
291 /// Setter for [`secondaryButton`][Self::secondaryButton].
292 #[unsafe(method(setSecondaryButton:))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn setSecondaryButton(&self, secondary_button: Option<&CPTextButton>);
295
296 /// Any custom data or an object associated with this Point of Interest.
297 #[unsafe(method(userInfo))]
298 #[unsafe(method_family = none)]
299 pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
300
301 /// Setter for [`userInfo`][Self::userInfo].
302 ///
303 /// # Safety
304 ///
305 /// `user_info` should be of the correct type.
306 #[unsafe(method(setUserInfo:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
309
310 #[unsafe(method(init))]
311 #[unsafe(method_family = init)]
312 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
313
314 #[unsafe(method(new))]
315 #[unsafe(method_family = new)]
316 pub unsafe fn new() -> Retained<Self>;
317 );
318}