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;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

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

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

impl MKMapSnapshotter {
    extern_methods!(
        #[cfg(feature = "MKMapSnapshotOptions")]
        #[unsafe(method(initWithOptions:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithOptions(
            this: Allocated<Self>,
            options: &MKMapSnapshotOptions,
        ) -> Retained<Self>;

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

        #[cfg(all(feature = "MKMapSnapshot", feature = "block2", feature = "dispatch2"))]
        /// # Safety
        ///
        /// - `queue` possibly has additional threading requirements.
        /// - `completion_handler` must be a valid pointer.
        #[unsafe(method(startWithQueue:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startWithQueue_completionHandler(
            &self,
            queue: &DispatchQueue,
            completion_handler: MKMapSnapshotCompletionHandler,
        );

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

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

/// Methods declared on superclass `NSObject`.
impl MKMapSnapshotter {
    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>;
    );
}