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-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
use objc2_quartz_core::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern_class!(
    /// `CPWindow`is the main window for content presented on the car screen.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cpwindow?language=objc)
    #[unsafe(super(UIWindow, UIView, UIResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-ui-kit")]
    pub struct CPWindow;
);

#[cfg(all(feature = "objc2-quartz-core", feature = "objc2-ui-kit"))]
extern_conformance!(
    unsafe impl CALayerDelegate for CPWindow {}
);

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

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

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

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

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

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

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

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

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

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

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

#[cfg(feature = "objc2-ui-kit")]
impl CPWindow {
    extern_methods!(
        /// `mapButtonSafeAreaLayoutGuide`can be used to layout content that appears above the map buttons presented on the map template.
        #[unsafe(method(mapButtonSafeAreaLayoutGuide))]
        #[unsafe(method_family = none)]
        pub unsafe fn mapButtonSafeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>;

        /// `windowScene`is not available for CPWindow's
        #[unsafe(method(windowScene))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowScene(&self) -> Option<Retained<UIWindowScene>>;

        /// Setter for [`windowScene`][Self::windowScene].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setWindowScene:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setWindowScene(&self, window_scene: Option<&UIWindowScene>);

        #[cfg(feature = "CPTemplateApplicationScene")]
        /// `back-reference`to the CPTemplateApplicationScene containing this CPWindow
        #[unsafe(method(templateApplicationScene))]
        #[unsafe(method_family = none)]
        pub unsafe fn templateApplicationScene(
            &self,
        ) -> Option<Retained<CPTemplateApplicationScene>>;

        #[cfg(feature = "CPTemplateApplicationScene")]
        /// Setter for [`templateApplicationScene`][Self::templateApplicationScene].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setTemplateApplicationScene:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTemplateApplicationScene(
            &self,
            template_application_scene: Option<&CPTemplateApplicationScene>,
        );
    );
}

/// Methods declared on superclass `UIWindow`.
#[cfg(feature = "objc2-ui-kit")]
impl CPWindow {
    extern_methods!(
        #[unsafe(method(initWithWindowScene:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithWindowScene(
            this: Allocated<Self>,
            window_scene: &UIWindowScene,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[deprecated = "Use init(windowScene:) instead."]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        #[deprecated = "Use init(windowScene:) instead."]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(feature = "objc2-ui-kit")]
impl CPWindow {
    extern_methods!(
        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

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