1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// UIFocusGuides are UILayoutGuide subclasses that participate in the focus system from within their owning view. A UIFocusGuide may be used to expose non-view areas as focusable.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uifocusguide?language=objc)
#[unsafe(super(UILayoutGuide, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UILayoutGuide")]
pub struct UIFocusGuide;
);
#[cfg(feature = "UILayoutGuide")]
extern_conformance!(
unsafe impl NSCoding for UIFocusGuide {}
);
#[cfg(feature = "UILayoutGuide")]
extern_conformance!(
unsafe impl NSObjectProtocol for UIFocusGuide {}
);
#[cfg(feature = "UILayoutGuide")]
impl UIFocusGuide {
extern_methods!(
/// If disabled, UIFocusGuides are ignored by the focus engine, but still participate in layout. Modifying this flag allows you to conditionally enable or disable certain focus behaviors. YES by default.
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub fn isEnabled(&self) -> bool;
/// Setter for [`isEnabled`][Self::isEnabled].
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub fn setEnabled(&self, enabled: bool);
#[cfg(feature = "UIFocus")]
/// Setting preferredFocusEnvironments to a non-empty array marks this guide's layoutFrame as focusable. If empty, this guide is effectively disabled.
/// If focused, the guide attempts to redirect focus to each environment in the array, in order, stopping when a focusable item in an environment has been found.
#[unsafe(method(preferredFocusEnvironments))]
#[unsafe(method_family = none)]
pub fn preferredFocusEnvironments(
&self,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>;
#[cfg(feature = "UIFocus")]
/// Setter for [`preferredFocusEnvironments`][Self::preferredFocusEnvironments].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setPreferredFocusEnvironments:))]
#[unsafe(method_family = none)]
pub fn setPreferredFocusEnvironments(
&self,
preferred_focus_environments: Option<&NSArray<ProtocolObject<dyn UIFocusEnvironment>>>,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
/// Setting a preferred focused view marks this guide's layoutFrame as focusable, and if focused, redirects focus to its preferred focused view. If nil, this guide is effectively disabled.
#[deprecated]
#[unsafe(method(preferredFocusedView))]
#[unsafe(method_family = none)]
pub fn preferredFocusedView(&self) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
/// Setter for [`preferredFocusedView`][Self::preferredFocusedView].
///
/// This is a [weak property][objc2::topics::weak_property].
#[deprecated]
#[unsafe(method(setPreferredFocusedView:))]
#[unsafe(method_family = none)]
pub fn setPreferredFocusedView(&self, preferred_focused_view: Option<&UIView>);
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "UILayoutGuide")]
impl UIFocusGuide {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}