objc2_ui_kit/generated/
UIFocusDebugger.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::*;
5
6use crate::*;
7
8extern_class!(
9    /// UIFocusDebugger provides a collection of runtime utilities for debugging issues related to focus interaction.
10    ///
11    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusdebugger?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UIFocusDebugger;
16);
17
18unsafe impl NSObjectProtocol for UIFocusDebugger {}
19
20impl UIFocusDebugger {
21    extern_methods!(
22        /// Outputs an overview of all supported debugging utilities and other relevant information.
23        /// - To use in Swift, enter `po UIFocusDebugger.help()` when paused in lldb.
24        /// - To use in Objective-C, enter `po [UIFocusDebugger help]` when paused in lldb.
25        #[unsafe(method(help))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn help(
28            mtm: MainThreadMarker,
29        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
30
31        /// Outputs information for the currently focused item.
32        /// - To use in Swift, enter `po UIFocusDebugger.status()` when paused in lldb.
33        /// - To use in Objective-C, enter `po [UIFocusDebugger status]` when paused in lldb.
34        #[unsafe(method(status))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn status(
37            mtm: MainThreadMarker,
38        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
39
40        #[cfg(feature = "UIFocus")]
41        /// Outputs a diagnosis of the specified item's focusability, including any known issues that may be preventing focusability.
42        /// - To use in Swift, enter `po UIFocusDebugger.checkFocusability(for:
43        /// <item
44        /// reference>)` when paused in lldb.
45        /// - To use in Objective-C, enter `po [UIFocusDebugger checkFocusabilityForItem:
46        /// <item
47        /// reference>]` when paused in lldb.
48        #[unsafe(method(checkFocusabilityForItem:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn checkFocusabilityForItem(
51            item: &ProtocolObject<dyn UIFocusItem>,
52        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
53
54        #[cfg(feature = "UIFocus")]
55        /// Simulates a fake focus update requested by the specified environment (e.g. `[focusSystem requestFocusUpdateToEnvironment:environment]`), outlining each step of the process for determining the next focused item.
56        /// - To use in Swift, enter `po UIFocusDebugger.simulateFocusUpdateRequest(from:
57        /// <environment
58        /// reference>)` when paused in lldb.
59        /// - To use in Objective-C, enter `po [UIFocusDebugger simulateFocusUpdateRequestFromEnvironment:
60        /// <environment
61        /// reference>]` when paused in lldb.
62        #[unsafe(method(simulateFocusUpdateRequestFromEnvironment:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn simulateFocusUpdateRequestFromEnvironment(
65            environment: &ProtocolObject<dyn UIFocusEnvironment>,
66        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
67
68        #[cfg(feature = "UIFocus")]
69        /// Outputs a diagnosis of the focus groups of the specified environment and its children.
70        /// Pass a focus system as the environment to get the full focus group tree for this focus system.
71        /// - To use in Swift, enter `po UIFocusDebugger.focusGroups(for:
72        /// <environment
73        /// reference>)` when paused in lldb.
74        /// - To use in Objective-C, enter `po [UIFocusDebugger focusGroupsForEnvironment:
75        /// <environment
76        /// reference>]` when paused in lldb.
77        #[unsafe(method(focusGroupsForEnvironment:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn focusGroupsForEnvironment(
80            environment: &ProtocolObject<dyn UIFocusEnvironment>,
81        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
82
83        #[cfg(feature = "UIFocus")]
84        /// Outputs a diagnoses of the preferred focus environments tree.
85        /// - To use in Swift, enter `po UIFocusDebugger.preferredFocusEnvironments(for:
86        /// <environment
87        /// reference>)` when paused in lldb.
88        /// - To use in Objective-C, enter `po [UIFocusDebugger preferredFocusEnvironmentsForEnvironment:
89        /// <environment
90        /// reference>]` when paused in lldb.
91        #[unsafe(method(preferredFocusEnvironmentsForEnvironment:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn preferredFocusEnvironmentsForEnvironment(
94            environment: &ProtocolObject<dyn UIFocusEnvironment>,
95        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl UIFocusDebugger {
101    extern_methods!(
102        #[unsafe(method(init))]
103        #[unsafe(method_family = init)]
104        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
105
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
109    );
110}
111
112extern_protocol!(
113    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusdebuggeroutput?language=objc)
114    pub unsafe trait UIFocusDebuggerOutput: NSObjectProtocol + MainThreadOnly {}
115);