objc2_ui_kit/generated/
UIFocusGuide.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(UILayoutGuide, NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "UILayoutGuide")]
18 pub struct UIFocusGuide;
19);
20
21#[cfg(feature = "UILayoutGuide")]
22unsafe impl NSCoding for UIFocusGuide {}
23
24#[cfg(feature = "UILayoutGuide")]
25unsafe impl NSObjectProtocol for UIFocusGuide {}
26
27#[cfg(feature = "UILayoutGuide")]
28impl UIFocusGuide {
29 extern_methods!(
30 #[unsafe(method(isEnabled))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn isEnabled(&self) -> bool;
34
35 #[unsafe(method(setEnabled:))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn setEnabled(&self, enabled: bool);
39
40 #[cfg(feature = "UIFocus")]
41 #[unsafe(method(preferredFocusEnvironments))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn preferredFocusEnvironments(
46 &self,
47 ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>;
48
49 #[cfg(feature = "UIFocus")]
50 #[unsafe(method(setPreferredFocusEnvironments:))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn setPreferredFocusEnvironments(
54 &self,
55 preferred_focus_environments: Option<&NSArray<ProtocolObject<dyn UIFocusEnvironment>>>,
56 );
57
58 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
59 #[deprecated]
61 #[unsafe(method(preferredFocusedView))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn preferredFocusedView(&self) -> Option<Retained<UIView>>;
64
65 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
66 #[deprecated]
69 #[unsafe(method(setPreferredFocusedView:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setPreferredFocusedView(&self, preferred_focused_view: Option<&UIView>);
72 );
73}
74
75#[cfg(feature = "UILayoutGuide")]
77impl UIFocusGuide {
78 extern_methods!(
79 #[unsafe(method(init))]
80 #[unsafe(method_family = init)]
81 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83 #[unsafe(method(new))]
84 #[unsafe(method_family = new)]
85 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
86 );
87}