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