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
25extern_conformance!(
26    unsafe impl NSObjectProtocol for UISceneSystemProtectionManager {}
27);
28
29impl UISceneSystemProtectionManager {
30    extern_methods!(
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[unsafe(method(new))]
36        #[unsafe(method_family = new)]
37        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
38
39        /// `YES`if the system requires requires device owner authentication challenges to reveal the
40        /// content of the scene associated with this manager, else
41        /// `NO`. Note in particular that this
42        /// is
43        /// _not_the instantaneous state of whether any system-provided shield is covering the UI at
44        /// the moment, but whether protection is enabled in general.
45        #[unsafe(method(isUserAuthenticationEnabled))]
46        #[unsafe(method_family = none)]
47        pub fn isUserAuthenticationEnabled(&self) -> bool;
48    );
49}
50
51/// SystemProtection.
52#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
53impl UIScene {
54    extern_methods!(
55        #[unsafe(method(systemProtectionManager))]
56        #[unsafe(method_family = none)]
57        pub fn systemProtectionManager(&self) -> Option<Retained<UISceneSystemProtectionManager>>;
58    );
59}