objc2_ui_kit/generated/
UIAccessibilityAdditions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipickerviewaccessibilitydelegate?language=objc)
12    #[cfg(feature = "UIPickerView")]
13    pub unsafe trait UIPickerViewAccessibilityDelegate:
14        UIPickerViewDelegate + MainThreadOnly
15    {
16        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
17        #[optional]
18        #[unsafe(method(pickerView:accessibilityLabelForComponent:))]
19        #[unsafe(method_family = none)]
20        unsafe fn pickerView_accessibilityLabelForComponent(
21            &self,
22            picker_view: &UIPickerView,
23            component: NSInteger,
24        ) -> Option<Retained<NSString>>;
25
26        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
27        #[optional]
28        #[unsafe(method(pickerView:accessibilityHintForComponent:))]
29        #[unsafe(method_family = none)]
30        unsafe fn pickerView_accessibilityHintForComponent(
31            &self,
32            picker_view: &UIPickerView,
33            component: NSInteger,
34        ) -> Option<Retained<NSString>>;
35
36        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
37        #[optional]
38        #[unsafe(method(pickerView:accessibilityUserInputLabelsForComponent:))]
39        #[unsafe(method_family = none)]
40        unsafe fn pickerView_accessibilityUserInputLabelsForComponent(
41            &self,
42            picker_view: &UIPickerView,
43            component: NSInteger,
44        ) -> Retained<NSArray<NSString>>;
45
46        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
47        #[optional]
48        #[unsafe(method(pickerView:accessibilityAttributedLabelForComponent:))]
49        #[unsafe(method_family = none)]
50        unsafe fn pickerView_accessibilityAttributedLabelForComponent(
51            &self,
52            picker_view: &UIPickerView,
53            component: NSInteger,
54        ) -> Option<Retained<NSAttributedString>>;
55
56        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
57        #[optional]
58        #[unsafe(method(pickerView:accessibilityAttributedHintForComponent:))]
59        #[unsafe(method_family = none)]
60        unsafe fn pickerView_accessibilityAttributedHintForComponent(
61            &self,
62            picker_view: &UIPickerView,
63            component: NSInteger,
64        ) -> Option<Retained<NSAttributedString>>;
65
66        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
67        #[optional]
68        #[unsafe(method(pickerView:accessibilityAttributedUserInputLabelsForComponent:))]
69        #[unsafe(method_family = none)]
70        unsafe fn pickerView_accessibilityAttributedUserInputLabelsForComponent(
71            &self,
72            picker_view: &UIPickerView,
73            component: NSInteger,
74        ) -> Retained<NSArray<NSAttributedString>>;
75    }
76);
77
78extern_protocol!(
79    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscrollviewaccessibilitydelegate?language=objc)
80    #[cfg(feature = "UIScrollView")]
81    pub unsafe trait UIScrollViewAccessibilityDelegate:
82        UIScrollViewDelegate + MainThreadOnly
83    {
84        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
85        #[optional]
86        #[unsafe(method(accessibilityScrollStatusForScrollView:))]
87        #[unsafe(method_family = none)]
88        unsafe fn accessibilityScrollStatusForScrollView(
89            &self,
90            scroll_view: &UIScrollView,
91        ) -> Option<Retained<NSString>>;
92
93        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
94        #[optional]
95        #[unsafe(method(accessibilityAttributedScrollStatusForScrollView:))]
96        #[unsafe(method_family = none)]
97        unsafe fn accessibilityAttributedScrollStatusForScrollView(
98            &self,
99            scroll_view: &UIScrollView,
100        ) -> Option<Retained<NSAttributedString>>;
101    }
102);
103
104/// UIAccessibilityInvertColors.
105#[cfg(all(feature = "UIResponder", feature = "UIView"))]
106impl UIView {
107    extern_methods!(
108        #[unsafe(method(accessibilityIgnoresInvertColors))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn accessibilityIgnoresInvertColors(&self) -> bool;
111
112        /// Setter for [`accessibilityIgnoresInvertColors`][Self::accessibilityIgnoresInvertColors].
113        #[unsafe(method(setAccessibilityIgnoresInvertColors:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setAccessibilityIgnoresInvertColors(
116            &self,
117            accessibility_ignores_invert_colors: bool,
118        );
119    );
120}
121
122/// UIAccessibility.
123#[cfg(feature = "UIColor")]
124impl UIColor {
125    extern_methods!(
126        #[unsafe(method(accessibilityName))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn accessibilityName(&self) -> Retained<NSString>;
129    );
130}