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
18extern_conformance!(
19    unsafe impl NSObjectProtocol for UIFocusDebugger {}
20);
21
22impl UIFocusDebugger {
23    extern_methods!(
24        /// Outputs an overview of all supported debugging utilities and other relevant information.
25        /// - To use in Swift, enter `po UIFocusDebugger.help()` when paused in lldb.
26        /// - To use in Objective-C, enter `po [UIFocusDebugger help]` when paused in lldb.
27        #[unsafe(method(help))]
28        #[unsafe(method_family = none)]
29        pub fn help(mtm: MainThreadMarker) -> 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 fn status(mtm: MainThreadMarker)
37            -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
38
39        #[cfg(feature = "UIFocus")]
40        /// Outputs a diagnosis of the specified item's focusability, including any known issues that may be preventing focusability.
41        /// - To use in Swift, enter `po UIFocusDebugger.checkFocusability(for:
42        /// <item
43        /// reference>)` when paused in lldb.
44        /// - To use in Objective-C, enter `po [UIFocusDebugger checkFocusabilityForItem:
45        /// <item
46        /// reference>]` when paused in lldb.
47        #[unsafe(method(checkFocusabilityForItem:))]
48        #[unsafe(method_family = none)]
49        pub fn checkFocusabilityForItem(
50            item: &ProtocolObject<dyn UIFocusItem>,
51        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
52
53        #[cfg(feature = "UIFocus")]
54        /// 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.
55        /// - To use in Swift, enter `po UIFocusDebugger.simulateFocusUpdateRequest(from:
56        /// <environment
57        /// reference>)` when paused in lldb.
58        /// - To use in Objective-C, enter `po [UIFocusDebugger simulateFocusUpdateRequestFromEnvironment:
59        /// <environment
60        /// reference>]` when paused in lldb.
61        #[unsafe(method(simulateFocusUpdateRequestFromEnvironment:))]
62        #[unsafe(method_family = none)]
63        pub fn simulateFocusUpdateRequestFromEnvironment(
64            environment: &ProtocolObject<dyn UIFocusEnvironment>,
65        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
66
67        #[cfg(feature = "UIFocus")]
68        /// Outputs a diagnosis of the focus groups of the specified environment and its children.
69        /// Pass a focus system as the environment to get the full focus group tree for this focus system.
70        /// - To use in Swift, enter `po UIFocusDebugger.focusGroups(for:
71        /// <environment
72        /// reference>)` when paused in lldb.
73        /// - To use in Objective-C, enter `po [UIFocusDebugger focusGroupsForEnvironment:
74        /// <environment
75        /// reference>]` when paused in lldb.
76        #[unsafe(method(focusGroupsForEnvironment:))]
77        #[unsafe(method_family = none)]
78        pub fn focusGroupsForEnvironment(
79            environment: &ProtocolObject<dyn UIFocusEnvironment>,
80        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
81
82        #[cfg(feature = "UIFocus")]
83        /// Outputs a diagnoses of the preferred focus environments tree.
84        /// - To use in Swift, enter `po UIFocusDebugger.preferredFocusEnvironments(for:
85        /// <environment
86        /// reference>)` when paused in lldb.
87        /// - To use in Objective-C, enter `po [UIFocusDebugger preferredFocusEnvironmentsForEnvironment:
88        /// <environment
89        /// reference>]` when paused in lldb.
90        #[unsafe(method(preferredFocusEnvironmentsForEnvironment:))]
91        #[unsafe(method_family = none)]
92        pub fn preferredFocusEnvironmentsForEnvironment(
93            environment: &ProtocolObject<dyn UIFocusEnvironment>,
94        ) -> Retained<ProtocolObject<dyn UIFocusDebuggerOutput>>;
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl UIFocusDebugger {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
108    );
109}
110
111extern_protocol!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusdebuggeroutput?language=objc)
113    pub unsafe trait UIFocusDebuggerOutput: NSObjectProtocol + MainThreadOnly {}
114);