objc2_browser_engine_kit/generated/
BEAccessibilityTextMarker.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// Subclass BEAccessibilityTextMarker to encode information about text-based positioning information in browser engines within document models.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarker?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct BEAccessibilityTextMarker;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for BEAccessibilityTextMarker {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for BEAccessibilityTextMarker {}
27);
28
29unsafe impl CopyingHelper for BEAccessibilityTextMarker {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for BEAccessibilityTextMarker {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for BEAccessibilityTextMarker {}
39);
40
41impl BEAccessibilityTextMarker {
42    extern_methods!();
43}
44
45/// Methods declared on superclass `NSObject`.
46impl BEAccessibilityTextMarker {
47    extern_methods!(
48        #[unsafe(method(init))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
51
52        #[unsafe(method(new))]
53        #[unsafe(method_family = new)]
54        pub unsafe fn new() -> Retained<Self>;
55    );
56}
57
58extern_class!(
59    /// BEAccessibilityTextMarkerRange holds the start and end markers for a text range.
60    ///
61    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarkerrange?language=objc)
62    #[unsafe(super(NSObject))]
63    #[derive(Debug, PartialEq, Eq, Hash)]
64    pub struct BEAccessibilityTextMarkerRange;
65);
66
67extern_conformance!(
68    unsafe impl NSCoding for BEAccessibilityTextMarkerRange {}
69);
70
71extern_conformance!(
72    unsafe impl NSCopying for BEAccessibilityTextMarkerRange {}
73);
74
75unsafe impl CopyingHelper for BEAccessibilityTextMarkerRange {
76    type Result = Self;
77}
78
79extern_conformance!(
80    unsafe impl NSObjectProtocol for BEAccessibilityTextMarkerRange {}
81);
82
83extern_conformance!(
84    unsafe impl NSSecureCoding for BEAccessibilityTextMarkerRange {}
85);
86
87impl BEAccessibilityTextMarkerRange {
88    extern_methods!(
89        #[unsafe(method(startMarker))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn startMarker(&self) -> Retained<BEAccessibilityTextMarker>;
92
93        /// Setter for [`startMarker`][Self::startMarker].
94        #[unsafe(method(setStartMarker:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setStartMarker(&self, start_marker: &BEAccessibilityTextMarker);
97
98        #[unsafe(method(endMarker))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn endMarker(&self) -> Retained<BEAccessibilityTextMarker>;
101
102        /// Setter for [`endMarker`][Self::endMarker].
103        #[unsafe(method(setEndMarker:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setEndMarker(&self, end_marker: &BEAccessibilityTextMarker);
106    );
107}
108
109/// Methods declared on superclass `NSObject`.
110impl BEAccessibilityTextMarkerRange {
111    extern_methods!(
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new() -> Retained<Self>;
119    );
120}
121
122extern_protocol!(
123    /// Implement BEAccessibilityTextMarkerSupport to support assistive technology features that rely on granular text offsets.
124    ///
125    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarkersupport?language=objc)
126    pub unsafe trait BEAccessibilityTextMarkerSupport: NSObjectProtocol {
127        #[cfg(feature = "objc2-core-foundation")]
128        /// The accessibility frame for a text range.
129        ///
130        /// Parameter `range`: The text marker range.
131        ///
132        /// Returns: The bounds in accessibility space of the text marker range. If the bounds cannot be determined, return CGRectZero.
133        #[unsafe(method(accessibilityBoundsForTextMarkerRange:))]
134        #[unsafe(method_family = none)]
135        unsafe fn accessibilityBoundsForTextMarkerRange(
136            &self,
137            range: &BEAccessibilityTextMarkerRange,
138        ) -> CGRect;
139
140        /// The accessibility content for a text range.
141        ///
142        /// Parameter `range`: The text marker range.
143        #[unsafe(method(accessibilityContentForTextMarkerRange:))]
144        #[unsafe(method_family = none)]
145        unsafe fn accessibilityContentForTextMarkerRange(
146            &self,
147            range: &BEAccessibilityTextMarkerRange,
148        ) -> Option<Retained<NSString>>;
149
150        /// The text marker range of the current selection. Return nil if there is none.
151        #[unsafe(method(accessibilityTextMarkerRangeForCurrentSelection))]
152        #[unsafe(method_family = none)]
153        unsafe fn accessibilityTextMarkerRangeForCurrentSelection(
154            &self,
155        ) -> Option<Retained<BEAccessibilityTextMarkerRange>>;
156
157        /// The text marker range of the current element.
158        #[unsafe(method(accessibilityTextMarkerRange))]
159        #[unsafe(method_family = none)]
160        unsafe fn accessibilityTextMarkerRange(&self) -> Retained<BEAccessibilityTextMarkerRange>;
161
162        /// The text marker after the marker.
163        ///
164        /// Parameter `marker`: The text marker.
165        #[unsafe(method(accessibilityNextTextMarker:))]
166        #[unsafe(method_family = none)]
167        unsafe fn accessibilityNextTextMarker(
168            &self,
169            marker: &BEAccessibilityTextMarker,
170        ) -> Option<Retained<BEAccessibilityTextMarker>>;
171
172        /// The text marker before the marker.
173        ///
174        /// Parameter `marker`: The text marker.
175        #[unsafe(method(accessibilityPreviousTextMarker:))]
176        #[unsafe(method_family = none)]
177        unsafe fn accessibilityPreviousTextMarker(
178            &self,
179            marker: &BEAccessibilityTextMarker,
180        ) -> Option<Retained<BEAccessibilityTextMarker>>;
181
182        /// The text marker representing the end-of-line position of the line pointed to by the given marker.
183        ///
184        /// Parameter `marker`: The text marker.
185        #[unsafe(method(accessibilityLineEndMarkerForMarker:))]
186        #[unsafe(method_family = none)]
187        unsafe fn accessibilityLineEndMarkerForMarker(
188            &self,
189            marker: &BEAccessibilityTextMarker,
190        ) -> Option<Retained<BEAccessibilityTextMarker>>;
191
192        /// The text marker representing the start-of-line position of the line pointed to by the given marker.
193        ///
194        /// Parameter `marker`: The text marker.
195        #[unsafe(method(accessibilityLineStartMarkerForMarker:))]
196        #[unsafe(method_family = none)]
197        unsafe fn accessibilityLineStartMarkerForMarker(
198            &self,
199            marker: &BEAccessibilityTextMarker,
200        ) -> Option<Retained<BEAccessibilityTextMarker>>;
201
202        #[cfg(feature = "objc2-core-foundation")]
203        /// The text marker for the specific point.
204        ///
205        /// Parameter `point`: A point in view space.
206        #[unsafe(method(accessibilityMarkerForPoint:))]
207        #[unsafe(method_family = none)]
208        unsafe fn accessibilityMarkerForPoint(
209            &self,
210            point: CGPoint,
211        ) -> Option<Retained<BEAccessibilityTextMarker>>;
212
213        /// The text marker given an index-based position.
214        ///
215        /// Parameter `position`: The text position as an index.
216        #[unsafe(method(accessibilityTextMarkerForPosition:))]
217        #[unsafe(method_family = none)]
218        unsafe fn accessibilityTextMarkerForPosition(
219            &self,
220            position: NSInteger,
221        ) -> Option<Retained<BEAccessibilityTextMarker>>;
222
223        /// The text marker range given an index-based range.
224        ///
225        /// Parameter `range`: The text marker range as an NSRange.
226        #[unsafe(method(accessibilityTextMarkerRangeForRange:))]
227        #[unsafe(method_family = none)]
228        unsafe fn accessibilityTextMarkerRangeForRange(
229            &self,
230            range: NSRange,
231        ) -> Option<Retained<BEAccessibilityTextMarkerRange>>;
232
233        /// The index-based range given a text marker range.
234        ///
235        /// Parameter `range`: The text marker range.
236        #[unsafe(method(accessibilityRangeForTextMarkerRange:))]
237        #[unsafe(method_family = none)]
238        unsafe fn accessibilityRangeForTextMarkerRange(
239            &self,
240            range: &BEAccessibilityTextMarkerRange,
241        ) -> NSRange;
242    }
243);