objc2_map_kit/generated/
MKMapSnapshotter.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapsnapshotcompletionhandler?language=objc)
13#[cfg(all(feature = "MKMapSnapshot", feature = "block2"))]
14pub type MKMapSnapshotCompletionHandler =
15    *mut block2::DynBlock<dyn Fn(*mut MKMapSnapshot, *mut NSError)>;
16
17extern_class!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapsnapshotter?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct MKMapSnapshotter;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for MKMapSnapshotter {}
26);
27
28impl MKMapSnapshotter {
29    extern_methods!(
30        #[cfg(feature = "MKMapSnapshotOptions")]
31        #[unsafe(method(initWithOptions:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithOptions(
34            this: Allocated<Self>,
35            options: &MKMapSnapshotOptions,
36        ) -> Retained<Self>;
37
38        #[cfg(all(feature = "MKMapSnapshot", feature = "block2"))]
39        /// # Safety
40        ///
41        /// `completion_handler` must be a valid pointer.
42        #[unsafe(method(startWithCompletionHandler:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn startWithCompletionHandler(
45            &self,
46            completion_handler: MKMapSnapshotCompletionHandler,
47        );
48
49        #[cfg(all(feature = "MKMapSnapshot", feature = "block2", feature = "dispatch2"))]
50        /// # Safety
51        ///
52        /// - `queue` possibly has additional threading requirements.
53        /// - `completion_handler` must be a valid pointer.
54        #[unsafe(method(startWithQueue:completionHandler:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn startWithQueue_completionHandler(
57            &self,
58            queue: &DispatchQueue,
59            completion_handler: MKMapSnapshotCompletionHandler,
60        );
61
62        #[unsafe(method(cancel))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn cancel(&self);
65
66        #[unsafe(method(isLoading))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn isLoading(&self) -> bool;
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73impl MKMapSnapshotter {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}