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::Block<
87 dyn Fn(
88 NonNull<UIAccessibilityCustomRotorSearchPredicate>,
89 ) -> *mut UIAccessibilityCustomRotorItemResult,
90>;
91
92#[cfg(feature = "block2")]
94pub type AXCustomRotorsReturnBlock =
95 *mut block2::Block<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 unsafe fn accessibilityCustomRotors(
110 &self,
111 mtm: MainThreadMarker,
112 ) -> Option<Retained<NSArray<UIAccessibilityCustomRotor>>>;
113
114 #[unsafe(method(setAccessibilityCustomRotors:))]
116 #[unsafe(method_family = none)]
117 unsafe 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 unsafe fn accessibilityCustomRotorsBlock(
127 &self,
128 mtm: MainThreadMarker,
129 ) -> AXCustomRotorsReturnBlock;
130
131 #[cfg(feature = "block2")]
132 #[unsafe(method(setAccessibilityCustomRotorsBlock:))]
134 #[unsafe(method_family = none)]
135 unsafe fn setAccessibilityCustomRotorsBlock(
136 &self,
137 accessibility_custom_rotors_block: AXCustomRotorsReturnBlock,
138 mtm: MainThreadMarker,
139 );
140 );
141}
142
143impl private_NSObjectUIAccessibilityCustomRotor::Sealed for NSObject {}
144unsafe impl NSObjectUIAccessibilityCustomRotor for NSObject {}
145
146extern_class!(
147 #[unsafe(super(NSObject))]
149 #[thread_kind = MainThreadOnly]
150 #[derive(Debug, PartialEq, Eq, Hash)]
151 pub struct UIAccessibilityCustomRotorSearchPredicate;
152);
153
154unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorSearchPredicate {}
155
156impl UIAccessibilityCustomRotorSearchPredicate {
157 extern_methods!(
158 #[unsafe(method(currentItem))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn currentItem(&self) -> Retained<UIAccessibilityCustomRotorItemResult>;
161
162 #[unsafe(method(setCurrentItem:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn setCurrentItem(&self, current_item: &UIAccessibilityCustomRotorItemResult);
166
167 #[unsafe(method(searchDirection))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn searchDirection(&self) -> UIAccessibilityCustomRotorDirection;
170
171 #[unsafe(method(setSearchDirection:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn setSearchDirection(
175 &self,
176 search_direction: UIAccessibilityCustomRotorDirection,
177 );
178 );
179}
180
181impl UIAccessibilityCustomRotorSearchPredicate {
183 extern_methods!(
184 #[unsafe(method(init))]
185 #[unsafe(method_family = init)]
186 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
187
188 #[unsafe(method(new))]
189 #[unsafe(method_family = new)]
190 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
191 );
192}
193
194extern_class!(
195 #[unsafe(super(NSObject))]
197 #[thread_kind = MainThreadOnly]
198 #[derive(Debug, PartialEq, Eq, Hash)]
199 pub struct UIAccessibilityCustomRotor;
200);
201
202unsafe impl NSObjectProtocol for UIAccessibilityCustomRotor {}
203
204impl UIAccessibilityCustomRotor {
205 extern_methods!(
206 #[cfg(feature = "block2")]
207 #[unsafe(method(initWithName:itemSearchBlock:))]
208 #[unsafe(method_family = init)]
209 pub unsafe fn initWithName_itemSearchBlock(
210 this: Allocated<Self>,
211 name: &NSString,
212 item_search_block: UIAccessibilityCustomRotorSearch,
213 ) -> Retained<Self>;
214
215 #[cfg(feature = "block2")]
216 #[unsafe(method(initWithAttributedName:itemSearchBlock:))]
217 #[unsafe(method_family = init)]
218 pub unsafe fn initWithAttributedName_itemSearchBlock(
219 this: Allocated<Self>,
220 attributed_name: &NSAttributedString,
221 item_search_block: UIAccessibilityCustomRotorSearch,
222 ) -> Retained<Self>;
223
224 #[cfg(feature = "block2")]
225 #[unsafe(method(initWithSystemType:itemSearchBlock:))]
226 #[unsafe(method_family = init)]
227 pub unsafe fn initWithSystemType_itemSearchBlock(
228 this: Allocated<Self>,
229 r#type: UIAccessibilityCustomSystemRotorType,
230 item_search_block: UIAccessibilityCustomRotorSearch,
231 ) -> Retained<Self>;
232
233 #[unsafe(method(name))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn name(&self) -> Retained<NSString>;
236
237 #[unsafe(method(setName:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setName(&self, name: &NSString);
241
242 #[unsafe(method(attributedName))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;
245
246 #[unsafe(method(setAttributedName:))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn setAttributedName(&self, attributed_name: &NSAttributedString);
250
251 #[cfg(feature = "block2")]
252 #[unsafe(method(itemSearchBlock))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn itemSearchBlock(&self) -> UIAccessibilityCustomRotorSearch;
255
256 #[cfg(feature = "block2")]
257 #[unsafe(method(setItemSearchBlock:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn setItemSearchBlock(
261 &self,
262 item_search_block: UIAccessibilityCustomRotorSearch,
263 );
264
265 #[unsafe(method(systemRotorType))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn systemRotorType(&self) -> UIAccessibilityCustomSystemRotorType;
268 );
269}
270
271impl UIAccessibilityCustomRotor {
273 extern_methods!(
274 #[unsafe(method(init))]
275 #[unsafe(method_family = init)]
276 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
277
278 #[unsafe(method(new))]
279 #[unsafe(method_family = new)]
280 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
281 );
282}
283
284extern_class!(
285 #[unsafe(super(NSObject))]
287 #[thread_kind = MainThreadOnly]
288 #[derive(Debug, PartialEq, Eq, Hash)]
289 pub struct UIAccessibilityCustomRotorItemResult;
290);
291
292unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorItemResult {}
293
294impl UIAccessibilityCustomRotorItemResult {
295 extern_methods!(
296 #[cfg(feature = "UITextInput")]
297 #[unsafe(method(initWithTargetElement:targetRange:))]
298 #[unsafe(method_family = init)]
299 pub unsafe fn initWithTargetElement_targetRange(
300 this: Allocated<Self>,
301 target_element: &ProtocolObject<dyn NSObjectProtocol>,
302 target_range: Option<&UITextRange>,
303 ) -> Retained<Self>;
304
305 #[unsafe(method(targetElement))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn targetElement(
308 &self,
309 ) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
310
311 #[unsafe(method(setTargetElement:))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn setTargetElement(
316 &self,
317 target_element: Option<&ProtocolObject<dyn NSObjectProtocol>>,
318 );
319
320 #[cfg(feature = "UITextInput")]
321 #[unsafe(method(targetRange))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn targetRange(&self) -> Option<Retained<UITextRange>>;
324
325 #[cfg(feature = "UITextInput")]
326 #[unsafe(method(setTargetRange:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn setTargetRange(&self, target_range: Option<&UITextRange>);
330 );
331}
332
333impl UIAccessibilityCustomRotorItemResult {
335 extern_methods!(
336 #[unsafe(method(init))]
337 #[unsafe(method_family = init)]
338 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
339
340 #[unsafe(method(new))]
341 #[unsafe(method_family = new)]
342 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
343 );
344}