objc2_car_play/generated/
CPPointOfInterestTemplate.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_protocol!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinteresttemplatedelegate?language=objc)
14    pub unsafe trait CPPointOfInterestTemplateDelegate:
15        NSObjectProtocol + MainThreadOnly
16    {
17        #[cfg(all(feature = "CPTemplate", feature = "objc2-map-kit"))]
18        /// The user has changed the map region on the
19        /// `CPPointOfInterestTemplate.`Your application
20        /// should respond by updating
21        /// `pointsOfInterest`to show new points of interest for the new region.
22        #[unsafe(method(pointOfInterestTemplate:didChangeMapRegion:))]
23        #[unsafe(method_family = none)]
24        unsafe fn pointOfInterestTemplate_didChangeMapRegion(
25            &self,
26            point_of_interest_template: &CPPointOfInterestTemplate,
27            region: MKCoordinateRegion,
28        );
29
30        #[cfg(all(feature = "CPPointOfInterest", feature = "CPTemplate"))]
31        /// The user has selected the
32        /// `pointOfInterest`and the details are being shown.
33        #[optional]
34        #[unsafe(method(pointOfInterestTemplate:didSelectPointOfInterest:))]
35        #[unsafe(method_family = none)]
36        unsafe fn pointOfInterestTemplate_didSelectPointOfInterest(
37            &self,
38            point_of_interest_template: &CPPointOfInterestTemplate,
39            point_of_interest: &CPPointOfInterest,
40        );
41    }
42);
43
44extern_class!(
45    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cppointofinteresttemplate?language=objc)
46    #[unsafe(super(CPTemplate, NSObject))]
47    #[thread_kind = MainThreadOnly]
48    #[derive(Debug, PartialEq, Eq, Hash)]
49    #[cfg(feature = "CPTemplate")]
50    pub struct CPPointOfInterestTemplate;
51);
52
53#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
54extern_conformance!(
55    unsafe impl CPBarButtonProviding for CPPointOfInterestTemplate {}
56);
57
58#[cfg(feature = "CPTemplate")]
59extern_conformance!(
60    unsafe impl NSCoding for CPPointOfInterestTemplate {}
61);
62
63#[cfg(feature = "CPTemplate")]
64extern_conformance!(
65    unsafe impl NSObjectProtocol for CPPointOfInterestTemplate {}
66);
67
68#[cfg(feature = "CPTemplate")]
69extern_conformance!(
70    unsafe impl NSSecureCoding for CPPointOfInterestTemplate {}
71);
72
73#[cfg(feature = "CPTemplate")]
74impl CPPointOfInterestTemplate {
75    extern_methods!(
76        #[cfg(feature = "CPPointOfInterest")]
77        /// CPPointOfInterestTemplate displays a map view with selectable points of interest.
78        ///
79        ///
80        /// Parameter `title`: Template title
81        ///
82        /// Parameter `pointsOfInterest`: Points of interest to be presented in the map.
83        ///
84        /// Parameter `selectedIndex`: Index of selected point of interest instance referenced in the pointsOfInterest array. Use NSNotFound to indicate no selection.
85        ///
86        ///
87        /// Note: the maximum number of POIs is 12. If you provide more than 12, only the first 12 will be used.
88        #[unsafe(method(initWithTitle:pointsOfInterest:selectedIndex:))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn initWithTitle_pointsOfInterest_selectedIndex(
91            this: Allocated<Self>,
92            title: &NSString,
93            points_of_interest: &NSArray<CPPointOfInterest>,
94            selected_index: NSUInteger,
95        ) -> Retained<Self>;
96
97        #[unsafe(method(init))]
98        #[unsafe(method_family = init)]
99        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
100
101        #[unsafe(method(new))]
102        #[unsafe(method_family = new)]
103        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
104
105        /// Template title appears on the template point of interest picker
106        #[unsafe(method(title))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn title(&self) -> Retained<NSString>;
109
110        /// Setter for [`title`][Self::title].
111        ///
112        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
113        #[unsafe(method(setTitle:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setTitle(&self, title: &NSString);
116
117        #[cfg(feature = "CPPointOfInterest")]
118        /// Update the template with a list of points of interests to dispay
119        ///
120        ///
121        /// Parameter `pointsOfInterest`: Points of interest to be presented in the map.
122        ///
123        /// Parameter `selectedIndex`: Index of selected point of interest instance referenced in the pointsOfInterest array. Use NSNotFound to indicate no selection.
124        ///
125        ///
126        /// Note: the maximum number of POIs is 12. If you provide more than 12, only the first 12 will be used.
127        #[unsafe(method(setPointsOfInterest:selectedIndex:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setPointsOfInterest_selectedIndex(
130            &self,
131            points_of_interest: &NSArray<CPPointOfInterest>,
132            selected_index: NSUInteger,
133        );
134
135        #[cfg(feature = "CPPointOfInterest")]
136        #[unsafe(method(pointsOfInterest))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn pointsOfInterest(&self) -> Retained<NSArray<CPPointOfInterest>>;
139
140        /// Designate an instance in the pointsOfInterest array to highlight. Use NSNotFound to indicate no selection.
141        #[unsafe(method(selectedIndex))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn selectedIndex(&self) -> NSUInteger;
144
145        /// Setter for [`selectedIndex`][Self::selectedIndex].
146        #[unsafe(method(setSelectedIndex:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setSelectedIndex(&self, selected_index: NSUInteger);
149
150        /// The Point of Interest template's delegate is informed of user events.
151        #[unsafe(method(pointOfInterestDelegate))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn pointOfInterestDelegate(
154            &self,
155        ) -> Option<Retained<ProtocolObject<dyn CPPointOfInterestTemplateDelegate>>>;
156
157        /// Setter for [`pointOfInterestDelegate`][Self::pointOfInterestDelegate].
158        ///
159        /// This is a [weak property][objc2::topics::weak_property].
160        #[unsafe(method(setPointOfInterestDelegate:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn setPointOfInterestDelegate(
163            &self,
164            point_of_interest_delegate: Option<
165                &ProtocolObject<dyn CPPointOfInterestTemplateDelegate>,
166            >,
167        );
168    );
169}