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