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