objc2-intents 0.3.2

Bindings to the Intents framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

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

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

extern_conformance!(
    unsafe impl NSCopying for INCar {}
);

unsafe impl CopyingHelper for INCar {
    type Result = Self;
}

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

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

impl INCar {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(
            feature = "INCarChargingConnectorType",
            feature = "INCarHeadUnit",
            feature = "objc2-core-graphics"
        ))]
        #[unsafe(method(initWithCarIdentifier:displayName:year:make:model:color:headUnit:supportedChargingConnectors:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCarIdentifier_displayName_year_make_model_color_headUnit_supportedChargingConnectors(
            this: Allocated<Self>,
            car_identifier: &NSString,
            display_name: Option<&NSString>,
            year: Option<&NSString>,
            make: Option<&NSString>,
            model: Option<&NSString>,
            color: Option<&CGColor>,
            head_unit: Option<&INCarHeadUnit>,
            supported_charging_connectors: &NSArray<INCarChargingConnectorType>,
        ) -> Retained<Self>;

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

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

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

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

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

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(color))]
        #[unsafe(method_family = none)]
        pub unsafe fn color(&self) -> Option<Retained<CGColor>>;

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

        #[cfg(feature = "INCarChargingConnectorType")]
        #[unsafe(method(supportedChargingConnectors))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedChargingConnectors(
            &self,
        ) -> Retained<NSArray<INCarChargingConnectorType>>;

        #[cfg(feature = "INCarChargingConnectorType")]
        #[unsafe(method(setMaximumPower:forChargingConnectorType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaximumPower_forChargingConnectorType(
            &self,
            power: &NSMeasurement<NSUnitPower>,
            charging_connector_type: &INCarChargingConnectorType,
        );

        #[cfg(feature = "INCarChargingConnectorType")]
        #[unsafe(method(maximumPowerForChargingConnectorType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumPowerForChargingConnectorType(
            &self,
            charging_connector_type: &INCarChargingConnectorType,
        ) -> Option<Retained<NSMeasurement<NSUnitPower>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl INCar {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}