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