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