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
//! 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_class!(
/// `CPRouteChoice`describes a possible route for a
/// `CPTrip.`
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cproutechoice?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CPRouteChoice;
);
extern_conformance!(
unsafe impl NSCoding for CPRouteChoice {}
);
extern_conformance!(
unsafe impl NSCopying for CPRouteChoice {}
);
unsafe impl CopyingHelper for CPRouteChoice {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CPRouteChoice {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CPRouteChoice {}
);
impl CPRouteChoice {
extern_methods!(
/// Initialize a
/// `CPRouteChoice`with summary variants, additional information variants, and selection summary variants.
/// The variant strings should be provided as localized, displayable content.
#[unsafe(method(initWithSummaryVariants:additionalInformationVariants:selectionSummaryVariants:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSummaryVariants_additionalInformationVariants_selectionSummaryVariants(
this: Allocated<Self>,
summary_variants: &NSArray<NSString>,
additional_information_variants: &NSArray<NSString>,
selection_summary_variants: &NSArray<NSString>,
) -> 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() -> Retained<Self>;
/// summaryVariants is an array of summary variants for this route choice, arranged from most to least preferred. You must provide at least one variant.
/// The system will select the first variant that fits the available space. The variant strings should be provided as localized, displayable content.
/// Example: "Via I-280 S"
#[unsafe(method(summaryVariants))]
#[unsafe(method_family = none)]
pub unsafe fn summaryVariants(&self) -> Retained<NSArray<NSString>>;
/// selectionSummaryVariants is an array of summary variants for this route choice, arranged from most to least preferred. You must provide at least one variant.
/// The system will select the first variant that fits the available space.
#[unsafe(method(selectionSummaryVariants))]
#[unsafe(method_family = none)]
pub unsafe fn selectionSummaryVariants(&self) -> Option<Retained<NSArray<NSString>>>;
/// additionalInformationVariants is an array of additional information variants for this route choice, arranged from most to least preferred. You must provide at least one variant.
/// The system will select the first variant that fits the available space. The variant strings should be provided as localized, displayable content.
/// Examples: "Fastest Route", "Avoids Tolls"
#[unsafe(method(additionalInformationVariants))]
#[unsafe(method_family = none)]
pub unsafe fn additionalInformationVariants(&self) -> Option<Retained<NSArray<NSString>>>;
/// Any custom user info related to this route choice.
#[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>);
);
}
extern_class!(
/// `CPTrip`represents an origin and destination with route choices.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptrip?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CPTrip;
);
extern_conformance!(
unsafe impl NSCoding for CPTrip {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for CPTrip {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CPTrip {}
);
impl CPTrip {
extern_methods!(
#[cfg(feature = "objc2-map-kit")]
/// Initialize a
/// `CPTrip`with an origin item, destination item, and route choices.
#[unsafe(method(initWithOrigin:destination:routeChoices:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithOrigin_destination_routeChoices(
this: Allocated<Self>,
origin: &MKMapItem,
destination: &MKMapItem,
route_choices: &NSArray<CPRouteChoice>,
) -> 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() -> Retained<Self>;
#[cfg(feature = "objc2-map-kit")]
/// `MKMapItem`representing the origin for the trip.
#[unsafe(method(origin))]
#[unsafe(method_family = none)]
pub unsafe fn origin(&self) -> Retained<MKMapItem>;
#[cfg(feature = "objc2-map-kit")]
/// `MKMapItem`representing the destination for the trip.
#[unsafe(method(destination))]
#[unsafe(method_family = none)]
pub unsafe fn destination(&self) -> Retained<MKMapItem>;
/// Array of
/// `CPRouteChoices`for the trip.
#[unsafe(method(routeChoices))]
#[unsafe(method_family = none)]
pub unsafe fn routeChoices(&self) -> Retained<NSArray<CPRouteChoice>>;
/// Any custom user info related to this trip.
#[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>);
/// destinationNameVariants is an array of
/// `NSString`representing the name of the destination for
/// this trip, arranged from most to least preferred. You must provide at least one variant.
/// The variant strings should be provided as localized, displayable content.
#[unsafe(method(destinationNameVariants))]
#[unsafe(method_family = none)]
pub unsafe fn destinationNameVariants(&self) -> Option<Retained<NSArray<NSString>>>;
/// Setter for [`destinationNameVariants`][Self::destinationNameVariants].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setDestinationNameVariants:))]
#[unsafe(method_family = none)]
pub unsafe fn setDestinationNameVariants(
&self,
destination_name_variants: Option<&NSArray<NSString>>,
);
);
}