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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitem?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct MKMapItem;
15);
16
17unsafe impl NSObjectProtocol for MKMapItem {}
18
19impl MKMapItem {
20    extern_methods!(
21        #[cfg(feature = "MKMapItemIdentifier")]
22        #[unsafe(method(identifier))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn identifier(&self) -> Option<Retained<MKMapItemIdentifier>>;
25
26        #[cfg(feature = "MKMapItemIdentifier")]
27        #[unsafe(method(alternateIdentifiers))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn alternateIdentifiers(&self) -> Retained<NSSet<MKMapItemIdentifier>>;
30
31        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
32        #[unsafe(method(placemark))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn placemark(&self) -> Retained<MKPlacemark>;
35
36        #[unsafe(method(isCurrentLocation))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn isCurrentLocation(&self) -> bool;
39
40        #[unsafe(method(name))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
43
44        /// Setter for [`name`][Self::name].
45        #[unsafe(method(setName:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setName(&self, name: Option<&NSString>);
48
49        #[unsafe(method(phoneNumber))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn phoneNumber(&self) -> Option<Retained<NSString>>;
52
53        /// Setter for [`phoneNumber`][Self::phoneNumber].
54        #[unsafe(method(setPhoneNumber:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&NSString>);
57
58        #[unsafe(method(url))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
61
62        /// Setter for [`url`][Self::url].
63        #[unsafe(method(setUrl:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setUrl(&self, url: Option<&NSURL>);
66
67        #[unsafe(method(timeZone))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
70
71        /// Setter for [`timeZone`][Self::timeZone].
72        #[unsafe(method(setTimeZone:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
75
76        #[cfg(feature = "MKPointOfInterestCategory")]
77        #[unsafe(method(pointOfInterestCategory))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn pointOfInterestCategory(&self)
80            -> Option<Retained<MKPointOfInterestCategory>>;
81
82        #[cfg(feature = "MKPointOfInterestCategory")]
83        /// Setter for [`pointOfInterestCategory`][Self::pointOfInterestCategory].
84        #[unsafe(method(setPointOfInterestCategory:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setPointOfInterestCategory(
87            &self,
88            point_of_interest_category: Option<&MKPointOfInterestCategory>,
89        );
90
91        #[unsafe(method(mapItemForCurrentLocation))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn mapItemForCurrentLocation() -> Retained<MKMapItem>;
94
95        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
96        #[unsafe(method(initWithPlacemark:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithPlacemark(
99            this: Allocated<Self>,
100            placemark: &MKPlacemark,
101        ) -> Retained<Self>;
102
103        #[unsafe(method(openInMapsWithLaunchOptions:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn openInMapsWithLaunchOptions(
106            &self,
107            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
108        ) -> bool;
109
110        #[unsafe(method(openMapsWithItems:launchOptions:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn openMapsWithItems_launchOptions(
113            map_items: &NSArray<MKMapItem>,
114            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
115        ) -> bool;
116
117        #[cfg(feature = "block2")]
118        #[unsafe(method(openInMapsWithLaunchOptions:completionHandler:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn openInMapsWithLaunchOptions_completionHandler(
121            &self,
122            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
123            completion: Option<&block2::Block<dyn Fn(Bool)>>,
124        );
125
126        #[cfg(feature = "block2")]
127        #[unsafe(method(openMapsWithItems:launchOptions:completionHandler:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn openMapsWithItems_launchOptions_completionHandler(
130            map_items: &NSArray<MKMapItem>,
131            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
132            completion: Option<&block2::Block<dyn Fn(Bool)>>,
133        );
134    );
135}
136
137/// Methods declared on superclass `NSObject`.
138impl MKMapItem {
139    extern_methods!(
140        #[unsafe(method(init))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
143
144        #[unsafe(method(new))]
145        #[unsafe(method_family = new)]
146        pub unsafe fn new() -> Retained<Self>;
147    );
148}
149
150extern "C" {
151    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodekey?language=objc)
152    pub static MKLaunchOptionsDirectionsModeKey: &'static NSString;
153}
154
155extern "C" {
156    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmaptypekey?language=objc)
157    pub static MKLaunchOptionsMapTypeKey: &'static NSString;
158}
159
160extern "C" {
161    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsshowstraffickey?language=objc)
162    pub static MKLaunchOptionsShowsTrafficKey: &'static NSString;
163}
164
165extern "C" {
166    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedefault?language=objc)
167    pub static MKLaunchOptionsDirectionsModeDefault: &'static NSString;
168}
169
170extern "C" {
171    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedriving?language=objc)
172    pub static MKLaunchOptionsDirectionsModeDriving: &'static NSString;
173}
174
175extern "C" {
176    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodewalking?language=objc)
177    pub static MKLaunchOptionsDirectionsModeWalking: &'static NSString;
178}
179
180extern "C" {
181    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodetransit?language=objc)
182    pub static MKLaunchOptionsDirectionsModeTransit: &'static NSString;
183}
184
185extern "C" {
186    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapcenterkey?language=objc)
187    pub static MKLaunchOptionsMapCenterKey: &'static NSString;
188}
189
190extern "C" {
191    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapspankey?language=objc)
192    pub static MKLaunchOptionsMapSpanKey: &'static NSString;
193}
194
195extern "C" {
196    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionscamerakey?language=objc)
197    pub static MKLaunchOptionsCameraKey: &'static NSString;
198}
199
200/// MKMapItemSerialization.
201impl MKMapItem {
202    extern_methods!();
203}
204
205unsafe impl NSSecureCoding for MKMapItem {}
206
207extern "C" {
208    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitemtypeidentifier?language=objc)
209    pub static MKMapItemTypeIdentifier: &'static NSString;
210}