objc2_car_play/generated/
CPTrip.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::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-map-kit")]
8use objc2_map_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// `CPRouteChoice`describes a possible route for a
14    /// `CPTrip.`
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cproutechoice?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct CPRouteChoice;
20);
21
22extern_conformance!(
23    unsafe impl NSCoding for CPRouteChoice {}
24);
25
26extern_conformance!(
27    unsafe impl NSCopying for CPRouteChoice {}
28);
29
30unsafe impl CopyingHelper for CPRouteChoice {
31    type Result = Self;
32}
33
34extern_conformance!(
35    unsafe impl NSObjectProtocol for CPRouteChoice {}
36);
37
38extern_conformance!(
39    unsafe impl NSSecureCoding for CPRouteChoice {}
40);
41
42impl CPRouteChoice {
43    extern_methods!(
44        /// Initialize a
45        /// `CPRouteChoice`with summary variants, additional information variants, and selection summary variants.
46        /// The variant strings should be provided as localized, displayable content.
47        #[unsafe(method(initWithSummaryVariants:additionalInformationVariants:selectionSummaryVariants:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithSummaryVariants_additionalInformationVariants_selectionSummaryVariants(
50            this: Allocated<Self>,
51            summary_variants: &NSArray<NSString>,
52            additional_information_variants: &NSArray<NSString>,
53            selection_summary_variants: &NSArray<NSString>,
54        ) -> Retained<Self>;
55
56        #[unsafe(method(init))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63
64        /// summaryVariants is an array of summary variants for this route choice, arranged from most to least preferred. You must provide at least one variant.
65        /// The system will select the first variant that fits the available space. The variant strings should be provided as localized, displayable content.
66        /// Example: "Via I-280 S"
67        #[unsafe(method(summaryVariants))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn summaryVariants(&self) -> Retained<NSArray<NSString>>;
70
71        /// selectionSummaryVariants is an array of summary variants for this route choice, arranged from most to least preferred. You must provide at least one variant.
72        /// The system will select the first variant that fits the available space.
73        #[unsafe(method(selectionSummaryVariants))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn selectionSummaryVariants(&self) -> Option<Retained<NSArray<NSString>>>;
76
77        /// 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.
78        /// The system will select the first variant that fits the available space. The variant strings should be provided as localized, displayable content.
79        /// Examples: "Fastest Route", "Avoids Tolls"
80        #[unsafe(method(additionalInformationVariants))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn additionalInformationVariants(&self) -> Option<Retained<NSArray<NSString>>>;
83
84        /// Any custom user info related to this route choice.
85        #[unsafe(method(userInfo))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
88
89        /// Setter for [`userInfo`][Self::userInfo].
90        ///
91        /// # Safety
92        ///
93        /// `user_info` should be of the correct type.
94        #[unsafe(method(setUserInfo:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
97    );
98}
99
100extern_class!(
101    /// `CPTrip`represents an origin and destination with route choices.
102    ///
103    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptrip?language=objc)
104    #[unsafe(super(NSObject))]
105    #[derive(Debug, PartialEq, Eq, Hash)]
106    pub struct CPTrip;
107);
108
109extern_conformance!(
110    unsafe impl NSCoding for CPTrip {}
111);
112
113extern_conformance!(
114    unsafe impl NSObjectProtocol for CPTrip {}
115);
116
117extern_conformance!(
118    unsafe impl NSSecureCoding for CPTrip {}
119);
120
121impl CPTrip {
122    extern_methods!(
123        #[cfg(feature = "objc2-map-kit")]
124        /// Initialize a
125        /// `CPTrip`with an origin item, destination item, and route choices.
126        #[unsafe(method(initWithOrigin:destination:routeChoices:))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn initWithOrigin_destination_routeChoices(
129            this: Allocated<Self>,
130            origin: &MKMapItem,
131            destination: &MKMapItem,
132            route_choices: &NSArray<CPRouteChoice>,
133        ) -> Retained<Self>;
134
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138
139        #[unsafe(method(new))]
140        #[unsafe(method_family = new)]
141        pub unsafe fn new() -> Retained<Self>;
142
143        #[cfg(feature = "objc2-map-kit")]
144        /// `MKMapItem`representing the origin for the trip.
145        #[unsafe(method(origin))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn origin(&self) -> Retained<MKMapItem>;
148
149        #[cfg(feature = "objc2-map-kit")]
150        /// `MKMapItem`representing the destination for the trip.
151        #[unsafe(method(destination))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn destination(&self) -> Retained<MKMapItem>;
154
155        /// Array of
156        /// `CPRouteChoices`for the trip.
157        #[unsafe(method(routeChoices))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn routeChoices(&self) -> Retained<NSArray<CPRouteChoice>>;
160
161        /// Any custom user info related to this trip.
162        #[unsafe(method(userInfo))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
165
166        /// Setter for [`userInfo`][Self::userInfo].
167        ///
168        /// # Safety
169        ///
170        /// `user_info` should be of the correct type.
171        #[unsafe(method(setUserInfo:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
174
175        /// destinationNameVariants is an array of
176        /// `NSString`representing the name of the destination for
177        /// this trip, arranged from most to least preferred. You must provide at least one variant.
178        /// The variant strings should be provided as localized, displayable content.
179        #[unsafe(method(destinationNameVariants))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn destinationNameVariants(&self) -> Option<Retained<NSArray<NSString>>>;
182
183        /// Setter for [`destinationNameVariants`][Self::destinationNameVariants].
184        ///
185        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
186        #[unsafe(method(setDestinationNameVariants:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn setDestinationNameVariants(
189            &self,
190            destination_name_variants: Option<&NSArray<NSString>>,
191        );
192    );
193}