objc2_map_kit/generated/
MKPlacemark.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-contacts")]
6#[cfg(not(target_os = "tvos"))]
7use objc2_contacts::*;
8#[cfg(feature = "objc2-core-location")]
9use objc2_core_location::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkplacemark?language=objc)
16    #[unsafe(super(CLPlacemark, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "objc2-core-location")]
19    #[deprecated = "Use MKMapItem's location, address and addressRepresentations properties instead. Use MKAddressRepresentations for formatted address strings for MapKit provided MKMapItems"]
20    pub struct MKPlacemark;
21);
22
23#[cfg(all(feature = "MKAnnotation", feature = "objc2-core-location"))]
24extern_conformance!(
25    unsafe impl MKAnnotation for MKPlacemark {}
26);
27
28#[cfg(feature = "objc2-core-location")]
29extern_conformance!(
30    unsafe impl NSCoding for MKPlacemark {}
31);
32
33#[cfg(feature = "objc2-core-location")]
34extern_conformance!(
35    unsafe impl NSCopying for MKPlacemark {}
36);
37
38#[cfg(feature = "objc2-core-location")]
39unsafe impl CopyingHelper for MKPlacemark {
40    type Result = Self;
41}
42
43#[cfg(feature = "objc2-core-location")]
44extern_conformance!(
45    unsafe impl NSObjectProtocol for MKPlacemark {}
46);
47
48#[cfg(feature = "objc2-core-location")]
49extern_conformance!(
50    unsafe impl NSSecureCoding for MKPlacemark {}
51);
52
53#[cfg(feature = "objc2-core-location")]
54impl MKPlacemark {
55    extern_methods!(
56        #[unsafe(method(initWithCoordinate:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithCoordinate(
59            this: Allocated<Self>,
60            coordinate: CLLocationCoordinate2D,
61        ) -> Retained<Self>;
62
63        /// # Safety
64        ///
65        /// `address_dictionary` generic should be of the correct type.
66        #[deprecated = "Use MKMapItem's location, address and addressRepresentations properties instead. Use MKAddressRepresentations for formatted address strings for MapKit provided MKMapItems"]
67        #[unsafe(method(initWithCoordinate:addressDictionary:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithCoordinate_addressDictionary(
70            this: Allocated<Self>,
71            coordinate: CLLocationCoordinate2D,
72            address_dictionary: Option<&NSDictionary<NSString, AnyObject>>,
73        ) -> Retained<Self>;
74
75        #[cfg(feature = "objc2-contacts")]
76        #[cfg(not(target_os = "tvos"))]
77        #[unsafe(method(initWithCoordinate:postalAddress:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithCoordinate_postalAddress(
80            this: Allocated<Self>,
81            coordinate: CLLocationCoordinate2D,
82            postal_address: &CNPostalAddress,
83        ) -> Retained<Self>;
84
85        /// This property is not atomic.
86        ///
87        /// # Safety
88        ///
89        /// This might not be thread-safe.
90        #[deprecated = "Use MKMapItem's location, address and addressRepresentations properties instead. Use MKAddressRepresentations for formatted address strings for MapKit provided MKMapItems"]
91        #[unsafe(method(countryCode))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn countryCode(&self) -> Option<Retained<NSString>>;
94    );
95}
96
97/// Methods declared on superclass `CLPlacemark`.
98#[cfg(feature = "objc2-core-location")]
99impl MKPlacemark {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108
109        #[deprecated = "Use either GeoToolbox.PlaceDescriptor or MapKit"]
110        #[unsafe(method(initWithPlacemark:))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn initWithPlacemark(
113            this: Allocated<Self>,
114            placemark: &CLPlacemark,
115        ) -> Retained<Self>;
116    );
117}