objc2_ui_kit/generated/
UIAccessibilityCustomRotor.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/uikit/uiaccessibilitycustomrotordirection?language=objc)
11// NS_ENUM
12#[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/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomsystemrotortype?language=objc)
31// NS_ENUM
32#[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/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomrotorsearch?language=objc)
85#[cfg(feature = "block2")]
86pub type UIAccessibilityCustomRotorSearch = *mut block2::DynBlock<
87    dyn Fn(
88        NonNull<UIAccessibilityCustomRotorSearchPredicate>,
89    ) -> *mut UIAccessibilityCustomRotorItemResult,
90>;
91
92/// [Apple's documentation](https://developer.apple.com/documentation/uikit/axcustomrotorsreturnblock?language=objc)
93#[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/// Category "UIAccessibilityCustomRotor" on [`NSObject`].
102#[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        /// Setter for [`accessibilityCustomRotors`][Self::accessibilityCustomRotors].
115        #[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        /// Setter for [`accessibilityCustomRotorsBlock`][Self::accessibilityCustomRotorsBlock].
133        ///
134        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
135        ///
136        /// # Safety
137        ///
138        /// `accessibility_custom_rotors_block` must be a valid pointer or null.
139        #[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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomrotorsearchpredicate?language=objc)
154    #[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        /// Setter for [`currentItem`][Self::currentItem].
171        #[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        /// Setter for [`searchDirection`][Self::searchDirection].
180        #[unsafe(method(setSearchDirection:))]
181        #[unsafe(method_family = none)]
182        pub fn setSearchDirection(&self, search_direction: UIAccessibilityCustomRotorDirection);
183    );
184}
185
186/// Methods declared on superclass `NSObject`.
187impl 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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomrotor?language=objc)
201    #[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        /// # Safety
215        ///
216        /// `item_search_block` must be a valid pointer.
217        #[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        /// # Safety
227        ///
228        /// `item_search_block` must be a valid pointer.
229        #[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        /// # Safety
239        ///
240        /// `item_search_block` must be a valid pointer.
241        #[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        /// Setter for [`name`][Self::name].
254        ///
255        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
256        #[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        /// Setter for [`attributedName`][Self::attributedName].
265        ///
266        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
267        #[unsafe(method(setAttributedName:))]
268        #[unsafe(method_family = none)]
269        pub fn setAttributedName(&self, attributed_name: &NSAttributedString);
270
271        #[cfg(feature = "block2")]
272        /// # Safety
273        ///
274        /// The returned block's argument must be a valid pointer.
275        #[unsafe(method(itemSearchBlock))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn itemSearchBlock(&self) -> UIAccessibilityCustomRotorSearch;
278
279        #[cfg(feature = "block2")]
280        /// Setter for [`itemSearchBlock`][Self::itemSearchBlock].
281        ///
282        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
283        ///
284        /// # Safety
285        ///
286        /// `item_search_block` must be a valid pointer.
287        #[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
300/// Methods declared on superclass `NSObject`.
301impl 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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomrotoritemresult?language=objc)
315    #[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        /// # Safety
329        ///
330        /// `target_element` should be of the correct type.
331        #[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        /// Setter for [`targetElement`][Self::targetElement].
344        ///
345        /// This is a [weak property][objc2::topics::weak_property].
346        ///
347        /// # Safety
348        ///
349        /// `target_element` should be of the correct type.
350        #[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        /// Setter for [`targetRange`][Self::targetRange].
364        #[unsafe(method(setTargetRange:))]
365        #[unsafe(method_family = none)]
366        pub fn setTargetRange(&self, target_range: Option<&UITextRange>);
367    );
368}
369
370/// Methods declared on superclass `NSObject`.
371impl 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}