objc2_car_play/generated/
CPMapTemplate.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-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppandirection?language=objc)
15// NS_OPTIONS
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct CPPanDirection(pub NSInteger);
19bitflags::bitflags! {
20    impl CPPanDirection: NSInteger {
21        #[doc(alias = "CPPanDirectionNone")]
22        const None = 0;
23        #[doc(alias = "CPPanDirectionLeft")]
24        const Left = 1<<0;
25        #[doc(alias = "CPPanDirectionRight")]
26        const Right = 1<<1;
27        #[doc(alias = "CPPanDirectionUp")]
28        const Up = 1<<2;
29        #[doc(alias = "CPPanDirectionDown")]
30        const Down = 1<<3;
31    }
32}
33
34unsafe impl Encode for CPPanDirection {
35    const ENCODING: Encoding = NSInteger::ENCODING;
36}
37
38unsafe impl RefEncode for CPPanDirection {
39    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpmaneuverdisplaystyle?language=objc)
43// NS_OPTIONS
44#[repr(transparent)]
45#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
46pub struct CPManeuverDisplayStyle(pub NSInteger);
47bitflags::bitflags! {
48    impl CPManeuverDisplayStyle: NSInteger {
49        #[doc(alias = "CPManeuverDisplayStyleDefault")]
50        const Default = 0;
51        #[doc(alias = "CPManeuverDisplayStyleLeadingSymbol")]
52        const LeadingSymbol = 1;
53        #[doc(alias = "CPManeuverDisplayStyleTrailingSymbol")]
54        const TrailingSymbol = 2;
55        #[doc(alias = "CPManeuverDisplayStyleSymbolOnly")]
56        const SymbolOnly = 3;
57        #[doc(alias = "CPManeuverDisplayStyleInstructionOnly")]
58        const InstructionOnly = 4;
59    }
60}
61
62unsafe impl Encode for CPManeuverDisplayStyle {
63    const ENCODING: Encoding = NSInteger::ENCODING;
64}
65
66unsafe impl RefEncode for CPManeuverDisplayStyle {
67    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
68}
69
70/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptimeremainingcolor?language=objc)
71// NS_ENUM
72#[repr(transparent)]
73#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
74pub struct CPTimeRemainingColor(pub NSUInteger);
75impl CPTimeRemainingColor {
76    #[doc(alias = "CPTimeRemainingColorDefault")]
77    pub const Default: Self = Self(0);
78    #[doc(alias = "CPTimeRemainingColorGreen")]
79    pub const Green: Self = Self(1);
80    #[doc(alias = "CPTimeRemainingColorOrange")]
81    pub const Orange: Self = Self(2);
82    #[doc(alias = "CPTimeRemainingColorRed")]
83    pub const Red: Self = Self(3);
84}
85
86unsafe impl Encode for CPTimeRemainingColor {
87    const ENCODING: Encoding = NSUInteger::ENCODING;
88}
89
90unsafe impl RefEncode for CPTimeRemainingColor {
91    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
92}
93
94/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptripestimatestyle?language=objc)
95// NS_ENUM
96#[repr(transparent)]
97#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
98pub struct CPTripEstimateStyle(pub NSUInteger);
99impl CPTripEstimateStyle {
100    #[doc(alias = "CPTripEstimateStyleLight")]
101    pub const Light: Self = Self(0);
102    #[doc(alias = "CPTripEstimateStyleDark")]
103    pub const Dark: Self = Self(1);
104}
105
106unsafe impl Encode for CPTripEstimateStyle {
107    const ENCODING: Encoding = NSUInteger::ENCODING;
108}
109
110unsafe impl RefEncode for CPTripEstimateStyle {
111    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
112}
113
114extern_class!(
115    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpmaptemplate?language=objc)
116    #[unsafe(super(CPTemplate, NSObject))]
117    #[thread_kind = MainThreadOnly]
118    #[derive(Debug, PartialEq, Eq, Hash)]
119    #[cfg(feature = "CPTemplate")]
120    pub struct CPMapTemplate;
121);
122
123#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
124extern_conformance!(
125    unsafe impl CPBarButtonProviding for CPMapTemplate {}
126);
127
128#[cfg(feature = "CPTemplate")]
129extern_conformance!(
130    unsafe impl NSCoding for CPMapTemplate {}
131);
132
133#[cfg(feature = "CPTemplate")]
134extern_conformance!(
135    unsafe impl NSObjectProtocol for CPMapTemplate {}
136);
137
138#[cfg(feature = "CPTemplate")]
139extern_conformance!(
140    unsafe impl NSSecureCoding for CPMapTemplate {}
141);
142
143#[cfg(feature = "CPTemplate")]
144impl CPMapTemplate {
145    extern_methods!(
146        #[cfg(feature = "objc2-ui-kit")]
147        /// Background color to use when displaying guidance. The system will automatically determine if the provided
148        /// color meets contrast requirements. If the provided color does not meet contrast requirements, the system
149        /// default will be used. Font color will automatically be adjusted by the system to correspond with this color.
150        /// Alpha values will be ignored.
151        #[unsafe(method(guidanceBackgroundColor))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn guidanceBackgroundColor(&self) -> Retained<UIColor>;
154
155        #[cfg(feature = "objc2-ui-kit")]
156        /// Setter for [`guidanceBackgroundColor`][Self::guidanceBackgroundColor].
157        #[unsafe(method(setGuidanceBackgroundColor:))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn setGuidanceBackgroundColor(&self, guidance_background_color: &UIColor);
160
161        /// The style used to display trip estimates during active navigation. If not set, will update automatically with changes to UIUserInterfaceStyle.
162        #[unsafe(method(tripEstimateStyle))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn tripEstimateStyle(&self) -> CPTripEstimateStyle;
165
166        /// Setter for [`tripEstimateStyle`][Self::tripEstimateStyle].
167        #[unsafe(method(setTripEstimateStyle:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn setTripEstimateStyle(&self, trip_estimate_style: CPTripEstimateStyle);
170
171        #[cfg(feature = "CPMapButton")]
172        /// An array of bar buttons to be displayed on the trailing bottom corner of the map template.
173        ///
174        /// Note: The map template may display a maximum of 4 buttons. Setting more than 4 buttons to this
175        /// property will only display the first 4 buttons.
176        #[unsafe(method(mapButtons))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn mapButtons(&self) -> Retained<NSArray<CPMapButton>>;
179
180        #[cfg(feature = "CPMapButton")]
181        /// Setter for [`mapButtons`][Self::mapButtons].
182        #[unsafe(method(setMapButtons:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn setMapButtons(&self, map_buttons: &NSArray<CPMapButton>);
185
186        #[cfg(all(feature = "CPTrip", feature = "CPTripPreviewTextConfiguration"))]
187        /// Display a preview for a trip. Used to provide an overview for the upcoming trip or can show multiple trip options,
188        /// such as for search results. Trip previews can appear over an active navigation session. Number of trips will be
189        /// limited to 12.
190        #[unsafe(method(showTripPreviews:textConfiguration:))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn showTripPreviews_textConfiguration(
193            &self,
194            trip_previews: &NSArray<CPTrip>,
195            text_configuration: Option<&CPTripPreviewTextConfiguration>,
196        );
197
198        #[cfg(all(feature = "CPTrip", feature = "CPTripPreviewTextConfiguration"))]
199        /// Display a preview for a trip. Used to provide an overview for the upcoming trip or can show multiple trip options,
200        /// such as for search results. Trip previews can appear over an active navigation session. Number of trips will be
201        /// limited to 12. Optionally provide a CPTrip object from the list of trips to be selected when initially presented.
202        #[unsafe(method(showTripPreviews:selectedTrip:textConfiguration:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn showTripPreviews_selectedTrip_textConfiguration(
205            &self,
206            trip_previews: &NSArray<CPTrip>,
207            selected_trip: Option<&CPTrip>,
208            text_configuration: Option<&CPTripPreviewTextConfiguration>,
209        );
210
211        #[cfg(all(feature = "CPTrip", feature = "CPTripPreviewTextConfiguration"))]
212        /// Display the route choices for a single trip. Trip previews can appear over an active navigation session.
213        #[unsafe(method(showRouteChoicesPreviewForTrip:textConfiguration:))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn showRouteChoicesPreviewForTrip_textConfiguration(
216            &self,
217            trip_preview: &CPTrip,
218            text_configuration: Option<&CPTripPreviewTextConfiguration>,
219        );
220
221        /// Stop displaying any currently shown trip previews.
222        #[unsafe(method(hideTripPreviews))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn hideTripPreviews(&self);
225
226        #[cfg(all(feature = "CPTravelEstimates", feature = "CPTrip"))]
227        /// Updates the arrival time, time remaining and distance remaining estimates for a trip preview or actively navigating trip with the default color for time remaining.
228        #[unsafe(method(updateTravelEstimates:forTrip:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn updateTravelEstimates_forTrip(
231            &self,
232            estimates: &CPTravelEstimates,
233            trip: &CPTrip,
234        );
235
236        #[cfg(all(feature = "CPTravelEstimates", feature = "CPTrip"))]
237        /// Updates the arrival time, time remaining and distance remaining estimates for a trip preview or actively navigating trip with a specified color for time remaining.
238        #[unsafe(method(updateTravelEstimates:forTrip:withTimeRemainingColor:))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn updateTravelEstimates_forTrip_withTimeRemainingColor(
241            &self,
242            estimates: &CPTravelEstimates,
243            trip: &CPTrip,
244            time_remaining_color: CPTimeRemainingColor,
245        );
246
247        #[cfg(all(feature = "CPNavigationSession", feature = "CPTrip"))]
248        /// Begins guidance for a trip.
249        ///
250        /// Returns: CPNavigationSession maintain a reference to the navigation session to perform guidance updates
251        #[unsafe(method(startNavigationSessionForTrip:))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn startNavigationSessionForTrip(
254            &self,
255            trip: &CPTrip,
256        ) -> Retained<CPNavigationSession>;
257
258        /// Automatically shows and hides the navigation bar. Defaults to YES.
259        #[unsafe(method(automaticallyHidesNavigationBar))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn automaticallyHidesNavigationBar(&self) -> bool;
262
263        /// Setter for [`automaticallyHidesNavigationBar`][Self::automaticallyHidesNavigationBar].
264        #[unsafe(method(setAutomaticallyHidesNavigationBar:))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn setAutomaticallyHidesNavigationBar(
267            &self,
268            automatically_hides_navigation_bar: bool,
269        );
270
271        /// Hides the map buttons when hiding the navigation bar. Defaults to YES.
272        #[unsafe(method(hidesButtonsWithNavigationBar))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn hidesButtonsWithNavigationBar(&self) -> bool;
275
276        /// Setter for [`hidesButtonsWithNavigationBar`][Self::hidesButtonsWithNavigationBar].
277        #[unsafe(method(setHidesButtonsWithNavigationBar:))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn setHidesButtonsWithNavigationBar(
280            &self,
281            hides_buttons_with_navigation_bar: bool,
282        );
283
284        #[unsafe(method(mapDelegate))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn mapDelegate(
287            &self,
288        ) -> Option<Retained<ProtocolObject<dyn CPMapTemplateDelegate>>>;
289
290        /// Setter for [`mapDelegate`][Self::mapDelegate].
291        ///
292        /// This is a [weak property][objc2::topics::weak_property].
293        #[unsafe(method(setMapDelegate:))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn setMapDelegate(
296            &self,
297            map_delegate: Option<&ProtocolObject<dyn CPMapTemplateDelegate>>,
298        );
299
300        /// Shows the panning interface on the map interface if not already visible.
301        ///
302        /// When showing the panning interface, a maximum of two mapButtons will be visible.
303        /// If more than two mapButtons are visible when the template transitions to panning mode,
304        /// the system will hide one or more map buttons beginning from the end of the mapButtons array.
305        ///
306        ///
307        /// Note: The system will not provide a button to dismiss the UI. You are required to provide
308        /// a button in the map template navigation bar that will dismiss the panning interface.
309        #[unsafe(method(showPanningInterfaceAnimated:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn showPanningInterfaceAnimated(&self, animated: bool);
312
313        /// Dismisses the panning interface on the map interface if it is visible.
314        ///
315        /// Note: When dismissing the panning interface, mapButtons previously hidden by the system will no longer be hidden.
316        #[unsafe(method(dismissPanningInterfaceAnimated:))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn dismissPanningInterfaceAnimated(&self, animated: bool);
319
320        /// Returns YES when the panning interface is visible.
321        #[unsafe(method(isPanningInterfaceVisible))]
322        #[unsafe(method_family = none)]
323        pub unsafe fn isPanningInterfaceVisible(&self) -> bool;
324
325        #[cfg(feature = "CPNavigationAlert")]
326        /// The currently-visible navigation alert, if any.
327        #[unsafe(method(currentNavigationAlert))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn currentNavigationAlert(&self) -> Option<Retained<CPNavigationAlert>>;
330
331        #[cfg(feature = "CPNavigationAlert")]
332        /// Display a navigation alert on this map template. Your
333        /// `CPMapTemplateDelegate`will be notified
334        /// of navigation alert lifecycle events.
335        ///
336        ///
337        /// Parameter `navigationAlert`: The navigation alert to display.
338        ///
339        /// Parameter `animated`: YES to animate the presentation of this alert, or NO to display it immediately.
340        ///
341        ///
342        /// Warning: If a navigation alert is already visible, this method has no effect.
343        /// You must dismiss the currently-visible navigation alert before presenting a new alert.
344        #[unsafe(method(presentNavigationAlert:animated:))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn presentNavigationAlert_animated(
347            &self,
348            navigation_alert: &CPNavigationAlert,
349            animated: bool,
350        );
351
352        #[cfg(feature = "block2")]
353        /// Dismiss the currently-visible navigation alert on this map template.
354        ///
355        ///
356        /// Parameter `animated`: Whether the dismissal should be animated (YES) or not (NO).
357        ///
358        /// Parameter `completion`: A block invoked after the alert has been dismissed. The BOOL argument
359        /// in the completion block indicates whether any visible alert was dismissed (YES) or
360        /// if no action was taken because there was no alert to dismiss (NO).
361        #[unsafe(method(dismissNavigationAlertAnimated:completion:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn dismissNavigationAlertAnimated_completion(
364            &self,
365            animated: bool,
366            completion: &block2::DynBlock<dyn Fn(Bool)>,
367        );
368    );
369}
370
371/// Methods declared on superclass `NSObject`.
372#[cfg(feature = "CPTemplate")]
373impl CPMapTemplate {
374    extern_methods!(
375        #[unsafe(method(init))]
376        #[unsafe(method_family = init)]
377        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
378
379        #[unsafe(method(new))]
380        #[unsafe(method_family = new)]
381        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
382    );
383}
384
385extern_protocol!(
386    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpmaptemplatedelegate?language=objc)
387    pub unsafe trait CPMapTemplateDelegate: NSObjectProtocol + MainThreadOnly {
388        #[cfg(feature = "CPTemplate")]
389        /// Determines if the template should provide navigation metadata.
390        ///
391        /// Returns: YES if the template should provide navigation metadata, otherwise NO
392        #[optional]
393        #[unsafe(method(mapTemplateShouldProvideNavigationMetadata:))]
394        #[unsafe(method_family = none)]
395        unsafe fn mapTemplateShouldProvideNavigationMetadata(
396            &self,
397            map_template: &CPMapTemplate,
398        ) -> bool;
399
400        #[cfg(all(feature = "CPManeuver", feature = "CPTemplate"))]
401        /// Determines if the maneuver should be presented as a notification when the app is in the background.
402        ///
403        /// Returns: YES if the maneuver should appear as a notification, otherwise NO
404        #[optional]
405        #[unsafe(method(mapTemplate:shouldShowNotificationForManeuver:))]
406        #[unsafe(method_family = none)]
407        unsafe fn mapTemplate_shouldShowNotificationForManeuver(
408            &self,
409            map_template: &CPMapTemplate,
410            maneuver: &CPManeuver,
411        ) -> bool;
412
413        #[cfg(all(
414            feature = "CPManeuver",
415            feature = "CPTemplate",
416            feature = "CPTravelEstimates"
417        ))]
418        /// Determines if the updated distance remaining for the maneuver should be presented as a notification when the app is in the background.
419        ///
420        /// Returns: YES if the updated estimates should appear in the notification, otherwise NO
421        #[optional]
422        #[unsafe(method(mapTemplate:shouldUpdateNotificationForManeuver:withTravelEstimates:))]
423        #[unsafe(method_family = none)]
424        unsafe fn mapTemplate_shouldUpdateNotificationForManeuver_withTravelEstimates(
425            &self,
426            map_template: &CPMapTemplate,
427            maneuver: &CPManeuver,
428            travel_estimates: &CPTravelEstimates,
429        ) -> bool;
430
431        #[cfg(all(feature = "CPNavigationAlert", feature = "CPTemplate"))]
432        /// Determines if the navigation alert should be presented as a notification when the app is in the background.
433        ///
434        /// Returns: YES if the alert should appear as a notification, otherwise NO
435        #[optional]
436        #[unsafe(method(mapTemplate:shouldShowNotificationForNavigationAlert:))]
437        #[unsafe(method_family = none)]
438        unsafe fn mapTemplate_shouldShowNotificationForNavigationAlert(
439            &self,
440            map_template: &CPMapTemplate,
441            navigation_alert: &CPNavigationAlert,
442        ) -> bool;
443
444        #[cfg(feature = "CPTemplate")]
445        /// This will be called when the pan interface appears on the map interface.
446        #[optional]
447        #[unsafe(method(mapTemplateDidShowPanningInterface:))]
448        #[unsafe(method_family = none)]
449        unsafe fn mapTemplateDidShowPanningInterface(&self, map_template: &CPMapTemplate);
450
451        #[cfg(feature = "CPTemplate")]
452        /// This will be called when the pan interface will disappear on the map interface.
453        #[optional]
454        #[unsafe(method(mapTemplateWillDismissPanningInterface:))]
455        #[unsafe(method_family = none)]
456        unsafe fn mapTemplateWillDismissPanningInterface(&self, map_template: &CPMapTemplate);
457
458        #[cfg(feature = "CPTemplate")]
459        /// This will be called when the pan interface disappears on the map interface.
460        #[optional]
461        #[unsafe(method(mapTemplateDidDismissPanningInterface:))]
462        #[unsafe(method_family = none)]
463        unsafe fn mapTemplateDidDismissPanningInterface(&self, map_template: &CPMapTemplate);
464
465        #[cfg(feature = "CPTemplate")]
466        /// Called when a pan button is pressed/selected for an extended duration.
467        #[optional]
468        #[unsafe(method(mapTemplate:panBeganWithDirection:))]
469        #[unsafe(method_family = none)]
470        unsafe fn mapTemplate_panBeganWithDirection(
471            &self,
472            map_template: &CPMapTemplate,
473            direction: CPPanDirection,
474        );
475
476        #[cfg(feature = "CPTemplate")]
477        /// Called when a pan button is released after an extended duration.
478        #[optional]
479        #[unsafe(method(mapTemplate:panEndedWithDirection:))]
480        #[unsafe(method_family = none)]
481        unsafe fn mapTemplate_panEndedWithDirection(
482            &self,
483            map_template: &CPMapTemplate,
484            direction: CPPanDirection,
485        );
486
487        #[cfg(feature = "CPTemplate")]
488        /// Called when a pan button is pressed/selected momentarily.
489        #[optional]
490        #[unsafe(method(mapTemplate:panWithDirection:))]
491        #[unsafe(method_family = none)]
492        unsafe fn mapTemplate_panWithDirection(
493            &self,
494            map_template: &CPMapTemplate,
495            direction: CPPanDirection,
496        );
497
498        #[cfg(feature = "CPTemplate")]
499        /// Called when a pan gesture begins. May not be called when connected to some CarPlay systems.
500        #[optional]
501        #[unsafe(method(mapTemplateDidBeginPanGesture:))]
502        #[unsafe(method_family = none)]
503        unsafe fn mapTemplateDidBeginPanGesture(&self, map_template: &CPMapTemplate);
504
505        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
506        /// Called when a pan gesture changes. May not be called when connected to some CarPlay systems.
507        #[optional]
508        #[unsafe(method(mapTemplate:didUpdatePanGestureWithTranslation:velocity:))]
509        #[unsafe(method_family = none)]
510        unsafe fn mapTemplate_didUpdatePanGestureWithTranslation_velocity(
511            &self,
512            map_template: &CPMapTemplate,
513            translation: CGPoint,
514            velocity: CGPoint,
515        );
516
517        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
518        /// Called when a pan gesture ends. May not be called when connected to some CarPlay systems.
519        #[optional]
520        #[unsafe(method(mapTemplate:didEndPanGestureWithVelocity:))]
521        #[unsafe(method_family = none)]
522        unsafe fn mapTemplate_didEndPanGestureWithVelocity(
523            &self,
524            map_template: &CPMapTemplate,
525            velocity: CGPoint,
526        );
527
528        #[cfg(feature = "CPTemplate")]
529        /// Tells the delegate that the zoom gesture started.
530        ///
531        /// - Parameters:
532        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
533        #[optional]
534        #[unsafe(method(mapTemplateDidBeginZoomGesture:))]
535        #[unsafe(method_family = none)]
536        unsafe fn mapTemplateDidBeginZoomGesture(&self, map_template: &CPMapTemplate);
537
538        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
539        /// Tells the delegate that a person is zooming on the map.
540        ///
541        /// - Parameters:
542        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
543        /// - center: A ``CGPoint`` that indicates the center point of the zoom.
544        /// - scale: A ``CGFloat`` that indicates the scale factor relative to the zoom gesture in screen coordinates.
545        /// - velocity: The velocity of the zoom gesture in scale factor per second.
546        #[optional]
547        #[unsafe(method(mapTemplate:didUpdateZoomGestureWithCenter:scale:velocity:))]
548        #[unsafe(method_family = none)]
549        unsafe fn mapTemplate_didUpdateZoomGestureWithCenter_scale_velocity(
550            &self,
551            map_template: &CPMapTemplate,
552            center: CGPoint,
553            scale: CGFloat,
554            velocity: CGFloat,
555        );
556
557        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
558        /// Tells the delegate that a person stopped zooming the map.
559        ///
560        /// - Parameters:
561        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
562        /// - velocity: The velocity of the zoom gesture in scale factor per second.
563        #[optional]
564        #[unsafe(method(mapTemplate:didEndZoomGestureWithVelocity:))]
565        #[unsafe(method_family = none)]
566        unsafe fn mapTemplate_didEndZoomGestureWithVelocity(
567            &self,
568            map_template: &CPMapTemplate,
569            velocity: CGFloat,
570        );
571
572        #[cfg(feature = "CPTemplate")]
573        /// Tells the delegate that the rotation gesture started.
574        ///
575        /// - Parameters:
576        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
577        #[optional]
578        #[unsafe(method(mapTemplateDidBeginRotationGesture:))]
579        #[unsafe(method_family = none)]
580        unsafe fn mapTemplateDidBeginRotationGesture(&self, map_template: &CPMapTemplate);
581
582        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
583        /// Tells the delegate that a person is rotating the map.
584        ///
585        /// - Parameters:
586        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
587        /// - center: A ``CGPoint`` that indicates the center between two fingers performing the rotation gesture.
588        /// - rotation: A ``CGFloat`` that indicates the rotation of the gesture in radians.
589        /// - velocity: The velocity of the rotation gesture in radians per second.
590        #[optional]
591        #[unsafe(method(mapTemplate:didRotateWithCenter:rotation:velocity:))]
592        #[unsafe(method_family = none)]
593        unsafe fn mapTemplate_didRotateWithCenter_rotation_velocity(
594            &self,
595            map_template: &CPMapTemplate,
596            center: CGPoint,
597            rotation: CGFloat,
598            velocity: CGFloat,
599        );
600
601        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
602        /// Tells the delegate that a person stopped rotating the map.
603        ///
604        /// - Parameters:
605        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
606        /// - velocity: The velocity of the rotation gesture in radians per second.
607        #[optional]
608        #[unsafe(method(mapTemplate:rotationDidEndWithVelocity:))]
609        #[unsafe(method_family = none)]
610        unsafe fn mapTemplate_rotationDidEndWithVelocity(
611            &self,
612            map_template: &CPMapTemplate,
613            velocity: CGFloat,
614        );
615
616        #[cfg(feature = "CPTemplate")]
617        /// Tells the delegate that the pitch gesture started.
618        ///
619        /// - Parameters:
620        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
621        #[optional]
622        #[unsafe(method(mapTemplateDidBeginPitchGesture:))]
623        #[unsafe(method_family = none)]
624        unsafe fn mapTemplateDidBeginPitchGesture(&self, map_template: &CPMapTemplate);
625
626        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
627        /// Called when a pitch gesture changes. May not be called when connected to some CarPlay systems
628        ///
629        /// Tells the delegate that a person is pitching the map.
630        ///
631        /// - Parameters:
632        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
633        /// - center: A ``CGPoint`` that indicates the center between two fingers performing the pitch gesture.
634        #[optional]
635        #[unsafe(method(mapTemplate:pitchWithCenter:))]
636        #[unsafe(method_family = none)]
637        unsafe fn mapTemplate_pitchWithCenter(&self, map_template: &CPMapTemplate, center: CGPoint);
638
639        #[cfg(all(feature = "CPTemplate", feature = "objc2-core-foundation"))]
640        /// Tells the delegate that a person stopped pitching the map.
641        ///
642        /// - Parameters:
643        /// - mapTemplate: The ``CPMapTemplate`` the gesture applies to.
644        /// - center: A ``CGPoint`` that indicates the center between two fingers performing the pitch gesture.
645        #[optional]
646        #[unsafe(method(mapTemplate:pitchEndedWithCenter:))]
647        #[unsafe(method_family = none)]
648        unsafe fn mapTemplate_pitchEndedWithCenter(
649            &self,
650            map_template: &CPMapTemplate,
651            center: CGPoint,
652        );
653
654        #[cfg(all(feature = "CPNavigationAlert", feature = "CPTemplate"))]
655        /// Called when the map interface is about to display a navigation alert.
656        #[optional]
657        #[unsafe(method(mapTemplate:willShowNavigationAlert:))]
658        #[unsafe(method_family = none)]
659        unsafe fn mapTemplate_willShowNavigationAlert(
660            &self,
661            map_template: &CPMapTemplate,
662            navigation_alert: &CPNavigationAlert,
663        );
664
665        #[cfg(all(feature = "CPNavigationAlert", feature = "CPTemplate"))]
666        /// Called when the map interface has displayed a navigation alert.
667        ///
668        /// To take action in response to button presses on the navigation alert, see -[CPAlertAction handler].
669        #[optional]
670        #[unsafe(method(mapTemplate:didShowNavigationAlert:))]
671        #[unsafe(method_family = none)]
672        unsafe fn mapTemplate_didShowNavigationAlert(
673            &self,
674            map_template: &CPMapTemplate,
675            navigation_alert: &CPNavigationAlert,
676        );
677
678        #[cfg(all(feature = "CPNavigationAlert", feature = "CPTemplate"))]
679        /// Called when the map interface is preparing to dismiss a navigation alert.
680        #[optional]
681        #[unsafe(method(mapTemplate:willDismissNavigationAlert:dismissalContext:))]
682        #[unsafe(method_family = none)]
683        unsafe fn mapTemplate_willDismissNavigationAlert_dismissalContext(
684            &self,
685            map_template: &CPMapTemplate,
686            navigation_alert: &CPNavigationAlert,
687            dismissal_context: CPNavigationAlertDismissalContext,
688        );
689
690        #[cfg(all(feature = "CPNavigationAlert", feature = "CPTemplate"))]
691        /// Called when the map interface has completed dismissal of a navigation alert.
692        #[optional]
693        #[unsafe(method(mapTemplate:didDismissNavigationAlert:dismissalContext:))]
694        #[unsafe(method_family = none)]
695        unsafe fn mapTemplate_didDismissNavigationAlert_dismissalContext(
696            &self,
697            map_template: &CPMapTemplate,
698            navigation_alert: &CPNavigationAlert,
699            dismissal_context: CPNavigationAlertDismissalContext,
700        );
701
702        #[cfg(all(feature = "CPTemplate", feature = "CPTrip"))]
703        /// Called when the user has selected a route choice to preview.
704        #[optional]
705        #[unsafe(method(mapTemplate:selectedPreviewForTrip:usingRouteChoice:))]
706        #[unsafe(method_family = none)]
707        unsafe fn mapTemplate_selectedPreviewForTrip_usingRouteChoice(
708            &self,
709            map_template: &CPMapTemplate,
710            trip: &CPTrip,
711            route_choice: &CPRouteChoice,
712        );
713
714        #[cfg(all(feature = "CPTemplate", feature = "CPTrip"))]
715        /// Called when the user has selected a route choice to navigate.
716        #[optional]
717        #[unsafe(method(mapTemplate:startedTrip:usingRouteChoice:))]
718        #[unsafe(method_family = none)]
719        unsafe fn mapTemplate_startedTrip_usingRouteChoice(
720            &self,
721            map_template: &CPMapTemplate,
722            trip: &CPTrip,
723            route_choice: &CPRouteChoice,
724        );
725
726        #[cfg(feature = "CPTemplate")]
727        /// Called when navigation has been canceled by the system.
728        ///
729        ///
730        /// Note: In CarPlay systems that have native navigation, it is expected that only either the native navigation or the iPhone
731        /// can be actively navigating. When navigation begins in the native system, all CarPlay supported navigation
732        /// apps that are actively navigating will need to end their navigation session.
733        #[optional]
734        #[unsafe(method(mapTemplateDidCancelNavigation:))]
735        #[unsafe(method_family = none)]
736        unsafe fn mapTemplateDidCancelNavigation(&self, map_template: &CPMapTemplate);
737
738        #[cfg(all(feature = "CPManeuver", feature = "CPTemplate"))]
739        /// Changes the visual layout of the maneuver.
740        ///
741        /// Returns: a CPManeuverDisplayStyle value representing the style to be used for displaying the maneuver
742        #[optional]
743        #[unsafe(method(mapTemplate:displayStyleForManeuver:))]
744        #[unsafe(method_family = none)]
745        unsafe fn mapTemplate_displayStyleForManeuver(
746            &self,
747            map_template: &CPMapTemplate,
748            maneuver: &CPManeuver,
749        ) -> CPManeuverDisplayStyle;
750    }
751);