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::Block<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
22unsafe impl NSObjectProtocol for MKLocalSearch {}
23
24impl MKLocalSearch {
25    extern_methods!(
26        #[cfg(feature = "MKLocalSearchRequest")]
27        #[unsafe(method(initWithRequest:))]
28        #[unsafe(method_family = init)]
29        pub unsafe fn initWithRequest(
30            this: Allocated<Self>,
31            request: &MKLocalSearchRequest,
32        ) -> Retained<Self>;
33
34        #[cfg(feature = "MKLocalPointsOfInterestRequest")]
35        #[unsafe(method(initWithPointsOfInterestRequest:))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn initWithPointsOfInterestRequest(
38            this: Allocated<Self>,
39            request: &MKLocalPointsOfInterestRequest,
40        ) -> Retained<Self>;
41
42        #[cfg(all(feature = "MKLocalSearchResponse", feature = "block2"))]
43        #[unsafe(method(startWithCompletionHandler:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn startWithCompletionHandler(
46            &self,
47            completion_handler: MKLocalSearchCompletionHandler,
48        );
49
50        #[unsafe(method(cancel))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn cancel(&self);
53
54        #[unsafe(method(isSearching))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn isSearching(&self) -> bool;
57    );
58}
59
60/// Methods declared on superclass `NSObject`.
61impl MKLocalSearch {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}