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")]
22extern_conformance!(
23 unsafe impl NSCoding for UIFocusGuide {}
24);
25
26#[cfg(feature = "UILayoutGuide")]
27extern_conformance!(
28 unsafe impl NSObjectProtocol for UIFocusGuide {}
29);
30
31#[cfg(feature = "UILayoutGuide")]
32impl UIFocusGuide {
33 extern_methods!(
34 #[unsafe(method(isEnabled))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn isEnabled(&self) -> bool;
38
39 #[unsafe(method(setEnabled:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn setEnabled(&self, enabled: bool);
43
44 #[cfg(feature = "UIFocus")]
45 #[unsafe(method(preferredFocusEnvironments))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn preferredFocusEnvironments(
50 &self,
51 ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>;
52
53 #[cfg(feature = "UIFocus")]
54 #[unsafe(method(setPreferredFocusEnvironments:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setPreferredFocusEnvironments(
58 &self,
59 preferred_focus_environments: Option<&NSArray<ProtocolObject<dyn UIFocusEnvironment>>>,
60 );
61
62 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
63 #[deprecated]
65 #[unsafe(method(preferredFocusedView))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn preferredFocusedView(&self) -> Option<Retained<UIView>>;
68
69 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
70 #[deprecated]
73 #[unsafe(method(setPreferredFocusedView:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setPreferredFocusedView(&self, preferred_focused_view: Option<&UIView>);
76 );
77}
78
79#[cfg(feature = "UILayoutGuide")]
81impl UIFocusGuide {
82 extern_methods!(
83 #[unsafe(method(init))]
84 #[unsafe(method_family = init)]
85 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87 #[unsafe(method(new))]
88 #[unsafe(method_family = new)]
89 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
90 );
91}