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        /// # Safety
46        ///
47        /// `completion_handler` must be a valid pointer.
48        #[unsafe(method(startWithCompletionHandler:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn startWithCompletionHandler(
51            &self,
52            completion_handler: MKLocalSearchCompletionHandler,
53        );
54
55        #[unsafe(method(cancel))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn cancel(&self);
58
59        #[unsafe(method(isSearching))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn isSearching(&self) -> bool;
62    );
63}
64
65/// Methods declared on superclass `NSObject`.
66impl MKLocalSearch {
67    extern_methods!(
68        #[unsafe(method(init))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71
72        #[unsafe(method(new))]
73        #[unsafe(method_family = new)]
74        pub unsafe fn new() -> Retained<Self>;
75    );
76}