objc2-map-kit 0.3.2

Bindings to the MapKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearchcompletionhandler?language=objc)
#[cfg(all(feature = "MKLocalSearchResponse", feature = "block2"))]
pub type MKLocalSearchCompletionHandler =
    *mut block2::DynBlock<dyn Fn(*mut MKLocalSearchResponse, *mut NSError)>;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearch?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKLocalSearch;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MKLocalSearch {}
);

impl MKLocalSearch {
    extern_methods!(
        #[cfg(feature = "MKLocalSearchRequest")]
        #[unsafe(method(initWithRequest:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRequest(
            this: Allocated<Self>,
            request: &MKLocalSearchRequest,
        ) -> Retained<Self>;

        #[cfg(feature = "MKLocalPointsOfInterestRequest")]
        #[unsafe(method(initWithPointsOfInterestRequest:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPointsOfInterestRequest(
            this: Allocated<Self>,
            request: &MKLocalPointsOfInterestRequest,
        ) -> Retained<Self>;

        #[cfg(all(feature = "MKLocalSearchResponse", feature = "block2"))]
        /// # Safety
        ///
        /// `completion_handler` must be a valid pointer.
        #[unsafe(method(startWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startWithCompletionHandler(
            &self,
            completion_handler: MKLocalSearchCompletionHandler,
        );

        #[unsafe(method(cancel))]
        #[unsafe(method_family = none)]
        pub unsafe fn cancel(&self);

        #[unsafe(method(isSearching))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSearching(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MKLocalSearch {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}