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

use crate::*;

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

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

impl MKDirectionsResponse {
    extern_methods!(
        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source(&self) -> Retained<MKMapItem>;

        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(destination))]
        #[unsafe(method_family = none)]
        pub unsafe fn destination(&self) -> Retained<MKMapItem>;

        #[unsafe(method(routes))]
        #[unsafe(method_family = none)]
        pub unsafe fn routes(&self) -> Retained<NSArray<MKRoute>>;
    );
}

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

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

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

impl MKRoute {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        #[unsafe(method(advisoryNotices))]
        #[unsafe(method_family = none)]
        pub unsafe fn advisoryNotices(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(distance))]
        #[unsafe(method_family = none)]
        pub unsafe fn distance(&self) -> CLLocationDistance;

        #[unsafe(method(expectedTravelTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn expectedTravelTime(&self) -> NSTimeInterval;

        #[cfg(feature = "MKDirectionsTypes")]
        #[unsafe(method(transportType))]
        #[unsafe(method_family = none)]
        pub unsafe fn transportType(&self) -> MKDirectionsTransportType;

        #[cfg(all(feature = "MKMultiPoint", feature = "MKPolyline", feature = "MKShape"))]
        #[unsafe(method(polyline))]
        #[unsafe(method_family = none)]
        pub unsafe fn polyline(&self) -> Retained<MKPolyline>;

        #[unsafe(method(steps))]
        #[unsafe(method_family = none)]
        pub unsafe fn steps(&self) -> Retained<NSArray<MKRouteStep>>;

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

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

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

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

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

impl MKRouteStep {
    extern_methods!(
        #[unsafe(method(instructions))]
        #[unsafe(method_family = none)]
        pub unsafe fn instructions(&self) -> Retained<NSString>;

        #[unsafe(method(notice))]
        #[unsafe(method_family = none)]
        pub unsafe fn notice(&self) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "MKMultiPoint", feature = "MKPolyline", feature = "MKShape"))]
        #[unsafe(method(polyline))]
        #[unsafe(method_family = none)]
        pub unsafe fn polyline(&self) -> Retained<MKPolyline>;

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(distance))]
        #[unsafe(method_family = none)]
        pub unsafe fn distance(&self) -> CLLocationDistance;

        #[cfg(feature = "MKDirectionsTypes")]
        #[unsafe(method(transportType))]
        #[unsafe(method_family = none)]
        pub unsafe fn transportType(&self) -> MKDirectionsTransportType;
    );
}

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

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

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

impl MKETAResponse {
    extern_methods!(
        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source(&self) -> Retained<MKMapItem>;

        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(destination))]
        #[unsafe(method_family = none)]
        pub unsafe fn destination(&self) -> Retained<MKMapItem>;

        #[unsafe(method(expectedTravelTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn expectedTravelTime(&self) -> NSTimeInterval;

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(distance))]
        #[unsafe(method_family = none)]
        pub unsafe fn distance(&self) -> CLLocationDistance;

        #[unsafe(method(expectedArrivalDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn expectedArrivalDate(&self) -> Retained<NSDate>;

        #[unsafe(method(expectedDepartureDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn expectedDepartureDate(&self) -> Retained<NSDate>;

        #[cfg(feature = "MKDirectionsTypes")]
        #[unsafe(method(transportType))]
        #[unsafe(method_family = none)]
        pub unsafe fn transportType(&self) -> MKDirectionsTransportType;
    );
}

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