objc2_map_kit/generated/
MKGeocodingRequest.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/mkgeocodingrequest?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct MKGeocodingRequest;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for MKGeocodingRequest {}
19);
20
21impl MKGeocodingRequest {
22    extern_methods!(
23        #[unsafe(method(isCancelled))]
24        #[unsafe(method_family = none)]
25        pub unsafe fn isCancelled(&self) -> bool;
26
27        #[unsafe(method(isLoading))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn isLoading(&self) -> bool;
30
31        #[unsafe(method(addressString))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn addressString(&self) -> Retained<NSString>;
34
35        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
36        #[unsafe(method(region))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn region(&self) -> MKCoordinateRegion;
39
40        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
41        /// Setter for [`region`][Self::region].
42        #[unsafe(method(setRegion:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn setRegion(&self, region: MKCoordinateRegion);
45
46        #[unsafe(method(preferredLocale))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn preferredLocale(&self) -> Option<Retained<NSLocale>>;
49
50        /// Setter for [`preferredLocale`][Self::preferredLocale].
51        #[unsafe(method(setPreferredLocale:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setPreferredLocale(&self, preferred_locale: Option<&NSLocale>);
54
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(new))]
60        #[unsafe(method_family = new)]
61        pub unsafe fn new() -> Retained<Self>;
62
63        #[unsafe(method(initWithAddressString:))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn initWithAddressString(
66            this: Allocated<Self>,
67            address_string: &NSString,
68        ) -> Option<Retained<Self>>;
69
70        #[cfg(all(feature = "MKMapItem", feature = "block2"))]
71        #[unsafe(method(getMapItemsWithCompletionHandler:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn getMapItemsWithCompletionHandler(
74            &self,
75            completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<MKMapItem>, *mut NSError)>,
76        );
77
78        #[unsafe(method(cancel))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn cancel(&self);
81    );
82}