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/cptemplateapplicationdashboardscenedelegate?language=objc)
    #[cfg(feature = "objc2-ui-kit")]
    pub unsafe trait CPTemplateApplicationDashboardSceneDelegate: UISceneDelegate {
        #[cfg(feature = "CPDashboardController")]
        /// The Dashboard navigation widget has connected and is ready to present content.
        ///
        /// Your app should create its view controller and assign it to the
        /// `rootViewController`property
        /// of this window.
        ///
        /// Note: The dashboardController object will be strongly retained by the CPTemplateApplicationDashboardScene, the delegate does not need to retain it.
        #[optional]
        #[unsafe(method(templateApplicationDashboardScene:didConnectDashboardController:toWindow:))]
        #[unsafe(method_family = none)]
        unsafe fn templateApplicationDashboardScene_didConnectDashboardController_toWindow(
            &self,
            template_application_dashboard_scene: &CPTemplateApplicationDashboardScene,
            dashboard_controller: &CPDashboardController,
            window: &UIWindow,
        );

        #[cfg(feature = "CPDashboardController")]
        /// The Dashboard navigation widget has disconnected.
        #[optional]
        #[unsafe(method(templateApplicationDashboardScene:didDisconnectDashboardController:fromWindow:))]
        #[unsafe(method_family = none)]
        unsafe fn templateApplicationDashboardScene_didDisconnectDashboardController_fromWindow(
            &self,
            template_application_dashboard_scene: &CPTemplateApplicationDashboardScene,
            dashboard_controller: &CPDashboardController,
            window: &UIWindow,
        );
    }
);

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

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

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

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

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

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

        /// The UIWindow created for this CPTemplateApplicationDashboardScene
        #[unsafe(method(dashboardWindow))]
        #[unsafe(method_family = none)]
        pub unsafe fn dashboardWindow(&self) -> Retained<UIWindow>;
    );
}

/// Methods declared on superclass `UIScene`.
#[cfg(feature = "objc2-ui-kit")]
impl CPTemplateApplicationDashboardScene {
    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/cptemplateapplicationdashboardscenesessionroleapplication?language=objc)
    #[cfg(feature = "objc2-ui-kit")]
    pub static CPTemplateApplicationDashboardSceneSessionRoleApplication:
        &'static UISceneSessionRole;
}