objc2_ui_kit/generated/
UISceneSystemProtectionManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10    /// A notification posted when the system protection attributes of a scene change. The object of
11    /// the notification is the scene whose protection attributes changed.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesystemprotectiondidchangenotification?language=objc)
14    pub static UISceneSystemProtectionDidChangeNotification: &'static NSNotificationName;
15}
16
17extern_class!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesystemprotectionmanager?language=objc)
19    #[unsafe(super(NSObject))]
20    #[thread_kind = MainThreadOnly]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    pub struct UISceneSystemProtectionManager;
23);
24
25unsafe impl NSObjectProtocol for UISceneSystemProtectionManager {}
26
27impl UISceneSystemProtectionManager {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[unsafe(method(new))]
34        #[unsafe(method_family = new)]
35        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
36
37        /// `YES`if the system requires requires device owner authentication challenges to reveal the
38        /// content of the scene associated with this manager, else
39        /// `NO`. Note in particular that this
40        /// is
41        /// _not_the instantaneous state of whether any system-provided shield is covering the UI at
42        /// the moment, but whether protection is enabled in general.
43        #[unsafe(method(isUserAuthenticationEnabled))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn isUserAuthenticationEnabled(&self) -> bool;
46    );
47}
48
49/// SystemProtection.
50#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
51impl UIScene {
52    extern_methods!(
53        #[unsafe(method(systemProtectionManager))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn systemProtectionManager(
56            &self,
57        ) -> Option<Retained<UISceneSystemProtectionManager>>;
58    );
59}