objc2_map_kit/generated/
MKMapItem.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-location")]
7use objc2_core_location::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitem?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct MKMapItem;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for MKMapItem {}
21);
22
23impl MKMapItem {
24    extern_methods!(
25        #[cfg(feature = "MKMapItemIdentifier")]
26        #[unsafe(method(identifier))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn identifier(&self) -> Option<Retained<MKMapItemIdentifier>>;
29
30        #[cfg(feature = "MKMapItemIdentifier")]
31        #[unsafe(method(alternateIdentifiers))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn alternateIdentifiers(&self) -> Retained<NSSet<MKMapItemIdentifier>>;
34
35        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
36        #[deprecated = "Use location, address and addressRepresentations instead"]
37        #[unsafe(method(placemark))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn placemark(&self) -> Retained<MKPlacemark>;
40
41        #[unsafe(method(isCurrentLocation))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn isCurrentLocation(&self) -> bool;
44
45        #[cfg(feature = "objc2-core-location")]
46        #[unsafe(method(location))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn location(&self) -> Retained<CLLocation>;
49
50        #[cfg(feature = "MKAddress")]
51        #[unsafe(method(address))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn address(&self) -> Option<Retained<MKAddress>>;
54
55        #[cfg(feature = "MKAddressRepresentations")]
56        #[unsafe(method(addressRepresentations))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn addressRepresentations(&self) -> Option<Retained<MKAddressRepresentations>>;
59
60        #[unsafe(method(name))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
63
64        /// Setter for [`name`][Self::name].
65        ///
66        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
67        #[unsafe(method(setName:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setName(&self, name: Option<&NSString>);
70
71        #[unsafe(method(phoneNumber))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn phoneNumber(&self) -> Option<Retained<NSString>>;
74
75        /// Setter for [`phoneNumber`][Self::phoneNumber].
76        ///
77        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
78        #[unsafe(method(setPhoneNumber:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&NSString>);
81
82        #[unsafe(method(url))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
85
86        /// Setter for [`url`][Self::url].
87        #[unsafe(method(setUrl:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setUrl(&self, url: Option<&NSURL>);
90
91        #[unsafe(method(timeZone))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
94
95        /// Setter for [`timeZone`][Self::timeZone].
96        ///
97        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
98        #[unsafe(method(setTimeZone:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
101
102        #[cfg(feature = "MKPointOfInterestCategory")]
103        #[unsafe(method(pointOfInterestCategory))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn pointOfInterestCategory(&self)
106            -> Option<Retained<MKPointOfInterestCategory>>;
107
108        #[cfg(feature = "MKPointOfInterestCategory")]
109        /// Setter for [`pointOfInterestCategory`][Self::pointOfInterestCategory].
110        ///
111        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
112        #[unsafe(method(setPointOfInterestCategory:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn setPointOfInterestCategory(
115            &self,
116            point_of_interest_category: Option<&MKPointOfInterestCategory>,
117        );
118
119        #[unsafe(method(mapItemForCurrentLocation))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn mapItemForCurrentLocation() -> Retained<MKMapItem>;
122
123        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
124        #[deprecated = "Use init(location:address:)"]
125        #[unsafe(method(initWithPlacemark:))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn initWithPlacemark(
128            this: Allocated<Self>,
129            placemark: &MKPlacemark,
130        ) -> Retained<Self>;
131
132        #[cfg(all(feature = "MKAddress", feature = "objc2-core-location"))]
133        #[unsafe(method(initWithLocation:address:))]
134        #[unsafe(method_family = init)]
135        pub unsafe fn initWithLocation_address(
136            this: Allocated<Self>,
137            location: &CLLocation,
138            address: Option<&MKAddress>,
139        ) -> Retained<Self>;
140
141        /// # Safety
142        ///
143        /// `launch_options` generic should be of the correct type.
144        #[unsafe(method(openInMapsWithLaunchOptions:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn openInMapsWithLaunchOptions(
147            &self,
148            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
149        ) -> bool;
150
151        /// # Safety
152        ///
153        /// `launch_options` generic should be of the correct type.
154        #[unsafe(method(openMapsWithItems:launchOptions:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn openMapsWithItems_launchOptions(
157            map_items: &NSArray<MKMapItem>,
158            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
159        ) -> bool;
160
161        #[cfg(feature = "block2")]
162        /// # Safety
163        ///
164        /// `launch_options` generic should be of the correct type.
165        #[unsafe(method(openInMapsWithLaunchOptions:completionHandler:))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn openInMapsWithLaunchOptions_completionHandler(
168            &self,
169            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
170            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
171        );
172
173        #[cfg(feature = "block2")]
174        /// # Safety
175        ///
176        /// `launch_options` generic should be of the correct type.
177        #[unsafe(method(openMapsWithItems:launchOptions:completionHandler:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn openMapsWithItems_launchOptions_completionHandler(
180            map_items: &NSArray<MKMapItem>,
181            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
182            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
183        );
184    );
185}
186
187/// Methods declared on superclass `NSObject`.
188impl MKMapItem {
189    extern_methods!(
190        #[unsafe(method(init))]
191        #[unsafe(method_family = init)]
192        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193
194        #[unsafe(method(new))]
195        #[unsafe(method_family = new)]
196        pub unsafe fn new() -> Retained<Self>;
197    );
198}
199
200extern "C" {
201    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodekey?language=objc)
202    pub static MKLaunchOptionsDirectionsModeKey: &'static NSString;
203}
204
205extern "C" {
206    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmaptypekey?language=objc)
207    pub static MKLaunchOptionsMapTypeKey: &'static NSString;
208}
209
210extern "C" {
211    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsshowstraffickey?language=objc)
212    pub static MKLaunchOptionsShowsTrafficKey: &'static NSString;
213}
214
215extern "C" {
216    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedefault?language=objc)
217    pub static MKLaunchOptionsDirectionsModeDefault: &'static NSString;
218}
219
220extern "C" {
221    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedriving?language=objc)
222    pub static MKLaunchOptionsDirectionsModeDriving: &'static NSString;
223}
224
225extern "C" {
226    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodewalking?language=objc)
227    pub static MKLaunchOptionsDirectionsModeWalking: &'static NSString;
228}
229
230extern "C" {
231    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodetransit?language=objc)
232    pub static MKLaunchOptionsDirectionsModeTransit: &'static NSString;
233}
234
235extern "C" {
236    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodecycling?language=objc)
237    pub static MKLaunchOptionsDirectionsModeCycling: &'static NSString;
238}
239
240extern "C" {
241    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapcenterkey?language=objc)
242    pub static MKLaunchOptionsMapCenterKey: &'static NSString;
243}
244
245extern "C" {
246    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapspankey?language=objc)
247    pub static MKLaunchOptionsMapSpanKey: &'static NSString;
248}
249
250extern "C" {
251    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionscamerakey?language=objc)
252    pub static MKLaunchOptionsCameraKey: &'static NSString;
253}
254
255/// MKMapItemSerialization.
256impl MKMapItem {
257    extern_methods!();
258}
259
260extern_conformance!(
261    unsafe impl NSSecureCoding for MKMapItem {}
262);
263
264extern "C" {
265    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitemtypeidentifier?language=objc)
266    pub static MKMapItemTypeIdentifier: &'static NSString;
267}