objc2_browser_engine_kit/generated/
BEAccessibility.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
10/// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitypressedstate?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct BEAccessibilityPressedState(pub NSInteger);
15impl BEAccessibilityPressedState {
16    #[doc(alias = "BEAccessibilityPressedStateUndefined")]
17    pub const Undefined: Self = Self(0);
18    #[doc(alias = "BEAccessibilityPressedStateFalse")]
19    pub const False: Self = Self(1);
20    #[doc(alias = "BEAccessibilityPressedStateTrue")]
21    pub const True: Self = Self(2);
22    #[doc(alias = "BEAccessibilityPressedStateMixed")]
23    pub const Mixed: Self = Self(3);
24}
25
26unsafe impl Encode for BEAccessibilityPressedState {
27    const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for BEAccessibilityPressedState {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34/// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitycontainertype?language=objc)
35// NS_OPTIONS
36#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct BEAccessibilityContainerType(pub NSUInteger);
39bitflags::bitflags! {
40    impl BEAccessibilityContainerType: NSUInteger {
41        #[doc(alias = "BEAccessibilityContainerTypeNone")]
42        const None = 0;
43        #[doc(alias = "BEAccessibilityContainerTypeLandmark")]
44        const Landmark = 1<<0;
45        #[doc(alias = "BEAccessibilityContainerTypeTable")]
46        const Table = 1<<1;
47        #[doc(alias = "BEAccessibilityContainerTypeList")]
48        const List = 1<<2;
49        #[doc(alias = "BEAccessibilityContainerTypeFieldset")]
50        const Fieldset = 1<<3;
51        #[doc(alias = "BEAccessibilityContainerTypeDialog")]
52        const Dialog = 1<<4;
53        #[doc(alias = "BEAccessibilityContainerTypeTree")]
54        const Tree = 1<<5;
55        #[doc(alias = "BEAccessibilityContainerTypeFrame")]
56        const Frame = 1<<6;
57        #[doc(alias = "BEAccessibilityContainerTypeArticle")]
58        const Article = 1<<7;
59        #[doc(alias = "BEAccessibilityContainerTypeSemanticGroup")]
60        const SemanticGroup = 1<<8;
61        #[doc(alias = "BEAccessibilityContainerTypeScrollArea")]
62        const ScrollArea = 1<<9;
63        #[doc(alias = "BEAccessibilityContainerTypeAlert")]
64        const Alert = 1<<10;
65        #[doc(alias = "BEAccessibilityContainerTypeDescriptionList")]
66        const DescriptionList = 1<<11;
67    }
68}
69
70unsafe impl Encode for BEAccessibilityContainerType {
71    const ENCODING: Encoding = NSUInteger::ENCODING;
72}
73
74unsafe impl RefEncode for BEAccessibilityContainerType {
75    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78mod private_NSObjectBEAccessibility {
79    pub trait Sealed {}
80}
81
82/// Category "BEAccessibility" on [`NSObject`].
83#[doc(alias = "BEAccessibility")]
84pub unsafe trait NSObjectBEAccessibility:
85    ClassType + Sized + private_NSObjectBEAccessibility::Sealed
86{
87    extern_methods!(
88        /// Represents the value of aria-current.
89        /// default: nil
90        #[unsafe(method(browserAccessibilityCurrentStatus))]
91        #[unsafe(method_family = none)]
92        unsafe fn browserAccessibilityCurrentStatus(&self) -> Option<Retained<NSString>>;
93
94        /// Setter for [`browserAccessibilityCurrentStatus`][Self::browserAccessibilityCurrentStatus].
95        #[unsafe(method(setBrowserAccessibilityCurrentStatus:))]
96        #[unsafe(method_family = none)]
97        unsafe fn setBrowserAccessibilityCurrentStatus(
98            &self,
99            browser_accessibility_current_status: Option<&NSString>,
100        );
101
102        /// Represents the value of aria-sort.
103        /// default: nil
104        #[unsafe(method(browserAccessibilitySortDirection))]
105        #[unsafe(method_family = none)]
106        unsafe fn browserAccessibilitySortDirection(&self) -> Option<Retained<NSString>>;
107
108        /// Setter for [`browserAccessibilitySortDirection`][Self::browserAccessibilitySortDirection].
109        #[unsafe(method(setBrowserAccessibilitySortDirection:))]
110        #[unsafe(method_family = none)]
111        unsafe fn setBrowserAccessibilitySortDirection(
112            &self,
113            browser_accessibility_sort_direction: Option<&NSString>,
114        );
115
116        /// Represents the value of aria-roledescription.
117        /// default: nil
118        #[unsafe(method(browserAccessibilityRoleDescription))]
119        #[unsafe(method_family = none)]
120        unsafe fn browserAccessibilityRoleDescription(&self) -> Option<Retained<NSString>>;
121
122        /// Setter for [`browserAccessibilityRoleDescription`][Self::browserAccessibilityRoleDescription].
123        #[unsafe(method(setBrowserAccessibilityRoleDescription:))]
124        #[unsafe(method_family = none)]
125        unsafe fn setBrowserAccessibilityRoleDescription(
126            &self,
127            browser_accessibility_role_description: Option<&NSString>,
128        );
129
130        /// Represents the value of aria-required.
131        /// default: false
132        #[unsafe(method(browserAccessibilityIsRequired))]
133        #[unsafe(method_family = none)]
134        unsafe fn browserAccessibilityIsRequired(&self) -> bool;
135
136        /// Setter for [`browserAccessibilityIsRequired`][Self::browserAccessibilityIsRequired].
137        #[unsafe(method(setBrowserAccessibilityIsRequired:))]
138        #[unsafe(method_family = none)]
139        unsafe fn setBrowserAccessibilityIsRequired(&self, browser_accessibility_is_required: bool);
140
141        /// Represents the value of aria-pressed.
142        /// default: BEAccessibilityPressedStateUndefined
143        #[unsafe(method(browserAccessibilityPressedState))]
144        #[unsafe(method_family = none)]
145        unsafe fn browserAccessibilityPressedState(&self) -> BEAccessibilityPressedState;
146
147        /// Setter for [`browserAccessibilityPressedState`][Self::browserAccessibilityPressedState].
148        #[unsafe(method(setBrowserAccessibilityPressedState:))]
149        #[unsafe(method_family = none)]
150        unsafe fn setBrowserAccessibilityPressedState(
151            &self,
152            browser_accessibility_pressed_state: BEAccessibilityPressedState,
153        );
154
155        /// Represents whether the current element has native DOM focus.
156        /// default: false
157        #[unsafe(method(browserAccessibilityHasDOMFocus))]
158        #[unsafe(method_family = none)]
159        unsafe fn browserAccessibilityHasDOMFocus(&self) -> bool;
160
161        /// Setter for [`browserAccessibilityHasDOMFocus`][Self::browserAccessibilityHasDOMFocus].
162        #[unsafe(method(setBrowserAccessibilityHasDOMFocus:))]
163        #[unsafe(method_family = none)]
164        unsafe fn setBrowserAccessibilityHasDOMFocus(
165            &self,
166            browser_accessibility_has_dom_focus: bool,
167        );
168
169        /// An option set of the types that contain this element. For example, an object within a table cell
170        /// will return the Table container type.
171        /// default: BEAccessibilityContainerTypeNone
172        #[unsafe(method(browserAccessibilityContainerType))]
173        #[unsafe(method_family = none)]
174        unsafe fn browserAccessibilityContainerType(&self) -> BEAccessibilityContainerType;
175
176        /// Setter for [`browserAccessibilityContainerType`][Self::browserAccessibilityContainerType].
177        #[unsafe(method(setBrowserAccessibilityContainerType:))]
178        #[unsafe(method_family = none)]
179        unsafe fn setBrowserAccessibilityContainerType(
180            &self,
181            browser_accessibility_container_type: BEAccessibilityContainerType,
182        );
183
184        /// Returns an range representing the selected text on the page.
185        /// default: { NSNotFound, 0 }
186        #[unsafe(method(browserAccessibilitySelectedTextRange))]
187        #[unsafe(method_family = none)]
188        unsafe fn browserAccessibilitySelectedTextRange(&self) -> NSRange;
189
190        /// Set the selected text range.
191        ///
192        /// Parameter `range`: The range to make selected.
193        #[unsafe(method(browserAccessibilitySetSelectedTextRange:))]
194        #[unsafe(method_family = none)]
195        unsafe fn browserAccessibilitySetSelectedTextRange(&self, range: NSRange);
196
197        /// Returns the value of this element in the given range.
198        ///
199        /// Parameter `range`: The range of this element's value to return.
200        #[unsafe(method(browserAccessibilityValueInRange:))]
201        #[unsafe(method_family = none)]
202        unsafe fn browserAccessibilityValueInRange(&self, range: NSRange) -> Retained<NSString>;
203
204        /// Returns the attributed value of this element in the given range.
205        ///
206        /// Parameter `range`: The range of this element's value to return.
207        #[unsafe(method(browserAccessibilityAttributedValueInRange:))]
208        #[unsafe(method_family = none)]
209        unsafe fn browserAccessibilityAttributedValueInRange(
210            &self,
211            range: NSRange,
212        ) -> Retained<NSAttributedString>;
213
214        /// Insert text at the current cursor position.
215        ///
216        /// Parameter `text`: The text to insert.
217        #[unsafe(method(browserAccessibilityInsertTextAtCursor:))]
218        #[unsafe(method_family = none)]
219        unsafe fn browserAccessibilityInsertTextAtCursor(&self, text: &NSString);
220
221        /// Delete text at the current cursor position.
222        ///
223        /// Parameter `numberOfCharacters`: Number of characters to delete.
224        #[unsafe(method(browserAccessibilityDeleteTextAtCursor:))]
225        #[unsafe(method_family = none)]
226        unsafe fn browserAccessibilityDeleteTextAtCursor(&self, number_of_characters: NSInteger);
227
228        /// The text cursor position of the soft line end should be returned, starting from the current selection (or beginning if no selection).
229        #[unsafe(method(accessibilityLineEndPositionFromCurrentSelection))]
230        #[unsafe(method_family = none)]
231        unsafe fn accessibilityLineEndPositionFromCurrentSelection(&self) -> NSInteger;
232
233        /// The text cursor position of the soft line start should be returned, starting from the current selection (or beginning if no selection).
234        #[unsafe(method(accessibilityLineStartPositionFromCurrentSelection))]
235        #[unsafe(method_family = none)]
236        unsafe fn accessibilityLineStartPositionFromCurrentSelection(&self) -> NSInteger;
237
238        /// The text cursor range of the soft line should be returned depending on the position.
239        ///
240        /// Parameter `position`: A text cursor position within a line of text.
241        #[unsafe(method(accessibilityLineRangeForPosition:))]
242        #[unsafe(method_family = none)]
243        unsafe fn accessibilityLineRangeForPosition(&self, position: NSInteger) -> NSRange;
244    );
245}
246
247impl private_NSObjectBEAccessibility::Sealed for NSObject {}
248unsafe impl NSObjectBEAccessibility for NSObject {}