objc2_car_play/generated/
CPWindow.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10use objc2_quartz_core::*;
11#[cfg(feature = "objc2-ui-kit")]
12use objc2_ui_kit::*;
13
14use crate::*;
15
16extern_class!(
17    /// `CPWindow`is the main window for content presented on the car screen.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cpwindow?language=objc)
20    #[unsafe(super(UIWindow, UIView, UIResponder, NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "objc2-ui-kit")]
23    pub struct CPWindow;
24);
25
26#[cfg(all(feature = "objc2-quartz-core", feature = "objc2-ui-kit"))]
27extern_conformance!(
28    unsafe impl CALayerDelegate for CPWindow {}
29);
30
31#[cfg(feature = "objc2-ui-kit")]
32extern_conformance!(
33    unsafe impl NSCoding for CPWindow {}
34);
35
36#[cfg(feature = "objc2-ui-kit")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for CPWindow {}
39);
40
41#[cfg(feature = "objc2-ui-kit")]
42extern_conformance!(
43    unsafe impl UIAppearance for CPWindow {}
44);
45
46#[cfg(feature = "objc2-ui-kit")]
47extern_conformance!(
48    unsafe impl UIAppearanceContainer for CPWindow {}
49);
50
51#[cfg(feature = "objc2-ui-kit")]
52extern_conformance!(
53    unsafe impl UICoordinateSpace for CPWindow {}
54);
55
56#[cfg(feature = "objc2-ui-kit")]
57extern_conformance!(
58    unsafe impl UIDynamicItem for CPWindow {}
59);
60
61#[cfg(feature = "objc2-ui-kit")]
62extern_conformance!(
63    unsafe impl UIFocusEnvironment for CPWindow {}
64);
65
66#[cfg(feature = "objc2-ui-kit")]
67extern_conformance!(
68    unsafe impl UIFocusItem for CPWindow {}
69);
70
71#[cfg(feature = "objc2-ui-kit")]
72extern_conformance!(
73    unsafe impl UIFocusItemContainer for CPWindow {}
74);
75
76#[cfg(feature = "objc2-ui-kit")]
77extern_conformance!(
78    unsafe impl UIResponderStandardEditActions for CPWindow {}
79);
80
81#[cfg(feature = "objc2-ui-kit")]
82extern_conformance!(
83    unsafe impl UITraitEnvironment for CPWindow {}
84);
85
86#[cfg(feature = "objc2-ui-kit")]
87impl CPWindow {
88    extern_methods!(
89        /// `mapButtonSafeAreaLayoutGuide`can be used to layout content that appears above the map buttons presented on the map template.
90        #[unsafe(method(mapButtonSafeAreaLayoutGuide))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn mapButtonSafeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>;
93
94        /// `windowScene`is not available for CPWindow's
95        #[unsafe(method(windowScene))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn windowScene(&self) -> Option<Retained<UIWindowScene>>;
98
99        /// Setter for [`windowScene`][Self::windowScene].
100        ///
101        /// This is a [weak property][objc2::topics::weak_property].
102        #[unsafe(method(setWindowScene:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setWindowScene(&self, window_scene: Option<&UIWindowScene>);
105
106        #[cfg(feature = "CPTemplateApplicationScene")]
107        /// `back-reference`to the CPTemplateApplicationScene containing this CPWindow
108        #[unsafe(method(templateApplicationScene))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn templateApplicationScene(
111            &self,
112        ) -> Option<Retained<CPTemplateApplicationScene>>;
113
114        #[cfg(feature = "CPTemplateApplicationScene")]
115        /// Setter for [`templateApplicationScene`][Self::templateApplicationScene].
116        ///
117        /// This is a [weak property][objc2::topics::weak_property].
118        #[unsafe(method(setTemplateApplicationScene:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setTemplateApplicationScene(
121            &self,
122            template_application_scene: Option<&CPTemplateApplicationScene>,
123        );
124    );
125}
126
127/// Methods declared on superclass `UIWindow`.
128#[cfg(feature = "objc2-ui-kit")]
129impl CPWindow {
130    extern_methods!(
131        #[unsafe(method(initWithWindowScene:))]
132        #[unsafe(method_family = init)]
133        pub unsafe fn initWithWindowScene(
134            this: Allocated<Self>,
135            window_scene: &UIWindowScene,
136        ) -> Retained<Self>;
137
138        #[cfg(feature = "objc2-core-foundation")]
139        #[deprecated = "Use init(windowScene:) instead."]
140        #[unsafe(method(initWithFrame:))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
143
144        #[deprecated = "Use init(windowScene:) instead."]
145        #[unsafe(method(init))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148    );
149}
150
151/// Methods declared on superclass `UIView`.
152#[cfg(feature = "objc2-ui-kit")]
153impl CPWindow {
154    extern_methods!(
155        /// # Safety
156        ///
157        /// `coder` possibly has further requirements.
158        #[unsafe(method(initWithCoder:))]
159        #[unsafe(method_family = init)]
160        pub unsafe fn initWithCoder(
161            this: Allocated<Self>,
162            coder: &NSCoder,
163        ) -> Option<Retained<Self>>;
164    );
165}
166
167/// Methods declared on superclass `NSObject`.
168#[cfg(feature = "objc2-ui-kit")]
169impl CPWindow {
170    extern_methods!(
171        #[unsafe(method(new))]
172        #[unsafe(method_family = new)]
173        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
174    );
175}