objc2_map_kit/generated/
MKMapItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[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 #[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 #[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 #[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 #[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 #[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
137impl 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 pub static MKLaunchOptionsDirectionsModeKey: &'static NSString;
153}
154
155extern "C" {
156 pub static MKLaunchOptionsMapTypeKey: &'static NSString;
158}
159
160extern "C" {
161 pub static MKLaunchOptionsShowsTrafficKey: &'static NSString;
163}
164
165extern "C" {
166 pub static MKLaunchOptionsDirectionsModeDefault: &'static NSString;
168}
169
170extern "C" {
171 pub static MKLaunchOptionsDirectionsModeDriving: &'static NSString;
173}
174
175extern "C" {
176 pub static MKLaunchOptionsDirectionsModeWalking: &'static NSString;
178}
179
180extern "C" {
181 pub static MKLaunchOptionsDirectionsModeTransit: &'static NSString;
183}
184
185extern "C" {
186 pub static MKLaunchOptionsMapCenterKey: &'static NSString;
188}
189
190extern "C" {
191 pub static MKLaunchOptionsMapSpanKey: &'static NSString;
193}
194
195extern "C" {
196 pub static MKLaunchOptionsCameraKey: &'static NSString;
198}
199
200impl MKMapItem {
202 extern_methods!();
203}
204
205unsafe impl NSSecureCoding for MKMapItem {}
206
207extern "C" {
208 pub static MKMapItemTypeIdentifier: &'static NSString;
210}