objc2_car_play/generated/
CPTemplateApplicationScene.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-ui-kit")]
7use objc2_ui_kit::*;
8
9use crate::*;
10
11extern_protocol!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationscenedelegate?language=objc)
13    #[cfg(feature = "objc2-ui-kit")]
14    pub unsafe trait CPTemplateApplicationSceneDelegate: UISceneDelegate {
15        #[cfg(all(feature = "CPInterfaceController", feature = "CPWindow"))]
16        /// The CarPlay screen has connected and is ready to present content.
17        ///
18        /// Your app should create its view controller and assign it to the
19        /// `rootViewController`property
20        /// of this window.
21        ///
22        ///
23        /// Note: The interfaceController object will be strongly retained by the CPTemplateApplicationScene, the delegate does not need to retain it.
24        ///
25        ///
26        /// Note: This method is provided only for navigation apps; other apps should use the variant that does not provide a window.
27        #[optional]
28        #[unsafe(method(templateApplicationScene:didConnectInterfaceController:toWindow:))]
29        #[unsafe(method_family = none)]
30        unsafe fn templateApplicationScene_didConnectInterfaceController_toWindow(
31            &self,
32            template_application_scene: &CPTemplateApplicationScene,
33            interface_controller: &CPInterfaceController,
34            window: &CPWindow,
35        );
36
37        #[cfg(feature = "CPInterfaceController")]
38        /// The CarPlay screen has connected and is ready to present content.
39        ///
40        /// Your app should create its view controller and assign it to the
41        /// `rootViewController`property
42        /// of this window.
43        ///
44        ///
45        /// Note: The interfaceController object will be strongly retained by the CPTemplateApplicationScene, the delegate does not need to retain it.
46        #[optional]
47        #[unsafe(method(templateApplicationScene:didConnectInterfaceController:))]
48        #[unsafe(method_family = none)]
49        unsafe fn templateApplicationScene_didConnectInterfaceController(
50            &self,
51            template_application_scene: &CPTemplateApplicationScene,
52            interface_controller: &CPInterfaceController,
53        );
54
55        #[cfg(all(feature = "CPInterfaceController", feature = "CPWindow"))]
56        /// The CarPlay screen has disconnected.
57        ///
58        ///
59        /// Note: This method is provided only for navigation apps; other apps should use the variant that does not provide a window.
60        #[optional]
61        #[unsafe(method(templateApplicationScene:didDisconnectInterfaceController:fromWindow:))]
62        #[unsafe(method_family = none)]
63        unsafe fn templateApplicationScene_didDisconnectInterfaceController_fromWindow(
64            &self,
65            template_application_scene: &CPTemplateApplicationScene,
66            interface_controller: &CPInterfaceController,
67            window: &CPWindow,
68        );
69
70        #[cfg(feature = "CPInterfaceController")]
71        /// The CarPlay screen has disconnected.
72        #[optional]
73        #[unsafe(method(templateApplicationScene:didDisconnectInterfaceController:))]
74        #[unsafe(method_family = none)]
75        unsafe fn templateApplicationScene_didDisconnectInterfaceController(
76            &self,
77            template_application_scene: &CPTemplateApplicationScene,
78            interface_controller: &CPInterfaceController,
79        );
80
81        #[cfg(feature = "CPNavigationAlert")]
82        /// If your application posts a
83        /// `CPNavigationAlert`while backgrounded, a notification banner may be presented to the user.
84        /// If the user taps on that banner, your application will launch on the car screen and this method will be called
85        /// with the alert the user tapped.
86        #[optional]
87        #[unsafe(method(templateApplicationScene:didSelectNavigationAlert:))]
88        #[unsafe(method_family = none)]
89        unsafe fn templateApplicationScene_didSelectNavigationAlert(
90            &self,
91            template_application_scene: &CPTemplateApplicationScene,
92            navigation_alert: &CPNavigationAlert,
93        );
94
95        #[cfg(feature = "CPManeuver")]
96        /// If your application posts a
97        /// `CPManeuver`while backgrounded, a notification banner may be presented to the user.
98        /// If the user taps on that banner, your application will launch on the car screen and this method will be called
99        /// with the maneuver the user tapped.
100        #[optional]
101        #[unsafe(method(templateApplicationScene:didSelectManeuver:))]
102        #[unsafe(method_family = none)]
103        unsafe fn templateApplicationScene_didSelectManeuver(
104            &self,
105            template_application_scene: &CPTemplateApplicationScene,
106            maneuver: &CPManeuver,
107        );
108
109        /// The CarPlay system suggested content style for this scene has changed.
110        #[optional]
111        #[unsafe(method(contentStyleDidChange:))]
112        #[unsafe(method_family = none)]
113        unsafe fn contentStyleDidChange(&self, content_style: UIUserInterfaceStyle);
114    }
115);
116
117extern_class!(
118    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationscene?language=objc)
119    #[unsafe(super(UIScene, UIResponder, NSObject))]
120    #[derive(Debug, PartialEq, Eq, Hash)]
121    #[cfg(feature = "objc2-ui-kit")]
122    pub struct CPTemplateApplicationScene;
123);
124
125#[cfg(feature = "objc2-ui-kit")]
126extern_conformance!(
127    unsafe impl NSObjectProtocol for CPTemplateApplicationScene {}
128);
129
130#[cfg(feature = "objc2-ui-kit")]
131extern_conformance!(
132    unsafe impl UIResponderStandardEditActions for CPTemplateApplicationScene {}
133);
134
135#[cfg(feature = "objc2-ui-kit")]
136impl CPTemplateApplicationScene {
137    extern_methods!(
138        /// The delegate for a CPTemplateApplicationScene must conform to the CPTemplateApplicationSceneDelegate protocol.
139        #[unsafe(method(delegate))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn delegate(
142            &self,
143        ) -> Option<Retained<ProtocolObject<dyn CPTemplateApplicationSceneDelegate>>>;
144
145        /// Setter for [`delegate`][Self::delegate].
146        #[unsafe(method(setDelegate:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setDelegate(
149            &self,
150            delegate: Option<&ProtocolObject<dyn CPTemplateApplicationSceneDelegate>>,
151        );
152
153        #[cfg(feature = "CPInterfaceController")]
154        /// The interfaceController object for this scene.
155        #[unsafe(method(interfaceController))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn interfaceController(&self) -> Retained<CPInterfaceController>;
158
159        #[cfg(feature = "CPWindow")]
160        /// The CPWindow created for this CPTemplateApplicationScene
161        #[unsafe(method(carWindow))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn carWindow(&self) -> Retained<CPWindow>;
164
165        #[unsafe(method(contentStyle))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn contentStyle(&self) -> UIUserInterfaceStyle;
168    );
169}
170
171/// Methods declared on superclass `UIScene`.
172#[cfg(feature = "objc2-ui-kit")]
173impl CPTemplateApplicationScene {
174    extern_methods!(
175        #[unsafe(method(new))]
176        #[unsafe(method_family = new)]
177        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
178
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        #[unsafe(method(initWithSession:connectionOptions:))]
184        #[unsafe(method_family = init)]
185        pub unsafe fn initWithSession_connectionOptions(
186            this: Allocated<Self>,
187            session: &UISceneSession,
188            connection_options: &UISceneConnectionOptions,
189        ) -> Retained<Self>;
190    );
191}
192
193extern "C" {
194    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplateapplicationscenesessionroleapplication?language=objc)
195    #[cfg(feature = "objc2-ui-kit")]
196    pub static CPTemplateApplicationSceneSessionRoleApplication: &'static UISceneSessionRole;
197}