objc2_ui_kit/generated/
UIAccessibilityCustomRotor.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UIAccessibilityCustomRotorDirection(pub NSInteger);
15impl UIAccessibilityCustomRotorDirection {
16 #[doc(alias = "UIAccessibilityCustomRotorDirectionPrevious")]
17 pub const Previous: Self = Self(0);
18 #[doc(alias = "UIAccessibilityCustomRotorDirectionNext")]
19 pub const Next: Self = Self(1);
20}
21
22unsafe impl Encode for UIAccessibilityCustomRotorDirection {
23 const ENCODING: Encoding = NSInteger::ENCODING;
24}
25
26unsafe impl RefEncode for UIAccessibilityCustomRotorDirection {
27 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30#[repr(transparent)]
33#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
34pub struct UIAccessibilityCustomSystemRotorType(pub NSInteger);
35impl UIAccessibilityCustomSystemRotorType {
36 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeNone")]
37 pub const None: Self = Self(0);
38 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeLink")]
39 pub const Link: Self = Self(1);
40 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeVisitedLink")]
41 pub const VisitedLink: Self = Self(2);
42 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeading")]
43 pub const Heading: Self = Self(3);
44 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel1")]
45 pub const HeadingLevel1: Self = Self(4);
46 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel2")]
47 pub const HeadingLevel2: Self = Self(5);
48 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel3")]
49 pub const HeadingLevel3: Self = Self(6);
50 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel4")]
51 pub const HeadingLevel4: Self = Self(7);
52 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel5")]
53 pub const HeadingLevel5: Self = Self(8);
54 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel6")]
55 pub const HeadingLevel6: Self = Self(9);
56 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeBoldText")]
57 pub const BoldText: Self = Self(10);
58 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeItalicText")]
59 pub const ItalicText: Self = Self(11);
60 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeUnderlineText")]
61 pub const UnderlineText: Self = Self(12);
62 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeMisspelledWord")]
63 pub const MisspelledWord: Self = Self(13);
64 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeImage")]
65 pub const Image: Self = Self(14);
66 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeTextField")]
67 pub const TextField: Self = Self(15);
68 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeTable")]
69 pub const Table: Self = Self(16);
70 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeList")]
71 pub const List: Self = Self(17);
72 #[doc(alias = "UIAccessibilityCustomSystemRotorTypeLandmark")]
73 pub const Landmark: Self = Self(18);
74}
75
76unsafe impl Encode for UIAccessibilityCustomSystemRotorType {
77 const ENCODING: Encoding = NSInteger::ENCODING;
78}
79
80unsafe impl RefEncode for UIAccessibilityCustomSystemRotorType {
81 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84#[cfg(feature = "block2")]
86pub type UIAccessibilityCustomRotorSearch = *mut block2::DynBlock<
87 dyn Fn(
88 NonNull<UIAccessibilityCustomRotorSearchPredicate>,
89 ) -> *mut UIAccessibilityCustomRotorItemResult,
90>;
91
92#[cfg(feature = "block2")]
94pub type AXCustomRotorsReturnBlock =
95 *mut block2::DynBlock<dyn Fn() -> *mut NSArray<UIAccessibilityCustomRotor>>;
96
97mod private_NSObjectUIAccessibilityCustomRotor {
98 pub trait Sealed {}
99}
100
101#[doc(alias = "UIAccessibilityCustomRotor")]
103pub unsafe trait NSObjectUIAccessibilityCustomRotor:
104 ClassType + Sized + private_NSObjectUIAccessibilityCustomRotor::Sealed
105{
106 extern_methods!(
107 #[unsafe(method(accessibilityCustomRotors))]
108 #[unsafe(method_family = none)]
109 fn accessibilityCustomRotors(
110 &self,
111 mtm: MainThreadMarker,
112 ) -> Option<Retained<NSArray<UIAccessibilityCustomRotor>>>;
113
114 #[unsafe(method(setAccessibilityCustomRotors:))]
116 #[unsafe(method_family = none)]
117 fn setAccessibilityCustomRotors(
118 &self,
119 accessibility_custom_rotors: Option<&NSArray<UIAccessibilityCustomRotor>>,
120 mtm: MainThreadMarker,
121 );
122
123 #[cfg(feature = "block2")]
124 #[unsafe(method(accessibilityCustomRotorsBlock))]
125 #[unsafe(method_family = none)]
126 fn accessibilityCustomRotorsBlock(
127 &self,
128 mtm: MainThreadMarker,
129 ) -> AXCustomRotorsReturnBlock;
130
131 #[cfg(feature = "block2")]
132 #[unsafe(method(setAccessibilityCustomRotorsBlock:))]
140 #[unsafe(method_family = none)]
141 unsafe fn setAccessibilityCustomRotorsBlock(
142 &self,
143 accessibility_custom_rotors_block: AXCustomRotorsReturnBlock,
144 mtm: MainThreadMarker,
145 );
146 );
147}
148
149impl private_NSObjectUIAccessibilityCustomRotor::Sealed for NSObject {}
150unsafe impl NSObjectUIAccessibilityCustomRotor for NSObject {}
151
152extern_class!(
153 #[unsafe(super(NSObject))]
155 #[thread_kind = MainThreadOnly]
156 #[derive(Debug, PartialEq, Eq, Hash)]
157 pub struct UIAccessibilityCustomRotorSearchPredicate;
158);
159
160extern_conformance!(
161 unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorSearchPredicate {}
162);
163
164impl UIAccessibilityCustomRotorSearchPredicate {
165 extern_methods!(
166 #[unsafe(method(currentItem))]
167 #[unsafe(method_family = none)]
168 pub fn currentItem(&self) -> Retained<UIAccessibilityCustomRotorItemResult>;
169
170 #[unsafe(method(setCurrentItem:))]
172 #[unsafe(method_family = none)]
173 pub fn setCurrentItem(&self, current_item: &UIAccessibilityCustomRotorItemResult);
174
175 #[unsafe(method(searchDirection))]
176 #[unsafe(method_family = none)]
177 pub fn searchDirection(&self) -> UIAccessibilityCustomRotorDirection;
178
179 #[unsafe(method(setSearchDirection:))]
181 #[unsafe(method_family = none)]
182 pub fn setSearchDirection(&self, search_direction: UIAccessibilityCustomRotorDirection);
183 );
184}
185
186impl UIAccessibilityCustomRotorSearchPredicate {
188 extern_methods!(
189 #[unsafe(method(init))]
190 #[unsafe(method_family = init)]
191 pub fn init(this: Allocated<Self>) -> Retained<Self>;
192
193 #[unsafe(method(new))]
194 #[unsafe(method_family = new)]
195 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
196 );
197}
198
199extern_class!(
200 #[unsafe(super(NSObject))]
202 #[thread_kind = MainThreadOnly]
203 #[derive(Debug, PartialEq, Eq, Hash)]
204 pub struct UIAccessibilityCustomRotor;
205);
206
207extern_conformance!(
208 unsafe impl NSObjectProtocol for UIAccessibilityCustomRotor {}
209);
210
211impl UIAccessibilityCustomRotor {
212 extern_methods!(
213 #[cfg(feature = "block2")]
214 #[unsafe(method(initWithName:itemSearchBlock:))]
218 #[unsafe(method_family = init)]
219 pub unsafe fn initWithName_itemSearchBlock(
220 this: Allocated<Self>,
221 name: &NSString,
222 item_search_block: UIAccessibilityCustomRotorSearch,
223 ) -> Retained<Self>;
224
225 #[cfg(feature = "block2")]
226 #[unsafe(method(initWithAttributedName:itemSearchBlock:))]
230 #[unsafe(method_family = init)]
231 pub unsafe fn initWithAttributedName_itemSearchBlock(
232 this: Allocated<Self>,
233 attributed_name: &NSAttributedString,
234 item_search_block: UIAccessibilityCustomRotorSearch,
235 ) -> Retained<Self>;
236
237 #[cfg(feature = "block2")]
238 #[unsafe(method(initWithSystemType:itemSearchBlock:))]
242 #[unsafe(method_family = init)]
243 pub unsafe fn initWithSystemType_itemSearchBlock(
244 this: Allocated<Self>,
245 r#type: UIAccessibilityCustomSystemRotorType,
246 item_search_block: UIAccessibilityCustomRotorSearch,
247 ) -> Retained<Self>;
248
249 #[unsafe(method(name))]
250 #[unsafe(method_family = none)]
251 pub fn name(&self) -> Retained<NSString>;
252
253 #[unsafe(method(setName:))]
257 #[unsafe(method_family = none)]
258 pub fn setName(&self, name: &NSString);
259
260 #[unsafe(method(attributedName))]
261 #[unsafe(method_family = none)]
262 pub fn attributedName(&self) -> Retained<NSAttributedString>;
263
264 #[unsafe(method(setAttributedName:))]
268 #[unsafe(method_family = none)]
269 pub fn setAttributedName(&self, attributed_name: &NSAttributedString);
270
271 #[cfg(feature = "block2")]
272 #[unsafe(method(itemSearchBlock))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn itemSearchBlock(&self) -> UIAccessibilityCustomRotorSearch;
278
279 #[cfg(feature = "block2")]
280 #[unsafe(method(setItemSearchBlock:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn setItemSearchBlock(
290 &self,
291 item_search_block: UIAccessibilityCustomRotorSearch,
292 );
293
294 #[unsafe(method(systemRotorType))]
295 #[unsafe(method_family = none)]
296 pub fn systemRotorType(&self) -> UIAccessibilityCustomSystemRotorType;
297 );
298}
299
300impl UIAccessibilityCustomRotor {
302 extern_methods!(
303 #[unsafe(method(init))]
304 #[unsafe(method_family = init)]
305 pub fn init(this: Allocated<Self>) -> Retained<Self>;
306
307 #[unsafe(method(new))]
308 #[unsafe(method_family = new)]
309 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
310 );
311}
312
313extern_class!(
314 #[unsafe(super(NSObject))]
316 #[thread_kind = MainThreadOnly]
317 #[derive(Debug, PartialEq, Eq, Hash)]
318 pub struct UIAccessibilityCustomRotorItemResult;
319);
320
321extern_conformance!(
322 unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorItemResult {}
323);
324
325impl UIAccessibilityCustomRotorItemResult {
326 extern_methods!(
327 #[cfg(feature = "UITextInput")]
328 #[unsafe(method(initWithTargetElement:targetRange:))]
332 #[unsafe(method_family = init)]
333 pub unsafe fn initWithTargetElement_targetRange(
334 this: Allocated<Self>,
335 target_element: &ProtocolObject<dyn NSObjectProtocol>,
336 target_range: Option<&UITextRange>,
337 ) -> Retained<Self>;
338
339 #[unsafe(method(targetElement))]
340 #[unsafe(method_family = none)]
341 pub fn targetElement(&self) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
342
343 #[unsafe(method(setTargetElement:))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn setTargetElement(
353 &self,
354 target_element: Option<&ProtocolObject<dyn NSObjectProtocol>>,
355 );
356
357 #[cfg(feature = "UITextInput")]
358 #[unsafe(method(targetRange))]
359 #[unsafe(method_family = none)]
360 pub fn targetRange(&self) -> Option<Retained<UITextRange>>;
361
362 #[cfg(feature = "UITextInput")]
363 #[unsafe(method(setTargetRange:))]
365 #[unsafe(method_family = none)]
366 pub fn setTargetRange(&self, target_range: Option<&UITextRange>);
367 );
368}
369
370impl UIAccessibilityCustomRotorItemResult {
372 extern_methods!(
373 #[unsafe(method(init))]
374 #[unsafe(method_family = init)]
375 pub fn init(this: Allocated<Self>) -> Retained<Self>;
376
377 #[unsafe(method(new))]
378 #[unsafe(method_family = new)]
379 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
380 );
381}