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 fn isEnabled(&self) -> bool;
38
39 #[unsafe(method(setEnabled:))]
41 #[unsafe(method_family = none)]
42 pub fn setEnabled(&self, enabled: bool);
43
44 #[cfg(feature = "UIFocus")]
45 #[unsafe(method(preferredFocusEnvironments))]
48 #[unsafe(method_family = none)]
49 pub fn preferredFocusEnvironments(
50 &self,
51 ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>;
52
53 #[cfg(feature = "UIFocus")]
54 #[unsafe(method(setPreferredFocusEnvironments:))]
58 #[unsafe(method_family = none)]
59 pub fn setPreferredFocusEnvironments(
60 &self,
61 preferred_focus_environments: Option<&NSArray<ProtocolObject<dyn UIFocusEnvironment>>>,
62 );
63
64 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
65 #[deprecated]
67 #[unsafe(method(preferredFocusedView))]
68 #[unsafe(method_family = none)]
69 pub fn preferredFocusedView(&self) -> Option<Retained<UIView>>;
70
71 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
72 #[deprecated]
76 #[unsafe(method(setPreferredFocusedView:))]
77 #[unsafe(method_family = none)]
78 pub fn setPreferredFocusedView(&self, preferred_focused_view: Option<&UIView>);
79 );
80}
81
82#[cfg(feature = "UILayoutGuide")]
84impl UIFocusGuide {
85 extern_methods!(
86 #[unsafe(method(init))]
87 #[unsafe(method_family = init)]
88 pub fn init(this: Allocated<Self>) -> Retained<Self>;
89
90 #[unsafe(method(new))]
91 #[unsafe(method_family = new)]
92 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
93 );
94}