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
//! 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::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-map-kit")]
use objc2_map_kit::*;
use crate::*;
extern_protocol!(
/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinteresttemplatedelegate?language=objc)
pub unsafe trait CPPointOfInterestTemplateDelegate:
NSObjectProtocol + MainThreadOnly
{
#[cfg(all(feature = "CPTemplate", feature = "objc2-map-kit"))]
/// The user has changed the map region on the
/// `CPPointOfInterestTemplate.`Your application
/// should respond by updating
/// `pointsOfInterest`to show new points of interest for the new region.
#[unsafe(method(pointOfInterestTemplate:didChangeMapRegion:))]
#[unsafe(method_family = none)]
unsafe fn pointOfInterestTemplate_didChangeMapRegion(
&self,
point_of_interest_template: &CPPointOfInterestTemplate,
region: MKCoordinateRegion,
);
#[cfg(all(feature = "CPPointOfInterest", feature = "CPTemplate"))]
/// The user has selected the
/// `pointOfInterest`and the details are being shown.
#[optional]
#[unsafe(method(pointOfInterestTemplate:didSelectPointOfInterest:))]
#[unsafe(method_family = none)]
unsafe fn pointOfInterestTemplate_didSelectPointOfInterest(
&self,
point_of_interest_template: &CPPointOfInterestTemplate,
point_of_interest: &CPPointOfInterest,
);
}
);
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinteresttemplate?language=objc)
#[unsafe(super(CPTemplate, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CPTemplate")]
pub struct CPPointOfInterestTemplate;
);
#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
extern_conformance!(
unsafe impl CPBarButtonProviding for CPPointOfInterestTemplate {}
);
#[cfg(feature = "CPTemplate")]
extern_conformance!(
unsafe impl NSCoding for CPPointOfInterestTemplate {}
);
#[cfg(feature = "CPTemplate")]
extern_conformance!(
unsafe impl NSObjectProtocol for CPPointOfInterestTemplate {}
);
#[cfg(feature = "CPTemplate")]
extern_conformance!(
unsafe impl NSSecureCoding for CPPointOfInterestTemplate {}
);
#[cfg(feature = "CPTemplate")]
impl CPPointOfInterestTemplate {
extern_methods!(
#[cfg(feature = "CPPointOfInterest")]
/// CPPointOfInterestTemplate displays a map view with selectable points of interest.
///
///
/// Parameter `title`: Template title
///
/// Parameter `pointsOfInterest`: Points of interest to be presented in the map.
///
/// Parameter `selectedIndex`: Index of selected point of interest instance referenced in the pointsOfInterest array. Use NSNotFound to indicate no selection.
///
///
/// Note: the maximum number of POIs is 12. If you provide more than 12, only the first 12 will be used.
#[unsafe(method(initWithTitle:pointsOfInterest:selectedIndex:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTitle_pointsOfInterest_selectedIndex(
this: Allocated<Self>,
title: &NSString,
points_of_interest: &NSArray<CPPointOfInterest>,
selected_index: NSUInteger,
) -> Retained<Self>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
/// Template title appears on the template point of interest picker
#[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);
#[cfg(feature = "CPPointOfInterest")]
/// Update the template with a list of points of interests to dispay
///
///
/// Parameter `pointsOfInterest`: Points of interest to be presented in the map.
///
/// Parameter `selectedIndex`: Index of selected point of interest instance referenced in the pointsOfInterest array. Use NSNotFound to indicate no selection.
///
///
/// Note: the maximum number of POIs is 12. If you provide more than 12, only the first 12 will be used.
#[unsafe(method(setPointsOfInterest:selectedIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setPointsOfInterest_selectedIndex(
&self,
points_of_interest: &NSArray<CPPointOfInterest>,
selected_index: NSUInteger,
);
#[cfg(feature = "CPPointOfInterest")]
#[unsafe(method(pointsOfInterest))]
#[unsafe(method_family = none)]
pub unsafe fn pointsOfInterest(&self) -> Retained<NSArray<CPPointOfInterest>>;
/// Designate an instance in the pointsOfInterest array to highlight. Use NSNotFound to indicate no selection.
#[unsafe(method(selectedIndex))]
#[unsafe(method_family = none)]
pub unsafe fn selectedIndex(&self) -> NSUInteger;
/// Setter for [`selectedIndex`][Self::selectedIndex].
#[unsafe(method(setSelectedIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setSelectedIndex(&self, selected_index: NSUInteger);
/// The Point of Interest template's delegate is informed of user events.
#[unsafe(method(pointOfInterestDelegate))]
#[unsafe(method_family = none)]
pub unsafe fn pointOfInterestDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn CPPointOfInterestTemplateDelegate>>>;
/// Setter for [`pointOfInterestDelegate`][Self::pointOfInterestDelegate].
///
/// This is a [weak property][objc2::topics::weak_property].
#[unsafe(method(setPointOfInterestDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setPointOfInterestDelegate(
&self,
point_of_interest_delegate: Option<
&ProtocolObject<dyn CPPointOfInterestTemplateDelegate>,
>,
);
);
}