objc2_map_kit/generated/
MKLocalSearch.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
10/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearchcompletionhandler?language=objc)
11#[cfg(all(feature = "MKLocalSearchResponse", feature = "block2"))]
12pub type MKLocalSearchCompletionHandler =
13    *mut block2::DynBlock<dyn Fn(*mut MKLocalSearchResponse, *mut NSError)>;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearch?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct MKLocalSearch;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for MKLocalSearch {}
24);
25
26impl MKLocalSearch {
27    extern_methods!(
28        #[cfg(feature = "MKLocalSearchRequest")]
29        #[unsafe(method(initWithRequest:))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn initWithRequest(
32            this: Allocated<Self>,
33            request: &MKLocalSearchRequest,
34        ) -> Retained<Self>;
35
36        #[cfg(feature = "MKLocalPointsOfInterestRequest")]
37        #[unsafe(method(initWithPointsOfInterestRequest:))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn initWithPointsOfInterestRequest(
40            this: Allocated<Self>,
41            request: &MKLocalPointsOfInterestRequest,
42        ) -> Retained<Self>;
43
44        #[cfg(all(feature = "MKLocalSearchResponse", feature = "block2"))]
45        #[unsafe(method(startWithCompletionHandler:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn startWithCompletionHandler(
48            &self,
49            completion_handler: MKLocalSearchCompletionHandler,
50        );
51
52        #[unsafe(method(cancel))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn cancel(&self);
55
56        #[unsafe(method(isSearching))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn isSearching(&self) -> bool;
59    );
60}
61
62/// Methods declared on superclass `NSObject`.
63impl MKLocalSearch {
64    extern_methods!(
65        #[unsafe(method(init))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
68
69        #[unsafe(method(new))]
70        #[unsafe(method_family = new)]
71        pub unsafe fn new() -> Retained<Self>;
72    );
73}