objc2_ui_kit/generated/
UIPointerLockState.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_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipointerlockstate?language=objc)
11    #[unsafe(super(NSObject))]
12    #[thread_kind = MainThreadOnly]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct UIPointerLockState;
15);
16
17unsafe impl NSObjectProtocol for UIPointerLockState {}
18
19impl UIPointerLockState {
20    extern_methods!(
21        #[unsafe(method(init))]
22        #[unsafe(method_family = init)]
23        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
24
25        #[unsafe(method(new))]
26        #[unsafe(method_family = new)]
27        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
28
29        /// The status of the pointer lock for this scene as determined by the system.
30        /// The preferred pointer lock value specified by a view controller is only a request, which may or may not be honored.
31        /// This property is key-value observable and UIPointerLockState.didChangeNotification is posted when it changes.
32        #[unsafe(method(isLocked))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn isLocked(&self) -> bool;
35    );
36}
37
38/// PointerLockState.
39#[cfg(all(feature = "UIResponder", feature = "UIScene"))]
40impl UIScene {
41    extern_methods!(
42        #[unsafe(method(pointerLockState))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn pointerLockState(&self) -> Option<Retained<UIPointerLockState>>;
45    );
46}
47
48extern "C" {
49    /// A notification that is posted when UIPointerLockState.locked changes values for a scene.
50    /// It contains the related UIScene in the user info dictionary of the notification.
51    ///
52    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uipointerlockstatedidchangenotification?language=objc)
53    pub static UIPointerLockStateDidChangeNotification: &'static NSNotificationName;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipointerlockstatesceneuserinfokey?language=objc)
58    pub static UIPointerLockStateSceneUserInfoKey: &'static NSString;
59}