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        #[unsafe(method(calculateDirectionsWithCompletionHandler:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn calculateDirectionsWithCompletionHandler(
44            &self,
45            completion_handler: MKDirectionsHandler,
46        );
47
48        #[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
49        #[unsafe(method(calculateETAWithCompletionHandler:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn calculateETAWithCompletionHandler(&self, completion_handler: MKETAHandler);
52
53        #[unsafe(method(cancel))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn cancel(&self);
56
57        #[unsafe(method(isCalculating))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn isCalculating(&self) -> bool;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl MKDirections {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}