objc2_map_kit/generated/
MKDirections.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/mkdirectionshandler?language=objc)
11#[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
12pub type MKDirectionsHandler =
13    *mut block2::DynBlock<dyn Fn(*mut MKDirectionsResponse, *mut NSError)>;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mketahandler?language=objc)
16#[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
17pub type MKETAHandler = *mut block2::DynBlock<dyn Fn(*mut MKETAResponse, *mut NSError)>;
18
19extern_class!(
20    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkdirections?language=objc)
21    #[unsafe(super(NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    pub struct MKDirections;
24);
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for MKDirections {}
28);
29
30impl MKDirections {
31    extern_methods!(
32        #[cfg(feature = "MKDirectionsRequest")]
33        #[unsafe(method(initWithRequest:))]
34        #[unsafe(method_family = init)]
35        pub unsafe fn initWithRequest(
36            this: Allocated<Self>,
37            request: &MKDirectionsRequest,
38        ) -> Retained<Self>;
39
40        #[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
41        /// # Safety
42        ///
43        /// `completion_handler` must be a valid pointer.
44        #[unsafe(method(calculateDirectionsWithCompletionHandler:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn calculateDirectionsWithCompletionHandler(
47            &self,
48            completion_handler: MKDirectionsHandler,
49        );
50
51        #[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
52        /// # Safety
53        ///
54        /// `completion_handler` must be a valid pointer.
55        #[unsafe(method(calculateETAWithCompletionHandler:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn calculateETAWithCompletionHandler(&self, completion_handler: MKETAHandler);
58
59        #[unsafe(method(cancel))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn cancel(&self);
62
63        #[unsafe(method(isCalculating))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn isCalculating(&self) -> bool;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl MKDirections {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}