objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// A notification posted when the system protection attributes of a scene change. The object of
    /// the notification is the scene whose protection attributes changed.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesystemprotectiondidchangenotification?language=objc)
    pub static UISceneSystemProtectionDidChangeNotification: &'static NSNotificationName;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscenesystemprotectionmanager?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UISceneSystemProtectionManager;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UISceneSystemProtectionManager {}
);

impl UISceneSystemProtectionManager {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

        /// `YES`if the system requires requires device owner authentication challenges to reveal the
        /// content of the scene associated with this manager, else
        /// `NO`. Note in particular that this
        /// is
        /// _not_the instantaneous state of whether any system-provided shield is covering the UI at
        /// the moment, but whether protection is enabled in general.
        #[unsafe(method(isUserAuthenticationEnabled))]
        #[unsafe(method_family = none)]
        pub fn isUserAuthenticationEnabled(&self) -> bool;
    );
}

/// SystemProtection.
#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
impl UIScene {
    extern_methods!(
        #[unsafe(method(systemProtectionManager))]
        #[unsafe(method_family = none)]
        pub fn systemProtectionManager(&self) -> Option<Retained<UISceneSystemProtectionManager>>;
    );
}