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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationinstrumentclusterscenedelegate?language=objc)
    #[cfg(feature = "objc2-ui-kit")]
    pub unsafe trait CPTemplateApplicationInstrumentClusterSceneDelegate:
        UISceneDelegate + MainThreadOnly
    {
        #[cfg(feature = "CPInstrumentClusterController")]
        /// The instrument cluster navigation scene has connected.
        #[optional]
        #[unsafe(method(templateApplicationInstrumentClusterScene:didConnectInstrumentClusterController:))]
        #[unsafe(method_family = none)]
        unsafe fn templateApplicationInstrumentClusterScene_didConnectInstrumentClusterController(
            &self,
            template_application_instrument_cluster_scene: &CPTemplateApplicationInstrumentClusterScene,
            instrument_cluster_controller: &CPInstrumentClusterController,
        );

        #[cfg(feature = "CPInstrumentClusterController")]
        /// The instrument cluster navigation scene has connected.
        #[optional]
        #[unsafe(method(templateApplicationInstrumentClusterScene:didDisconnectInstrumentClusterController:))]
        #[unsafe(method_family = none)]
        unsafe fn templateApplicationInstrumentClusterScene_didDisconnectInstrumentClusterController(
            &self,
            template_application_instrument_cluster_scene: &CPTemplateApplicationInstrumentClusterScene,
            instrument_cluster_controller: &CPInstrumentClusterController,
        );

        /// The CarPlay system suggested content style for this scene has changed.
        #[optional]
        #[unsafe(method(contentStyleDidChange:))]
        #[unsafe(method_family = none)]
        unsafe fn contentStyleDidChange(&self, content_style: UIUserInterfaceStyle);
    }
);

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationinstrumentclusterscene?language=objc)
    #[unsafe(super(UIScene, UIResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-ui-kit")]
    pub struct CPTemplateApplicationInstrumentClusterScene;
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl NSObjectProtocol for CPTemplateApplicationInstrumentClusterScene {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for CPTemplateApplicationInstrumentClusterScene {}
);

#[cfg(feature = "objc2-ui-kit")]
impl CPTemplateApplicationInstrumentClusterScene {
    extern_methods!(
        /// The delegate for a CPTemplateApplicationInstrumentClusterScene must conform to the CPTemplateApplicationInstrumentClusterSceneDelegate protocol.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn CPTemplateApplicationInstrumentClusterSceneDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<
                &ProtocolObject<dyn CPTemplateApplicationInstrumentClusterSceneDelegate>,
            >,
        );

        #[cfg(feature = "CPInstrumentClusterController")]
        /// The instrumentClusterController object for this scene.
        #[unsafe(method(instrumentClusterController))]
        #[unsafe(method_family = none)]
        pub unsafe fn instrumentClusterController(&self)
            -> Retained<CPInstrumentClusterController>;

        /// The current content style for this scene suggested by the connected CarPlay system.
        #[unsafe(method(contentStyle))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentStyle(&self) -> UIUserInterfaceStyle;
    );
}

/// Methods declared on superclass `UIScene`.
#[cfg(feature = "objc2-ui-kit")]
impl CPTemplateApplicationInstrumentClusterScene {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

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

        #[unsafe(method(initWithSession:connectionOptions:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSession_connectionOptions(
            this: Allocated<Self>,
            session: &UISceneSession,
            connection_options: &UISceneConnectionOptions,
        ) -> Retained<Self>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationinstrumentclusterscenesessionroleapplication?language=objc)
    #[cfg(feature = "objc2-ui-kit")]
    pub static CPTemplateApplicationInstrumentClusterSceneSessionRoleApplication:
        &'static UISceneSessionRole;
}