1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKMapItem;

    unsafe impl ClassType for MKMapItem {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MKMapItem {}

extern_methods!(
    unsafe impl MKMapItem {
        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
        #[method_id(@__retain_semantics Other placemark)]
        pub unsafe fn placemark(&self) -> Id<MKPlacemark>;

        #[method(isCurrentLocation)]
        pub unsafe fn isCurrentLocation(&self) -> bool;

        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSString>>;

        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[method_id(@__retain_semantics Other phoneNumber)]
        pub unsafe fn phoneNumber(&self) -> Option<Id<NSString>>;

        #[method(setPhoneNumber:)]
        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&NSString>);

        #[method_id(@__retain_semantics Other url)]
        pub unsafe fn url(&self) -> Option<Id<NSURL>>;

        #[method(setUrl:)]
        pub unsafe fn setUrl(&self, url: Option<&NSURL>);

        #[method_id(@__retain_semantics Other timeZone)]
        pub unsafe fn timeZone(&self) -> Option<Id<NSTimeZone>>;

        #[method(setTimeZone:)]
        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);

        #[cfg(feature = "MKPointOfInterestCategory")]
        #[method_id(@__retain_semantics Other pointOfInterestCategory)]
        pub unsafe fn pointOfInterestCategory(&self) -> Option<Id<MKPointOfInterestCategory>>;

        #[cfg(feature = "MKPointOfInterestCategory")]
        #[method(setPointOfInterestCategory:)]
        pub unsafe fn setPointOfInterestCategory(
            &self,
            point_of_interest_category: Option<&MKPointOfInterestCategory>,
        );

        #[method_id(@__retain_semantics Other mapItemForCurrentLocation)]
        pub unsafe fn mapItemForCurrentLocation() -> Id<MKMapItem>;

        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
        #[method_id(@__retain_semantics Init initWithPlacemark:)]
        pub unsafe fn initWithPlacemark(this: Allocated<Self>, placemark: &MKPlacemark)
            -> Id<Self>;

        #[method(openInMapsWithLaunchOptions:)]
        pub unsafe fn openInMapsWithLaunchOptions(
            &self,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;

        #[method(openMapsWithItems:launchOptions:)]
        pub unsafe fn openMapsWithItems_launchOptions(
            map_items: &NSArray<MKMapItem>,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;

        #[cfg(feature = "block2")]
        #[method(openInMapsWithLaunchOptions:completionHandler:)]
        pub unsafe fn openInMapsWithLaunchOptions_completionHandler(
            &self,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
            completion: Option<&Block<dyn Fn(Bool)>>,
        );

        #[cfg(feature = "block2")]
        #[method(openMapsWithItems:launchOptions:completionHandler:)]
        pub unsafe fn openMapsWithItems_launchOptions_completionHandler(
            map_items: &NSArray<MKMapItem>,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
            completion: Option<&Block<dyn Fn(Bool)>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MKMapItem {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern "C" {
    pub static MKLaunchOptionsDirectionsModeKey: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsMapTypeKey: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsShowsTrafficKey: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsDirectionsModeDefault: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsDirectionsModeDriving: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsDirectionsModeWalking: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsDirectionsModeTransit: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsMapCenterKey: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsMapSpanKey: &'static NSString;
}

extern "C" {
    pub static MKLaunchOptionsCameraKey: &'static NSString;
}

extern_methods!(
    /// MKMapItemSerialization
    unsafe impl MKMapItem {}
);

unsafe impl NSSecureCoding for MKMapItem {}

extern "C" {
    pub static MKMapItemTypeIdentifier: &'static NSString;
}