objc2-car-play 0.3.2

Bindings to the CarPlay framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// `CPTravelEstimates`describes the time and distance remaining for the active navigation session.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptravelestimates?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CPTravelEstimates;
);

extern_conformance!(
    unsafe impl NSCoding for CPTravelEstimates {}
);

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

extern_conformance!(
    unsafe impl NSSecureCoding for CPTravelEstimates {}
);

impl CPTravelEstimates {
    extern_methods!(
        /// Initialize a
        /// `CPTravelEstimates`with distance and time remaining.
        ///
        ///
        /// Note: A distance value less than 0 or a time remaining value less than 0 will render
        /// as "--" in the ETA and trip preview cards, indicating that distance or time remaining are
        /// unavailable, due to route calculations/rerouting or internet connectivity problems.
        /// Values less than 0 are distinguished from distance or time values equal to 0; your app may
        /// display 0 as the user is imminently arriving at their destination.
        #[unsafe(method(initWithDistanceRemaining:timeRemaining:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDistanceRemaining_timeRemaining(
            this: Allocated<Self>,
            distance: &NSMeasurement<NSUnitLength>,
            time: NSTimeInterval,
        ) -> Retained<Self>;

        #[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>;

        #[unsafe(method(initWithDistanceRemaining:distanceRemainingToDisplay:timeRemaining:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDistanceRemaining_distanceRemainingToDisplay_timeRemaining(
            this: Allocated<Self>,
            distance_remaining: &NSMeasurement<NSUnitLength>,
            distance_remaining_to_display: &NSMeasurement<NSUnitLength>,
            time: NSTimeInterval,
        ) -> Retained<Self>;

        /// Distance remaining for displaying to the user.  If not set falls back to distanceRemaining;
        #[unsafe(method(distanceRemainingToDisplay))]
        #[unsafe(method_family = none)]
        pub unsafe fn distanceRemainingToDisplay(&self) -> Retained<NSMeasurement<NSUnitLength>>;

        /// Distance remaining.
        #[unsafe(method(distanceRemaining))]
        #[unsafe(method_family = none)]
        pub unsafe fn distanceRemaining(&self) -> Retained<NSMeasurement<NSUnitLength>>;

        /// Time remaining.
        #[unsafe(method(timeRemaining))]
        #[unsafe(method_family = none)]
        pub unsafe fn timeRemaining(&self) -> NSTimeInterval;
    );
}