objc2_xc_ui_automation/generated/
mod.rs

1// This file has been automatically generated by `objc2`'s `header-translator`.
2// DO NOT EDIT
3
4#![allow(unused_imports)]
5#![allow(deprecated)]
6#![allow(non_snake_case)]
7#![allow(non_camel_case_types)]
8#![allow(non_upper_case_globals)]
9#![allow(missing_docs)]
10#![allow(clippy::too_many_arguments)]
11#![allow(clippy::type_complexity)]
12#![allow(clippy::upper_case_acronyms)]
13#![allow(clippy::identity_op)]
14#![allow(clippy::missing_safety_doc)]
15#![allow(clippy::doc_lazy_continuation)]
16#![allow(rustdoc::broken_intra_doc_links)]
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::invalid_html_tags)]
19
20use core::ffi::*;
21use core::ptr::NonNull;
22use objc2::__framework_prelude::*;
23#[cfg(feature = "objc2-app-kit")]
24#[cfg(target_os = "macos")]
25use objc2_app_kit::*;
26#[cfg(feature = "objc2-core-foundation")]
27use objc2_core_foundation::*;
28#[cfg(feature = "objc2-core-location")]
29use objc2_core_location::*;
30use objc2_foundation::*;
31
32use crate::*;
33
34/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementtype?language=objc)
35// NS_ENUM
36#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct XCUIElementType(pub NSUInteger);
39impl XCUIElementType {
40    #[doc(alias = "XCUIElementTypeAny")]
41    pub const Any: Self = Self(0);
42    #[doc(alias = "XCUIElementTypeOther")]
43    pub const Other: Self = Self(1);
44    #[doc(alias = "XCUIElementTypeApplication")]
45    pub const Application: Self = Self(2);
46    #[doc(alias = "XCUIElementTypeGroup")]
47    pub const Group: Self = Self(3);
48    #[doc(alias = "XCUIElementTypeWindow")]
49    pub const Window: Self = Self(4);
50    #[doc(alias = "XCUIElementTypeSheet")]
51    pub const Sheet: Self = Self(5);
52    #[doc(alias = "XCUIElementTypeDrawer")]
53    pub const Drawer: Self = Self(6);
54    #[doc(alias = "XCUIElementTypeAlert")]
55    pub const Alert: Self = Self(7);
56    #[doc(alias = "XCUIElementTypeDialog")]
57    pub const Dialog: Self = Self(8);
58    #[doc(alias = "XCUIElementTypeButton")]
59    pub const Button: Self = Self(9);
60    #[doc(alias = "XCUIElementTypeRadioButton")]
61    pub const RadioButton: Self = Self(10);
62    #[doc(alias = "XCUIElementTypeRadioGroup")]
63    pub const RadioGroup: Self = Self(11);
64    #[doc(alias = "XCUIElementTypeCheckBox")]
65    pub const CheckBox: Self = Self(12);
66    #[doc(alias = "XCUIElementTypeDisclosureTriangle")]
67    pub const DisclosureTriangle: Self = Self(13);
68    #[doc(alias = "XCUIElementTypePopUpButton")]
69    pub const PopUpButton: Self = Self(14);
70    #[doc(alias = "XCUIElementTypeComboBox")]
71    pub const ComboBox: Self = Self(15);
72    #[doc(alias = "XCUIElementTypeMenuButton")]
73    pub const MenuButton: Self = Self(16);
74    #[doc(alias = "XCUIElementTypeToolbarButton")]
75    pub const ToolbarButton: Self = Self(17);
76    #[doc(alias = "XCUIElementTypePopover")]
77    pub const Popover: Self = Self(18);
78    #[doc(alias = "XCUIElementTypeKeyboard")]
79    pub const Keyboard: Self = Self(19);
80    #[doc(alias = "XCUIElementTypeKey")]
81    pub const Key: Self = Self(20);
82    #[doc(alias = "XCUIElementTypeNavigationBar")]
83    pub const NavigationBar: Self = Self(21);
84    #[doc(alias = "XCUIElementTypeTabBar")]
85    pub const TabBar: Self = Self(22);
86    #[doc(alias = "XCUIElementTypeTabGroup")]
87    pub const TabGroup: Self = Self(23);
88    #[doc(alias = "XCUIElementTypeToolbar")]
89    pub const Toolbar: Self = Self(24);
90    #[doc(alias = "XCUIElementTypeStatusBar")]
91    pub const StatusBar: Self = Self(25);
92    #[doc(alias = "XCUIElementTypeTable")]
93    pub const Table: Self = Self(26);
94    #[doc(alias = "XCUIElementTypeTableRow")]
95    pub const TableRow: Self = Self(27);
96    #[doc(alias = "XCUIElementTypeTableColumn")]
97    pub const TableColumn: Self = Self(28);
98    #[doc(alias = "XCUIElementTypeOutline")]
99    pub const Outline: Self = Self(29);
100    #[doc(alias = "XCUIElementTypeOutlineRow")]
101    pub const OutlineRow: Self = Self(30);
102    #[doc(alias = "XCUIElementTypeBrowser")]
103    pub const Browser: Self = Self(31);
104    #[doc(alias = "XCUIElementTypeCollectionView")]
105    pub const CollectionView: Self = Self(32);
106    #[doc(alias = "XCUIElementTypeSlider")]
107    pub const Slider: Self = Self(33);
108    #[doc(alias = "XCUIElementTypePageIndicator")]
109    pub const PageIndicator: Self = Self(34);
110    #[doc(alias = "XCUIElementTypeProgressIndicator")]
111    pub const ProgressIndicator: Self = Self(35);
112    #[doc(alias = "XCUIElementTypeActivityIndicator")]
113    pub const ActivityIndicator: Self = Self(36);
114    #[doc(alias = "XCUIElementTypeSegmentedControl")]
115    pub const SegmentedControl: Self = Self(37);
116    #[doc(alias = "XCUIElementTypePicker")]
117    pub const Picker: Self = Self(38);
118    #[doc(alias = "XCUIElementTypePickerWheel")]
119    pub const PickerWheel: Self = Self(39);
120    #[doc(alias = "XCUIElementTypeSwitch")]
121    pub const Switch: Self = Self(40);
122    #[doc(alias = "XCUIElementTypeToggle")]
123    pub const Toggle: Self = Self(41);
124    #[doc(alias = "XCUIElementTypeLink")]
125    pub const Link: Self = Self(42);
126    #[doc(alias = "XCUIElementTypeImage")]
127    pub const Image: Self = Self(43);
128    #[doc(alias = "XCUIElementTypeIcon")]
129    pub const Icon: Self = Self(44);
130    #[doc(alias = "XCUIElementTypeSearchField")]
131    pub const SearchField: Self = Self(45);
132    #[doc(alias = "XCUIElementTypeScrollView")]
133    pub const ScrollView: Self = Self(46);
134    #[doc(alias = "XCUIElementTypeScrollBar")]
135    pub const ScrollBar: Self = Self(47);
136    #[doc(alias = "XCUIElementTypeStaticText")]
137    pub const StaticText: Self = Self(48);
138    #[doc(alias = "XCUIElementTypeTextField")]
139    pub const TextField: Self = Self(49);
140    #[doc(alias = "XCUIElementTypeSecureTextField")]
141    pub const SecureTextField: Self = Self(50);
142    #[doc(alias = "XCUIElementTypeDatePicker")]
143    pub const DatePicker: Self = Self(51);
144    #[doc(alias = "XCUIElementTypeTextView")]
145    pub const TextView: Self = Self(52);
146    #[doc(alias = "XCUIElementTypeMenu")]
147    pub const Menu: Self = Self(53);
148    #[doc(alias = "XCUIElementTypeMenuItem")]
149    pub const MenuItem: Self = Self(54);
150    #[doc(alias = "XCUIElementTypeMenuBar")]
151    pub const MenuBar: Self = Self(55);
152    #[doc(alias = "XCUIElementTypeMenuBarItem")]
153    pub const MenuBarItem: Self = Self(56);
154    #[doc(alias = "XCUIElementTypeMap")]
155    pub const Map: Self = Self(57);
156    #[doc(alias = "XCUIElementTypeWebView")]
157    pub const WebView: Self = Self(58);
158    #[doc(alias = "XCUIElementTypeIncrementArrow")]
159    pub const IncrementArrow: Self = Self(59);
160    #[doc(alias = "XCUIElementTypeDecrementArrow")]
161    pub const DecrementArrow: Self = Self(60);
162    #[doc(alias = "XCUIElementTypeTimeline")]
163    pub const Timeline: Self = Self(61);
164    #[doc(alias = "XCUIElementTypeRatingIndicator")]
165    pub const RatingIndicator: Self = Self(62);
166    #[doc(alias = "XCUIElementTypeValueIndicator")]
167    pub const ValueIndicator: Self = Self(63);
168    #[doc(alias = "XCUIElementTypeSplitGroup")]
169    pub const SplitGroup: Self = Self(64);
170    #[doc(alias = "XCUIElementTypeSplitter")]
171    pub const Splitter: Self = Self(65);
172    #[doc(alias = "XCUIElementTypeRelevanceIndicator")]
173    pub const RelevanceIndicator: Self = Self(66);
174    #[doc(alias = "XCUIElementTypeColorWell")]
175    pub const ColorWell: Self = Self(67);
176    #[doc(alias = "XCUIElementTypeHelpTag")]
177    pub const HelpTag: Self = Self(68);
178    #[doc(alias = "XCUIElementTypeMatte")]
179    pub const Matte: Self = Self(69);
180    #[doc(alias = "XCUIElementTypeDockItem")]
181    pub const DockItem: Self = Self(70);
182    #[doc(alias = "XCUIElementTypeRuler")]
183    pub const Ruler: Self = Self(71);
184    #[doc(alias = "XCUIElementTypeRulerMarker")]
185    pub const RulerMarker: Self = Self(72);
186    #[doc(alias = "XCUIElementTypeGrid")]
187    pub const Grid: Self = Self(73);
188    #[doc(alias = "XCUIElementTypeLevelIndicator")]
189    pub const LevelIndicator: Self = Self(74);
190    #[doc(alias = "XCUIElementTypeCell")]
191    pub const Cell: Self = Self(75);
192    #[doc(alias = "XCUIElementTypeLayoutArea")]
193    pub const LayoutArea: Self = Self(76);
194    #[doc(alias = "XCUIElementTypeLayoutItem")]
195    pub const LayoutItem: Self = Self(77);
196    #[doc(alias = "XCUIElementTypeHandle")]
197    pub const Handle: Self = Self(78);
198    #[doc(alias = "XCUIElementTypeStepper")]
199    pub const Stepper: Self = Self(79);
200    #[doc(alias = "XCUIElementTypeTab")]
201    pub const Tab: Self = Self(80);
202    #[doc(alias = "XCUIElementTypeTouchBar")]
203    pub const TouchBar: Self = Self(81);
204    #[doc(alias = "XCUIElementTypeStatusItem")]
205    pub const StatusItem: Self = Self(82);
206}
207
208unsafe impl Encode for XCUIElementType {
209    const ENCODING: Encoding = NSUInteger::ENCODING;
210}
211
212unsafe impl RefEncode for XCUIElementType {
213    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
214}
215
216/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiuserinterfacesizeclass?language=objc)
217// NS_ENUM
218#[repr(transparent)]
219#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
220pub struct XCUIUserInterfaceSizeClass(pub NSInteger);
221impl XCUIUserInterfaceSizeClass {
222    #[doc(alias = "XCUIUserInterfaceSizeClassUnspecified")]
223    pub const Unspecified: Self = Self(0);
224}
225
226unsafe impl Encode for XCUIUserInterfaceSizeClass {
227    const ENCODING: Encoding = NSInteger::ENCODING;
228}
229
230unsafe impl RefEncode for XCUIUserInterfaceSizeClass {
231    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
232}
233
234extern_protocol!(
235    /// Protocol describing the attributes exposed on user interface elements and available during query matching. These attributes represent data exposed to the Accessibility system.
236    ///
237    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributes?language=objc)
238    pub unsafe trait XCUIElementAttributes: MainThreadOnly {
239        /// The accessibility identifier.
240        #[unsafe(method(identifier))]
241        #[unsafe(method_family = none)]
242        fn identifier(&self) -> Retained<NSString>;
243
244        #[cfg(feature = "objc2-core-foundation")]
245        /// The frame of the element in the screen coordinate space.
246        #[unsafe(method(frame))]
247        #[unsafe(method_family = none)]
248        fn frame(&self) -> CGRect;
249
250        /// The raw value attribute of the element. Depending on the element, the actual type can vary.
251        #[unsafe(method(value))]
252        #[unsafe(method_family = none)]
253        fn value(&self) -> Option<Retained<AnyObject>>;
254
255        /// The title attribute of the element.
256        #[unsafe(method(title))]
257        #[unsafe(method_family = none)]
258        fn title(&self) -> Retained<NSString>;
259
260        /// The label attribute of the element.
261        #[unsafe(method(label))]
262        #[unsafe(method_family = none)]
263        fn label(&self) -> Retained<NSString>;
264
265        /// The type of the element. /seealso XCUIElementType.
266        #[unsafe(method(elementType))]
267        #[unsafe(method_family = none)]
268        fn elementType(&self) -> XCUIElementType;
269
270        /// Whether or not the element is enabled for user interaction.
271        #[unsafe(method(isEnabled))]
272        #[unsafe(method_family = none)]
273        fn isEnabled(&self) -> bool;
274
275        /// The horizontal size class of the element.
276        #[unsafe(method(horizontalSizeClass))]
277        #[unsafe(method_family = none)]
278        fn horizontalSizeClass(&self) -> XCUIUserInterfaceSizeClass;
279
280        /// The vertical size class of the element.
281        #[unsafe(method(verticalSizeClass))]
282        #[unsafe(method_family = none)]
283        fn verticalSizeClass(&self) -> XCUIUserInterfaceSizeClass;
284
285        /// The value that is displayed when the element has no value.
286        #[unsafe(method(placeholderValue))]
287        #[unsafe(method_family = none)]
288        fn placeholderValue(&self) -> Option<Retained<NSString>>;
289
290        /// Whether or not the element is selected.
291        #[unsafe(method(isSelected))]
292        #[unsafe(method_family = none)]
293        fn isSelected(&self) -> bool;
294    }
295);
296
297/// such as the dictionaries returned by XCUIElement.dictionaryRepresentation.
298///
299/// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributename?language=objc)
300// NS_TYPED_ENUM
301pub type XCUIElementAttributeName = NSString;
302
303extern "C" {
304    /// An array of the element's children.
305    ///
306    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenamechildren?language=objc)
307    pub static XCUIElementAttributeNameChildren: &'static XCUIElementAttributeName;
308}
309
310extern "C" {
311    /// The element's type, an NSNumber-wrapped XCUIElementType.
312    ///
313    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameelementtype?language=objc)
314    pub static XCUIElementAttributeNameElementType: &'static XCUIElementAttributeName;
315}
316
317extern "C" {
318    /// The element's accessibility identifier.
319    ///
320    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameidentifier?language=objc)
321    pub static XCUIElementAttributeNameIdentifier: &'static XCUIElementAttributeName;
322}
323
324extern "C" {
325    /// The element's accessibility value, an NSString or NSNumber.
326    ///
327    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenamevalue?language=objc)
328    pub static XCUIElementAttributeNameValue: &'static XCUIElementAttributeName;
329}
330
331extern "C" {
332    /// The element's placeholder value.
333    ///
334    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameplaceholdervalue?language=objc)
335    pub static XCUIElementAttributeNamePlaceholderValue: &'static XCUIElementAttributeName;
336}
337
338extern "C" {
339    /// The element's title.
340    ///
341    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenametitle?language=objc)
342    pub static XCUIElementAttributeNameTitle: &'static XCUIElementAttributeName;
343}
344
345extern "C" {
346    /// The element's label.
347    ///
348    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenamelabel?language=objc)
349    pub static XCUIElementAttributeNameLabel: &'static XCUIElementAttributeName;
350}
351
352extern "C" {
353    /// A dictionary representation of the element's frame, as returned by CGRectCreateDictionaryRepresentation.
354    ///
355    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameframe?language=objc)
356    pub static XCUIElementAttributeNameFrame: &'static XCUIElementAttributeName;
357}
358
359extern "C" {
360    /// True if the element is enabled, false otherwise, an NSNumber-wrapped BOOL.
361    ///
362    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameenabled?language=objc)
363    pub static XCUIElementAttributeNameEnabled: &'static XCUIElementAttributeName;
364}
365
366extern "C" {
367    /// True if the element is selected, false otherwise, an NSNumber-wrapped BOOL.
368    ///
369    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameselected?language=objc)
370    pub static XCUIElementAttributeNameSelected: &'static XCUIElementAttributeName;
371}
372
373extern "C" {
374    /// True if the element is focused, false otherwise, an NSNumber-wrapped BOOL.
375    ///
376    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenamehasfocus?language=objc)
377    pub static XCUIElementAttributeNameHasFocus: &'static XCUIElementAttributeName;
378}
379
380extern "C" {
381    /// The element's horizontal size class, an NSNumber-wrapped XCUIUserInterfaceSizeClass.
382    ///
383    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenamehorizontalsizeclass?language=objc)
384    pub static XCUIElementAttributeNameHorizontalSizeClass: &'static XCUIElementAttributeName;
385}
386
387extern "C" {
388    /// The element's vertical size class, an NSNumber-wrapped XCUIUserInterfaceSizeClass.
389    ///
390    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementattributenameverticalsizeclass?language=objc)
391    pub static XCUIElementAttributeNameVerticalSizeClass: &'static XCUIElementAttributeName;
392}
393
394extern_protocol!(
395    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementtypequeryprovider?language=objc)
396    pub unsafe trait XCUIElementTypeQueryProvider: MainThreadOnly {
397        #[unsafe(method(touchBars))]
398        #[unsafe(method_family = none)]
399        fn touchBars(&self) -> Retained<XCUIElementQuery>;
400
401        #[unsafe(method(groups))]
402        #[unsafe(method_family = none)]
403        fn groups(&self) -> Retained<XCUIElementQuery>;
404
405        #[unsafe(method(windows))]
406        #[unsafe(method_family = none)]
407        fn windows(&self) -> Retained<XCUIElementQuery>;
408
409        #[unsafe(method(sheets))]
410        #[unsafe(method_family = none)]
411        fn sheets(&self) -> Retained<XCUIElementQuery>;
412
413        #[unsafe(method(drawers))]
414        #[unsafe(method_family = none)]
415        fn drawers(&self) -> Retained<XCUIElementQuery>;
416
417        #[unsafe(method(alerts))]
418        #[unsafe(method_family = none)]
419        fn alerts(&self) -> Retained<XCUIElementQuery>;
420
421        #[unsafe(method(dialogs))]
422        #[unsafe(method_family = none)]
423        fn dialogs(&self) -> Retained<XCUIElementQuery>;
424
425        #[unsafe(method(buttons))]
426        #[unsafe(method_family = none)]
427        fn buttons(&self) -> Retained<XCUIElementQuery>;
428
429        #[unsafe(method(radioButtons))]
430        #[unsafe(method_family = none)]
431        fn radioButtons(&self) -> Retained<XCUIElementQuery>;
432
433        #[unsafe(method(radioGroups))]
434        #[unsafe(method_family = none)]
435        fn radioGroups(&self) -> Retained<XCUIElementQuery>;
436
437        #[unsafe(method(checkBoxes))]
438        #[unsafe(method_family = none)]
439        fn checkBoxes(&self) -> Retained<XCUIElementQuery>;
440
441        #[unsafe(method(disclosureTriangles))]
442        #[unsafe(method_family = none)]
443        fn disclosureTriangles(&self) -> Retained<XCUIElementQuery>;
444
445        #[unsafe(method(popUpButtons))]
446        #[unsafe(method_family = none)]
447        fn popUpButtons(&self) -> Retained<XCUIElementQuery>;
448
449        #[unsafe(method(comboBoxes))]
450        #[unsafe(method_family = none)]
451        fn comboBoxes(&self) -> Retained<XCUIElementQuery>;
452
453        #[unsafe(method(menuButtons))]
454        #[unsafe(method_family = none)]
455        fn menuButtons(&self) -> Retained<XCUIElementQuery>;
456
457        #[unsafe(method(toolbarButtons))]
458        #[unsafe(method_family = none)]
459        fn toolbarButtons(&self) -> Retained<XCUIElementQuery>;
460
461        #[unsafe(method(popovers))]
462        #[unsafe(method_family = none)]
463        fn popovers(&self) -> Retained<XCUIElementQuery>;
464
465        #[unsafe(method(keyboards))]
466        #[unsafe(method_family = none)]
467        fn keyboards(&self) -> Retained<XCUIElementQuery>;
468
469        #[unsafe(method(keys))]
470        #[unsafe(method_family = none)]
471        fn keys(&self) -> Retained<XCUIElementQuery>;
472
473        #[unsafe(method(navigationBars))]
474        #[unsafe(method_family = none)]
475        fn navigationBars(&self) -> Retained<XCUIElementQuery>;
476
477        #[unsafe(method(tabBars))]
478        #[unsafe(method_family = none)]
479        fn tabBars(&self) -> Retained<XCUIElementQuery>;
480
481        #[unsafe(method(tabGroups))]
482        #[unsafe(method_family = none)]
483        fn tabGroups(&self) -> Retained<XCUIElementQuery>;
484
485        #[unsafe(method(toolbars))]
486        #[unsafe(method_family = none)]
487        fn toolbars(&self) -> Retained<XCUIElementQuery>;
488
489        #[unsafe(method(statusBars))]
490        #[unsafe(method_family = none)]
491        fn statusBars(&self) -> Retained<XCUIElementQuery>;
492
493        #[unsafe(method(tables))]
494        #[unsafe(method_family = none)]
495        fn tables(&self) -> Retained<XCUIElementQuery>;
496
497        #[unsafe(method(tableRows))]
498        #[unsafe(method_family = none)]
499        fn tableRows(&self) -> Retained<XCUIElementQuery>;
500
501        #[unsafe(method(tableColumns))]
502        #[unsafe(method_family = none)]
503        fn tableColumns(&self) -> Retained<XCUIElementQuery>;
504
505        #[unsafe(method(outlines))]
506        #[unsafe(method_family = none)]
507        fn outlines(&self) -> Retained<XCUIElementQuery>;
508
509        #[unsafe(method(outlineRows))]
510        #[unsafe(method_family = none)]
511        fn outlineRows(&self) -> Retained<XCUIElementQuery>;
512
513        #[unsafe(method(disclosedChildRows))]
514        #[unsafe(method_family = none)]
515        fn disclosedChildRows(&self) -> Retained<XCUIElementQuery>;
516
517        #[unsafe(method(browsers))]
518        #[unsafe(method_family = none)]
519        fn browsers(&self) -> Retained<XCUIElementQuery>;
520
521        #[unsafe(method(collectionViews))]
522        #[unsafe(method_family = none)]
523        fn collectionViews(&self) -> Retained<XCUIElementQuery>;
524
525        #[unsafe(method(sliders))]
526        #[unsafe(method_family = none)]
527        fn sliders(&self) -> Retained<XCUIElementQuery>;
528
529        #[unsafe(method(pageIndicators))]
530        #[unsafe(method_family = none)]
531        fn pageIndicators(&self) -> Retained<XCUIElementQuery>;
532
533        #[unsafe(method(progressIndicators))]
534        #[unsafe(method_family = none)]
535        fn progressIndicators(&self) -> Retained<XCUIElementQuery>;
536
537        #[unsafe(method(activityIndicators))]
538        #[unsafe(method_family = none)]
539        fn activityIndicators(&self) -> Retained<XCUIElementQuery>;
540
541        #[unsafe(method(segmentedControls))]
542        #[unsafe(method_family = none)]
543        fn segmentedControls(&self) -> Retained<XCUIElementQuery>;
544
545        #[unsafe(method(pickers))]
546        #[unsafe(method_family = none)]
547        fn pickers(&self) -> Retained<XCUIElementQuery>;
548
549        #[unsafe(method(pickerWheels))]
550        #[unsafe(method_family = none)]
551        fn pickerWheels(&self) -> Retained<XCUIElementQuery>;
552
553        #[unsafe(method(switches))]
554        #[unsafe(method_family = none)]
555        fn switches(&self) -> Retained<XCUIElementQuery>;
556
557        #[unsafe(method(toggles))]
558        #[unsafe(method_family = none)]
559        fn toggles(&self) -> Retained<XCUIElementQuery>;
560
561        #[unsafe(method(links))]
562        #[unsafe(method_family = none)]
563        fn links(&self) -> Retained<XCUIElementQuery>;
564
565        #[unsafe(method(images))]
566        #[unsafe(method_family = none)]
567        fn images(&self) -> Retained<XCUIElementQuery>;
568
569        #[unsafe(method(icons))]
570        #[unsafe(method_family = none)]
571        fn icons(&self) -> Retained<XCUIElementQuery>;
572
573        #[unsafe(method(searchFields))]
574        #[unsafe(method_family = none)]
575        fn searchFields(&self) -> Retained<XCUIElementQuery>;
576
577        #[unsafe(method(scrollViews))]
578        #[unsafe(method_family = none)]
579        fn scrollViews(&self) -> Retained<XCUIElementQuery>;
580
581        #[unsafe(method(scrollBars))]
582        #[unsafe(method_family = none)]
583        fn scrollBars(&self) -> Retained<XCUIElementQuery>;
584
585        #[unsafe(method(staticTexts))]
586        #[unsafe(method_family = none)]
587        fn staticTexts(&self) -> Retained<XCUIElementQuery>;
588
589        #[unsafe(method(textFields))]
590        #[unsafe(method_family = none)]
591        fn textFields(&self) -> Retained<XCUIElementQuery>;
592
593        #[unsafe(method(secureTextFields))]
594        #[unsafe(method_family = none)]
595        fn secureTextFields(&self) -> Retained<XCUIElementQuery>;
596
597        #[unsafe(method(datePickers))]
598        #[unsafe(method_family = none)]
599        fn datePickers(&self) -> Retained<XCUIElementQuery>;
600
601        #[unsafe(method(textViews))]
602        #[unsafe(method_family = none)]
603        fn textViews(&self) -> Retained<XCUIElementQuery>;
604
605        #[unsafe(method(menus))]
606        #[unsafe(method_family = none)]
607        fn menus(&self) -> Retained<XCUIElementQuery>;
608
609        #[unsafe(method(menuItems))]
610        #[unsafe(method_family = none)]
611        fn menuItems(&self) -> Retained<XCUIElementQuery>;
612
613        #[unsafe(method(menuBars))]
614        #[unsafe(method_family = none)]
615        fn menuBars(&self) -> Retained<XCUIElementQuery>;
616
617        #[unsafe(method(menuBarItems))]
618        #[unsafe(method_family = none)]
619        fn menuBarItems(&self) -> Retained<XCUIElementQuery>;
620
621        #[unsafe(method(maps))]
622        #[unsafe(method_family = none)]
623        fn maps(&self) -> Retained<XCUIElementQuery>;
624
625        #[unsafe(method(webViews))]
626        #[unsafe(method_family = none)]
627        fn webViews(&self) -> Retained<XCUIElementQuery>;
628
629        #[unsafe(method(steppers))]
630        #[unsafe(method_family = none)]
631        fn steppers(&self) -> Retained<XCUIElementQuery>;
632
633        #[unsafe(method(incrementArrows))]
634        #[unsafe(method_family = none)]
635        fn incrementArrows(&self) -> Retained<XCUIElementQuery>;
636
637        #[unsafe(method(decrementArrows))]
638        #[unsafe(method_family = none)]
639        fn decrementArrows(&self) -> Retained<XCUIElementQuery>;
640
641        #[unsafe(method(tabs))]
642        #[unsafe(method_family = none)]
643        fn tabs(&self) -> Retained<XCUIElementQuery>;
644
645        #[unsafe(method(timelines))]
646        #[unsafe(method_family = none)]
647        fn timelines(&self) -> Retained<XCUIElementQuery>;
648
649        #[unsafe(method(ratingIndicators))]
650        #[unsafe(method_family = none)]
651        fn ratingIndicators(&self) -> Retained<XCUIElementQuery>;
652
653        #[unsafe(method(valueIndicators))]
654        #[unsafe(method_family = none)]
655        fn valueIndicators(&self) -> Retained<XCUIElementQuery>;
656
657        #[unsafe(method(splitGroups))]
658        #[unsafe(method_family = none)]
659        fn splitGroups(&self) -> Retained<XCUIElementQuery>;
660
661        #[unsafe(method(splitters))]
662        #[unsafe(method_family = none)]
663        fn splitters(&self) -> Retained<XCUIElementQuery>;
664
665        #[unsafe(method(relevanceIndicators))]
666        #[unsafe(method_family = none)]
667        fn relevanceIndicators(&self) -> Retained<XCUIElementQuery>;
668
669        #[unsafe(method(colorWells))]
670        #[unsafe(method_family = none)]
671        fn colorWells(&self) -> Retained<XCUIElementQuery>;
672
673        #[unsafe(method(helpTags))]
674        #[unsafe(method_family = none)]
675        fn helpTags(&self) -> Retained<XCUIElementQuery>;
676
677        #[unsafe(method(mattes))]
678        #[unsafe(method_family = none)]
679        fn mattes(&self) -> Retained<XCUIElementQuery>;
680
681        #[unsafe(method(dockItems))]
682        #[unsafe(method_family = none)]
683        fn dockItems(&self) -> Retained<XCUIElementQuery>;
684
685        #[unsafe(method(rulers))]
686        #[unsafe(method_family = none)]
687        fn rulers(&self) -> Retained<XCUIElementQuery>;
688
689        #[unsafe(method(rulerMarkers))]
690        #[unsafe(method_family = none)]
691        fn rulerMarkers(&self) -> Retained<XCUIElementQuery>;
692
693        #[unsafe(method(grids))]
694        #[unsafe(method_family = none)]
695        fn grids(&self) -> Retained<XCUIElementQuery>;
696
697        #[unsafe(method(levelIndicators))]
698        #[unsafe(method_family = none)]
699        fn levelIndicators(&self) -> Retained<XCUIElementQuery>;
700
701        #[unsafe(method(cells))]
702        #[unsafe(method_family = none)]
703        fn cells(&self) -> Retained<XCUIElementQuery>;
704
705        #[unsafe(method(layoutAreas))]
706        #[unsafe(method_family = none)]
707        fn layoutAreas(&self) -> Retained<XCUIElementQuery>;
708
709        #[unsafe(method(layoutItems))]
710        #[unsafe(method_family = none)]
711        fn layoutItems(&self) -> Retained<XCUIElementQuery>;
712
713        #[unsafe(method(handles))]
714        #[unsafe(method_family = none)]
715        fn handles(&self) -> Retained<XCUIElementQuery>;
716
717        #[unsafe(method(otherElements))]
718        #[unsafe(method_family = none)]
719        fn otherElements(&self) -> Retained<XCUIElementQuery>;
720
721        #[unsafe(method(statusItems))]
722        #[unsafe(method_family = none)]
723        fn statusItems(&self) -> Retained<XCUIElementQuery>;
724
725        /// Returns an element that will use the query for resolution. This changes how the query is resolved
726        /// at runtime; instead of evaluating against every element in the user interface, `firstMatch` stops
727        /// the search as soon as a single matching element is found. This can result in significantly faster
728        /// evaluation if the element is located early in a large view hierarchy but also means that multiple
729        /// matches will not be detected.
730        #[unsafe(method(firstMatch))]
731        #[unsafe(method_family = none)]
732        fn firstMatch(&self) -> Retained<XCUIElement>;
733    }
734);
735
736/// Constants for use with -[XCUIElement typeKey:modifierFlags:],
737/// representing keys that have no textual representation. These comprise
738/// the set of control, function, and modifier keys found on most keyboards.
739///
740/// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkey?language=objc)
741// NS_TYPED_EXTENSIBLE_ENUM
742pub type XCUIKeyboardKey = NSString;
743
744extern "C" {
745    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeydelete?language=objc)
746    pub static XCUIKeyboardKeyDelete: &'static XCUIKeyboardKey;
747}
748
749extern "C" {
750    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyreturn?language=objc)
751    pub static XCUIKeyboardKeyReturn: &'static XCUIKeyboardKey;
752}
753
754extern "C" {
755    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyenter?language=objc)
756    pub static XCUIKeyboardKeyEnter: &'static XCUIKeyboardKey;
757}
758
759extern "C" {
760    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeytab?language=objc)
761    pub static XCUIKeyboardKeyTab: &'static XCUIKeyboardKey;
762}
763
764extern "C" {
765    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyspace?language=objc)
766    pub static XCUIKeyboardKeySpace: &'static XCUIKeyboardKey;
767}
768
769extern "C" {
770    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyescape?language=objc)
771    pub static XCUIKeyboardKeyEscape: &'static XCUIKeyboardKey;
772}
773
774extern "C" {
775    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyuparrow?language=objc)
776    pub static XCUIKeyboardKeyUpArrow: &'static XCUIKeyboardKey;
777}
778
779extern "C" {
780    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeydownarrow?language=objc)
781    pub static XCUIKeyboardKeyDownArrow: &'static XCUIKeyboardKey;
782}
783
784extern "C" {
785    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyleftarrow?language=objc)
786    pub static XCUIKeyboardKeyLeftArrow: &'static XCUIKeyboardKey;
787}
788
789extern "C" {
790    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyrightarrow?language=objc)
791    pub static XCUIKeyboardKeyRightArrow: &'static XCUIKeyboardKey;
792}
793
794extern "C" {
795    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf1?language=objc)
796    pub static XCUIKeyboardKeyF1: &'static XCUIKeyboardKey;
797}
798
799extern "C" {
800    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf2?language=objc)
801    pub static XCUIKeyboardKeyF2: &'static XCUIKeyboardKey;
802}
803
804extern "C" {
805    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf3?language=objc)
806    pub static XCUIKeyboardKeyF3: &'static XCUIKeyboardKey;
807}
808
809extern "C" {
810    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf4?language=objc)
811    pub static XCUIKeyboardKeyF4: &'static XCUIKeyboardKey;
812}
813
814extern "C" {
815    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf5?language=objc)
816    pub static XCUIKeyboardKeyF5: &'static XCUIKeyboardKey;
817}
818
819extern "C" {
820    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf6?language=objc)
821    pub static XCUIKeyboardKeyF6: &'static XCUIKeyboardKey;
822}
823
824extern "C" {
825    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf7?language=objc)
826    pub static XCUIKeyboardKeyF7: &'static XCUIKeyboardKey;
827}
828
829extern "C" {
830    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf8?language=objc)
831    pub static XCUIKeyboardKeyF8: &'static XCUIKeyboardKey;
832}
833
834extern "C" {
835    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf9?language=objc)
836    pub static XCUIKeyboardKeyF9: &'static XCUIKeyboardKey;
837}
838
839extern "C" {
840    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf10?language=objc)
841    pub static XCUIKeyboardKeyF10: &'static XCUIKeyboardKey;
842}
843
844extern "C" {
845    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf11?language=objc)
846    pub static XCUIKeyboardKeyF11: &'static XCUIKeyboardKey;
847}
848
849extern "C" {
850    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf12?language=objc)
851    pub static XCUIKeyboardKeyF12: &'static XCUIKeyboardKey;
852}
853
854extern "C" {
855    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf13?language=objc)
856    pub static XCUIKeyboardKeyF13: &'static XCUIKeyboardKey;
857}
858
859extern "C" {
860    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf14?language=objc)
861    pub static XCUIKeyboardKeyF14: &'static XCUIKeyboardKey;
862}
863
864extern "C" {
865    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf15?language=objc)
866    pub static XCUIKeyboardKeyF15: &'static XCUIKeyboardKey;
867}
868
869extern "C" {
870    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf16?language=objc)
871    pub static XCUIKeyboardKeyF16: &'static XCUIKeyboardKey;
872}
873
874extern "C" {
875    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf17?language=objc)
876    pub static XCUIKeyboardKeyF17: &'static XCUIKeyboardKey;
877}
878
879extern "C" {
880    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf18?language=objc)
881    pub static XCUIKeyboardKeyF18: &'static XCUIKeyboardKey;
882}
883
884extern "C" {
885    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyf19?language=objc)
886    pub static XCUIKeyboardKeyF19: &'static XCUIKeyboardKey;
887}
888
889extern "C" {
890    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyforwarddelete?language=objc)
891    pub static XCUIKeyboardKeyForwardDelete: &'static XCUIKeyboardKey;
892}
893
894extern "C" {
895    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyhome?language=objc)
896    pub static XCUIKeyboardKeyHome: &'static XCUIKeyboardKey;
897}
898
899extern "C" {
900    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyend?language=objc)
901    pub static XCUIKeyboardKeyEnd: &'static XCUIKeyboardKey;
902}
903
904extern "C" {
905    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeypageup?language=objc)
906    pub static XCUIKeyboardKeyPageUp: &'static XCUIKeyboardKey;
907}
908
909extern "C" {
910    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeypagedown?language=objc)
911    pub static XCUIKeyboardKeyPageDown: &'static XCUIKeyboardKey;
912}
913
914extern "C" {
915    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyclear?language=objc)
916    pub static XCUIKeyboardKeyClear: &'static XCUIKeyboardKey;
917}
918
919extern "C" {
920    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyhelp?language=objc)
921    pub static XCUIKeyboardKeyHelp: &'static XCUIKeyboardKey;
922}
923
924extern "C" {
925    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeycapslock?language=objc)
926    pub static XCUIKeyboardKeyCapsLock: &'static XCUIKeyboardKey;
927}
928
929extern "C" {
930    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyshift?language=objc)
931    pub static XCUIKeyboardKeyShift: &'static XCUIKeyboardKey;
932}
933
934extern "C" {
935    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeycontrol?language=objc)
936    pub static XCUIKeyboardKeyControl: &'static XCUIKeyboardKey;
937}
938
939extern "C" {
940    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyoption?language=objc)
941    pub static XCUIKeyboardKeyOption: &'static XCUIKeyboardKey;
942}
943
944extern "C" {
945    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeycommand?language=objc)
946    pub static XCUIKeyboardKeyCommand: &'static XCUIKeyboardKey;
947}
948
949extern "C" {
950    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyrightshift?language=objc)
951    pub static XCUIKeyboardKeyRightShift: &'static XCUIKeyboardKey;
952}
953
954extern "C" {
955    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyrightcontrol?language=objc)
956    pub static XCUIKeyboardKeyRightControl: &'static XCUIKeyboardKey;
957}
958
959extern "C" {
960    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyrightoption?language=objc)
961    pub static XCUIKeyboardKeyRightOption: &'static XCUIKeyboardKey;
962}
963
964extern "C" {
965    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeyrightcommand?language=objc)
966    pub static XCUIKeyboardKeyRightCommand: &'static XCUIKeyboardKey;
967}
968
969extern "C" {
970    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeyboardkeysecondaryfn?language=objc)
971    pub static XCUIKeyboardKeySecondaryFn: &'static XCUIKeyboardKey;
972}
973
974extern_protocol!(
975    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiscreenshotproviding?language=objc)
976    pub unsafe trait XCUIScreenshotProviding: NSObjectProtocol + MainThreadOnly {
977        /// Captures and returns a screenshot of the receiver.
978        ///
979        /// Equivalent to capturing a screenshot manually, e.g. if two windows are overlapping and
980        /// the occluded window is captured, the front window will be visible in the screenshot.
981        #[unsafe(method(screenshot))]
982        #[unsafe(method_family = none)]
983        fn screenshot(&self) -> Retained<XCUIScreenshot>;
984    }
985);
986
987/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuikeymodifierflags?language=objc)
988// NS_OPTIONS
989#[repr(transparent)]
990#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
991pub struct XCUIKeyModifierFlags(pub NSUInteger);
992bitflags::bitflags! {
993    impl XCUIKeyModifierFlags: NSUInteger {
994        #[doc(alias = "XCUIKeyModifierNone")]
995        const None = 0;
996        #[doc(alias = "XCUIKeyModifierCapsLock")]
997        const CapsLock = 1<<0;
998        #[doc(alias = "XCUIKeyModifierShift")]
999        const Shift = 1<<1;
1000        #[doc(alias = "XCUIKeyModifierControl")]
1001        const Control = 1<<2;
1002        #[doc(alias = "XCUIKeyModifierOption")]
1003        const Option = 1<<3;
1004        #[doc(alias = "XCUIKeyModifierCommand")]
1005        const Command = 1<<4;
1006        #[doc(alias = "XCUIKeyModifierFunction")]
1007        const Function = 1<<5;
1008        #[doc(alias = "XCUIKeyModifierAlphaShift")]
1009        const AlphaShift = XCUIKeyModifierFlags::CapsLock.0;
1010        #[doc(alias = "XCUIKeyModifierAlternate")]
1011        const Alternate = XCUIKeyModifierFlags::Option.0;
1012    }
1013}
1014
1015unsafe impl Encode for XCUIKeyModifierFlags {
1016    const ENCODING: Encoding = NSUInteger::ENCODING;
1017}
1018
1019unsafe impl RefEncode for XCUIKeyModifierFlags {
1020    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1021}
1022
1023/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuigesturevelocity?language=objc)
1024// NS_TYPED_EXTENSIBLE_ENUM
1025#[cfg(feature = "objc2-core-foundation")]
1026pub type XCUIGestureVelocity = CGFloat;
1027
1028extern "C" {
1029    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuigesturevelocitydefault?language=objc)
1030    #[cfg(feature = "objc2-core-foundation")]
1031    pub static XCUIGestureVelocityDefault: XCUIGestureVelocity;
1032}
1033
1034extern "C" {
1035    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuigesturevelocityslow?language=objc)
1036    #[cfg(feature = "objc2-core-foundation")]
1037    pub static XCUIGestureVelocitySlow: XCUIGestureVelocity;
1038}
1039
1040extern "C" {
1041    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuigesturevelocityfast?language=objc)
1042    #[cfg(feature = "objc2-core-foundation")]
1043    pub static XCUIGestureVelocityFast: XCUIGestureVelocity;
1044}
1045
1046extern_class!(
1047    /// Elements are objects encapsulating the information needed to dynamically locate a user interface
1048    /// element in an application. Elements are described in terms of queries /seealso XCUIElementQuery.
1049    ///
1050    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielement?language=objc)
1051    #[unsafe(super(NSObject))]
1052    #[thread_kind = MainThreadOnly]
1053    #[derive(Debug, PartialEq, Eq, Hash)]
1054    pub struct XCUIElement;
1055);
1056
1057extern_conformance!(
1058    unsafe impl NSObjectProtocol for XCUIElement {}
1059);
1060
1061extern_conformance!(
1062    unsafe impl XCUIElementAttributes for XCUIElement {}
1063);
1064
1065extern_conformance!(
1066    unsafe impl XCUIElementTypeQueryProvider for XCUIElement {}
1067);
1068
1069impl XCUIElement {
1070    extern_methods!(
1071        #[unsafe(method(new))]
1072        #[unsafe(method_family = new)]
1073        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1074
1075        #[unsafe(method(init))]
1076        #[unsafe(method_family = init)]
1077        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1078
1079        /// Test to determine if the element exists.
1080        #[unsafe(method(exists))]
1081        #[unsafe(method_family = none)]
1082        pub fn exists(&self) -> bool;
1083
1084        /// Waits the specified amount of time for the element's exist property to be true and returns false if the timeout expires without the element coming into existence.
1085        #[must_use]
1086        #[unsafe(method(waitForExistenceWithTimeout:))]
1087        #[unsafe(method_family = none)]
1088        pub fn waitForExistenceWithTimeout(&self, timeout: NSTimeInterval) -> bool;
1089
1090        /// Waits the specified amount of time for the element's exist property to be false and returns false if the timeout expires without the element disappearing.
1091        #[unsafe(method(waitForNonExistenceWithTimeout:))]
1092        #[unsafe(method_family = none)]
1093        pub fn waitForNonExistenceWithTimeout(&self, timeout: NSTimeInterval) -> bool;
1094
1095        /// Whether or not a hit point can be computed for the element for the purpose of synthesizing events.
1096        #[unsafe(method(isHittable))]
1097        #[unsafe(method_family = none)]
1098        pub fn isHittable(&self) -> bool;
1099
1100        /// Returns a query for all descendants of the element matching the specified type.
1101        #[unsafe(method(descendantsMatchingType:))]
1102        #[unsafe(method_family = none)]
1103        pub fn descendantsMatchingType(
1104            &self,
1105            r#type: XCUIElementType,
1106        ) -> Retained<XCUIElementQuery>;
1107
1108        /// Returns a query for direct children of the element matching the specified type.
1109        #[unsafe(method(childrenMatchingType:))]
1110        #[unsafe(method_family = none)]
1111        pub fn childrenMatchingType(&self, r#type: XCUIElementType) -> Retained<XCUIElementQuery>;
1112
1113        #[cfg(feature = "objc2-core-foundation")]
1114        /// Creates and returns a new coordinate that will compute its screen point by adding the offset multiplied by the size of the element’s frame to the origin of the element’s frame.
1115        #[unsafe(method(coordinateWithNormalizedOffset:))]
1116        #[unsafe(method_family = none)]
1117        pub fn coordinateWithNormalizedOffset(
1118            &self,
1119            normalized_offset: CGVector,
1120        ) -> Retained<XCUICoordinate>;
1121
1122        /// Provides debugging information about the element. The data in the string will vary based on the
1123        /// time at which it is captured, but it may include any of the following as well as additional data:
1124        /// • Values for the elements attributes.
1125        /// • The entire tree of descendants rooted at the element.
1126        /// • The element's query.
1127        /// This data should be used for debugging only - depending on any of the data as part of a test is unsupported.
1128        #[unsafe(method(debugDescription))]
1129        #[unsafe(method_family = none)]
1130        pub fn debugDescription(&self) -> Retained<NSString>;
1131    );
1132}
1133
1134/// XCUIScreenshotProviding.
1135impl XCUIElement {
1136    extern_methods!();
1137}
1138
1139extern_conformance!(
1140    unsafe impl XCUIScreenshotProviding for XCUIElement {}
1141);
1142
1143/// XCUIElementKeyboardEvents.
1144///
1145/// Events that can be synthesized relative to an XCUIElement object. When an event API is called, the element
1146/// will be resolved. If zero or multiple matches are found, an error will be raised.
1147impl XCUIElement {
1148    extern_methods!(
1149        /// Types a string into the element. The element or a descendant must have keyboard focus; otherwise an
1150        /// error is raised.
1151        ///
1152        /// This API discards any modifiers set in the current context by +performWithKeyModifiers:block: so that
1153        /// it strictly interprets the provided text. To input keys with modifier flags, use  -typeKey:modifierFlags:.
1154        #[unsafe(method(typeText:))]
1155        #[unsafe(method_family = none)]
1156        pub fn typeText(&self, text: &NSString);
1157
1158        #[cfg(feature = "block2")]
1159        /// Hold modifier keys while the given block runs. This method pushes and pops the modifiers as global state
1160        /// without need for reference to a particular element. Inside the block, elements can be clicked on, dragged
1161        /// from, typed into, etc.
1162        #[unsafe(method(performWithKeyModifiers:block:))]
1163        #[unsafe(method_family = none)]
1164        pub fn performWithKeyModifiers_block(
1165            flags: XCUIKeyModifierFlags,
1166            block: &block2::DynBlock<dyn Fn() + '_>,
1167            mtm: MainThreadMarker,
1168        );
1169
1170        /// Types a single key with the specified modifier flags. Although `key` is a string, it must represent
1171        /// a single key on a physical keyboard; strings that resolve to multiple keys will raise an error at runtime.
1172        /// In addition to literal string key representations like "a", "6", and "[", keys such as the arrow keys,
1173        /// command, control, option, and function keys can be typed using constants defined for them in XCUIKeyboardKeys.h
1174        #[unsafe(method(typeKey:modifierFlags:))]
1175        #[unsafe(method_family = none)]
1176        pub fn typeKey_modifierFlags(&self, key: &NSString, flags: XCUIKeyModifierFlags);
1177    );
1178}
1179
1180/// XCUIElementTouchEvents.
1181impl XCUIElement {
1182    extern_methods!(
1183        /// Sends a tap event to a hittable point computed for the element.
1184        #[unsafe(method(tap))]
1185        #[unsafe(method_family = none)]
1186        pub fn tap(&self);
1187
1188        /// Sends a double tap event to a hittable point computed for the element.
1189        #[unsafe(method(doubleTap))]
1190        #[unsafe(method_family = none)]
1191        pub fn doubleTap(&self);
1192
1193        /// Sends a long press gesture to a hittable point computed for the element, holding for the specified duration.
1194        ///
1195        ///
1196        /// Parameter `duration`: Duration in seconds.
1197        #[unsafe(method(pressForDuration:))]
1198        #[unsafe(method_family = none)]
1199        pub fn pressForDuration(&self, duration: NSTimeInterval);
1200
1201        /// Initiates a press-and-hold gesture that then drags to another element, suitable for table cell reordering and similar operations.
1202        ///
1203        /// Parameter `duration`: Duration of the initial press-and-hold.
1204        ///
1205        /// Parameter `otherElement`: The element to finish the drag gesture over. In the example of table cell reordering, this would be the reorder element of the destination row.
1206        #[unsafe(method(pressForDuration:thenDragToElement:))]
1207        #[unsafe(method_family = none)]
1208        pub fn pressForDuration_thenDragToElement(
1209            &self,
1210            duration: NSTimeInterval,
1211            other_element: &XCUIElement,
1212        );
1213
1214        #[cfg(feature = "objc2-core-foundation")]
1215        /// Initiates a press-and-hold gesture that then drags to another element with a custom velocity and then holds, suitable for table cell reordering and similar operations.
1216        ///
1217        /// Parameter `duration`: Duration of the initial press-and-hold.
1218        ///
1219        /// Parameter `otherElement`: The element to finish the drag gesture over. In the example of table cell reordering, this would be the reorder element of the destination row.
1220        ///
1221        /// Parameter `velocity`: The velocity pixels per second at which to drag the element.
1222        ///
1223        /// Parameter `holdDuration`: The duration of the final hold.
1224        #[unsafe(method(pressForDuration:thenDragToElement:withVelocity:thenHoldForDuration:))]
1225        #[unsafe(method_family = none)]
1226        pub fn pressForDuration_thenDragToElement_withVelocity_thenHoldForDuration(
1227            &self,
1228            duration: NSTimeInterval,
1229            other_element: &XCUIElement,
1230            velocity: XCUIGestureVelocity,
1231            hold_duration: NSTimeInterval,
1232        );
1233
1234        /// Sends a swipe-up gesture.
1235        #[unsafe(method(swipeUp))]
1236        #[unsafe(method_family = none)]
1237        pub fn swipeUp(&self);
1238
1239        /// Sends a swipe-down gesture.
1240        #[unsafe(method(swipeDown))]
1241        #[unsafe(method_family = none)]
1242        pub fn swipeDown(&self);
1243
1244        /// Sends a swipe-left gesture.
1245        #[unsafe(method(swipeLeft))]
1246        #[unsafe(method_family = none)]
1247        pub fn swipeLeft(&self);
1248
1249        /// Sends a swipe-right gesture.
1250        #[unsafe(method(swipeRight))]
1251        #[unsafe(method_family = none)]
1252        pub fn swipeRight(&self);
1253
1254        #[cfg(feature = "objc2-core-foundation")]
1255        /// Sends a swipe in the specified direction with a specified velocity.
1256        ///
1257        /// Parameter `velocity`: The velocity pixels per second at which to perform the swipe at.
1258        #[unsafe(method(swipeUpWithVelocity:))]
1259        #[unsafe(method_family = none)]
1260        pub fn swipeUpWithVelocity(&self, velocity: XCUIGestureVelocity);
1261
1262        #[cfg(feature = "objc2-core-foundation")]
1263        #[unsafe(method(swipeDownWithVelocity:))]
1264        #[unsafe(method_family = none)]
1265        pub fn swipeDownWithVelocity(&self, velocity: XCUIGestureVelocity);
1266
1267        #[cfg(feature = "objc2-core-foundation")]
1268        #[unsafe(method(swipeLeftWithVelocity:))]
1269        #[unsafe(method_family = none)]
1270        pub fn swipeLeftWithVelocity(&self, velocity: XCUIGestureVelocity);
1271
1272        #[cfg(feature = "objc2-core-foundation")]
1273        #[unsafe(method(swipeRightWithVelocity:))]
1274        #[unsafe(method_family = none)]
1275        pub fn swipeRightWithVelocity(&self, velocity: XCUIGestureVelocity);
1276    );
1277}
1278
1279/// XCUIElementMouseEvents.
1280impl XCUIElement {
1281    extern_methods!(
1282        /// Moves the cursor over the element.
1283        #[unsafe(method(hover))]
1284        #[unsafe(method_family = none)]
1285        pub fn hover(&self);
1286
1287        /// Sends a click event to a hittable point computed for the element.
1288        #[unsafe(method(click))]
1289        #[unsafe(method_family = none)]
1290        pub fn click(&self);
1291
1292        /// Sends a double click event to a hittable point computed for the element.
1293        #[unsafe(method(doubleClick))]
1294        #[unsafe(method_family = none)]
1295        pub fn doubleClick(&self);
1296
1297        /// Sends a right click event to a hittable point computed for the element.
1298        #[unsafe(method(rightClick))]
1299        #[unsafe(method_family = none)]
1300        pub fn rightClick(&self);
1301
1302        /// Clicks and holds for a specified duration (generally long enough to start a drag operation) then drags
1303        /// to the other element.
1304        #[unsafe(method(clickForDuration:thenDragToElement:))]
1305        #[unsafe(method_family = none)]
1306        pub fn clickForDuration_thenDragToElement(
1307            &self,
1308            duration: NSTimeInterval,
1309            other_element: &XCUIElement,
1310        );
1311
1312        #[cfg(feature = "objc2-core-foundation")]
1313        /// Initiates a click-and-hold gesture that then drags to another element with a custom velocity and then holds, suitable for table cell reordering and similar operations.
1314        ///
1315        /// Parameter `duration`: Duration of the initial click-and-hold.
1316        ///
1317        /// Parameter `otherElement`: The element to finish the drag gesture over. In the example of table cell reordering, this would be the reorder element of the destination row.
1318        ///
1319        /// Parameter `velocity`: The velocity pixels per second at which to drag the element.
1320        ///
1321        /// Parameter `holdDuration`: The duration of the final hold.
1322        #[unsafe(method(clickForDuration:thenDragToElement:withVelocity:thenHoldForDuration:))]
1323        #[unsafe(method_family = none)]
1324        pub fn clickForDuration_thenDragToElement_withVelocity_thenHoldForDuration(
1325            &self,
1326            duration: NSTimeInterval,
1327            other_element: &XCUIElement,
1328            velocity: XCUIGestureVelocity,
1329            hold_duration: NSTimeInterval,
1330        );
1331
1332        #[cfg(feature = "objc2-core-foundation")]
1333        /// Scroll the view the specified pixels, x and y.
1334        #[unsafe(method(scrollByDeltaX:deltaY:))]
1335        #[unsafe(method_family = none)]
1336        pub fn scrollByDeltaX_deltaY(&self, delta_x: CGFloat, delta_y: CGFloat);
1337    );
1338}
1339
1340/// XCUIElementTypeSlider.
1341///
1342/// This category on XCUIElement provides functionality for automating UISlider and NSSlider.
1343impl XCUIElement {
1344    extern_methods!(
1345        #[cfg(feature = "objc2-core-foundation")]
1346        /// Manipulates the UI to change the displayed value of the slider to one based on a normalized position. 0 corresponds to the minimum value of the slider, 1 corresponds to its maximum value. The adjustment is a "best effort" to move the indicator to the desired position; absolute fidelity is not guaranteed.
1347        #[unsafe(method(adjustToNormalizedSliderPosition:))]
1348        #[unsafe(method_family = none)]
1349        pub fn adjustToNormalizedSliderPosition(&self, normalized_slider_position: CGFloat);
1350
1351        #[cfg(feature = "objc2-core-foundation")]
1352        /// Returns the position of the slider's indicator as a normalized value where 0 corresponds to the minimum value of the slider and 1 corresponds to its maximum value.
1353        #[unsafe(method(normalizedSliderPosition))]
1354        #[unsafe(method_family = none)]
1355        pub fn normalizedSliderPosition(&self) -> CGFloat;
1356    );
1357}
1358
1359extern_protocol!(
1360    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementsnapshot?language=objc)
1361    pub unsafe trait XCUIElementSnapshot: XCUIElementAttributes + MainThreadOnly {
1362        #[unsafe(method(children))]
1363        #[unsafe(method_family = none)]
1364        fn children(&self) -> Retained<NSArray<ProtocolObject<dyn XCUIElementSnapshot>>>;
1365
1366        /// Returns a hierarchical dictionary representation with standard attributes for the element and all
1367        /// of its descendants. The dictionary keys are of type XCUIElementAttributeName. If the value for a given
1368        /// attribute is null, the key will not be present, but empty strings may be found in the dictionary.
1369        #[unsafe(method(dictionaryRepresentation))]
1370        #[unsafe(method_family = none)]
1371        fn dictionaryRepresentation(
1372            &self,
1373        ) -> Retained<NSDictionary<XCUIElementAttributeName, AnyObject>>;
1374    }
1375);
1376
1377extern_protocol!(
1378    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementsnapshotproviding?language=objc)
1379    pub unsafe trait XCUIElementSnapshotProviding:
1380        NSObjectProtocol + MainThreadOnly
1381    {
1382        /// Returns a hierarchical data structure with standard attributes for the element and its children.
1383        #[unsafe(method(snapshotWithError:_))]
1384        #[unsafe(method_family = none)]
1385        fn snapshotWithError(
1386            &self,
1387        ) -> Result<Retained<ProtocolObject<dyn XCUIElementSnapshot>>, Retained<NSError>>;
1388    }
1389);
1390
1391/// XCUIElementSnapshotProviding.
1392impl XCUIElement {
1393    extern_methods!();
1394}
1395
1396extern_conformance!(
1397    unsafe impl XCUIElementSnapshotProviding for XCUIElement {}
1398);
1399
1400/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiprotectedresource?language=objc)
1401// NS_ENUM
1402#[repr(transparent)]
1403#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1404pub struct XCUIProtectedResource(pub NSInteger);
1405impl XCUIProtectedResource {
1406    #[doc(alias = "XCUIProtectedResourceContacts")]
1407    pub const Contacts: Self = Self(1);
1408    #[doc(alias = "XCUIProtectedResourceCalendar")]
1409    pub const Calendar: Self = Self(2);
1410    #[doc(alias = "XCUIProtectedResourceReminders")]
1411    pub const Reminders: Self = Self(3);
1412    #[doc(alias = "XCUIProtectedResourcePhotos")]
1413    pub const Photos: Self = Self(4);
1414    #[doc(alias = "XCUIProtectedResourceMicrophone")]
1415    pub const Microphone: Self = Self(5);
1416    #[doc(alias = "XCUIProtectedResourceCamera")]
1417    pub const Camera: Self = Self(6);
1418    #[doc(alias = "XCUIProtectedResourceMediaLibrary")]
1419    pub const MediaLibrary: Self = Self(7);
1420    #[doc(alias = "XCUIProtectedResourceHomeKit")]
1421    pub const HomeKit: Self = Self(8);
1422    #[doc(alias = "XCUIProtectedResourceFocus")]
1423    pub const Focus: Self = Self(9);
1424    #[doc(alias = "XCUIProtectedResourceSystemRootDirectory")]
1425    pub const SystemRootDirectory: Self = Self(0x40000000);
1426    #[doc(alias = "XCUIProtectedResourceUserDesktopDirectory")]
1427    pub const UserDesktopDirectory: Self = Self(0x40000001);
1428    #[doc(alias = "XCUIProtectedResourceUserDownloadsDirectory")]
1429    pub const UserDownloadsDirectory: Self = Self(0x40000002);
1430    #[doc(alias = "XCUIProtectedResourceUserDocumentsDirectory")]
1431    pub const UserDocumentsDirectory: Self = Self(0x40000003);
1432    #[doc(alias = "XCUIProtectedResourceNetworkVolumes")]
1433    pub const NetworkVolumes: Self = Self(0x40000004);
1434    #[doc(alias = "XCUIProtectedResourceRemovableVolumes")]
1435    pub const RemovableVolumes: Self = Self(0x40000005);
1436    #[doc(alias = "XCUIProtectedResourceAppleEvents")]
1437    pub const AppleEvents: Self = Self(0x40000006);
1438}
1439
1440unsafe impl Encode for XCUIProtectedResource {
1441    const ENCODING: Encoding = NSInteger::ENCODING;
1442}
1443
1444unsafe impl RefEncode for XCUIProtectedResource {
1445    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1446}
1447
1448/// Bitmasks for use with [XCUIApplication performAccessibilityAuditWithAuditTypes:issueHandler:error:].
1449/// These represent the types of audits that can be run, and they can be combined using bitwise OR.
1450///
1451/// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiaccessibilityaudittype?language=objc)
1452// NS_OPTIONS
1453#[repr(transparent)]
1454#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1455pub struct XCUIAccessibilityAuditType(pub u64);
1456bitflags::bitflags! {
1457    impl XCUIAccessibilityAuditType: u64 {
1458        #[doc(alias = "XCUIAccessibilityAuditTypeContrast")]
1459        const Contrast = 1<<0;
1460        #[doc(alias = "XCUIAccessibilityAuditTypeElementDetection")]
1461        const ElementDetection = 1<<1;
1462        #[doc(alias = "XCUIAccessibilityAuditTypeHitRegion")]
1463        const HitRegion = 1<<2;
1464        #[doc(alias = "XCUIAccessibilityAuditTypeSufficientElementDescription")]
1465        const SufficientElementDescription = 1<<3;
1466        #[doc(alias = "XCUIAccessibilityAuditTypeAction")]
1467        const Action = 1<<32;
1468        #[doc(alias = "XCUIAccessibilityAuditTypeParentChild")]
1469        const ParentChild = 1<<33;
1470        #[doc(alias = "XCUIAccessibilityAuditTypeAll")]
1471        const All = !0;
1472    }
1473}
1474
1475unsafe impl Encode for XCUIAccessibilityAuditType {
1476    const ENCODING: Encoding = u64::ENCODING;
1477}
1478
1479unsafe impl RefEncode for XCUIAccessibilityAuditType {
1480    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1481}
1482
1483extern_class!(
1484    /// Represents an issue returned by an accessibility audit.
1485    ///
1486    /// See also: [XCUIApplication performAccessibilityAuditWithAuditTypes:issueHandler:error:]
1487    ///
1488    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiaccessibilityauditissue?language=objc)
1489    #[unsafe(super(NSObject))]
1490    #[derive(Debug, PartialEq, Eq, Hash)]
1491    pub struct XCUIAccessibilityAuditIssue;
1492);
1493
1494extern_conformance!(
1495    unsafe impl NSObjectProtocol for XCUIAccessibilityAuditIssue {}
1496);
1497
1498impl XCUIAccessibilityAuditIssue {
1499    extern_methods!(
1500        /// The element associated with the issue.
1501        #[unsafe(method(element))]
1502        #[unsafe(method_family = none)]
1503        pub fn element(&self, mtm: MainThreadMarker) -> Option<Retained<XCUIElement>>;
1504
1505        /// A short description about the issue.
1506        #[unsafe(method(compactDescription))]
1507        #[unsafe(method_family = none)]
1508        pub fn compactDescription(&self) -> Retained<NSString>;
1509
1510        /// A longer description of the issue with more details about the failure.
1511        #[unsafe(method(detailedDescription))]
1512        #[unsafe(method_family = none)]
1513        pub fn detailedDescription(&self) -> Retained<NSString>;
1514
1515        /// The type of audit which generated the issue.
1516        #[unsafe(method(auditType))]
1517        #[unsafe(method_family = none)]
1518        pub fn auditType(&self) -> XCUIAccessibilityAuditType;
1519
1520        #[unsafe(method(new))]
1521        #[unsafe(method_family = new)]
1522        pub unsafe fn new() -> Retained<Self>;
1523
1524        #[unsafe(method(init))]
1525        #[unsafe(method_family = init)]
1526        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1527    );
1528}
1529
1530/// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiapplicationstate?language=objc)
1531// NS_ENUM
1532#[repr(transparent)]
1533#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1534pub struct XCUIApplicationState(pub NSUInteger);
1535impl XCUIApplicationState {
1536    #[doc(alias = "XCUIApplicationStateUnknown")]
1537    pub const Unknown: Self = Self(0);
1538    #[doc(alias = "XCUIApplicationStateNotRunning")]
1539    pub const NotRunning: Self = Self(1);
1540    #[doc(alias = "XCUIApplicationStateRunningBackground")]
1541    pub const RunningBackground: Self = Self(3);
1542    #[doc(alias = "XCUIApplicationStateRunningForeground")]
1543    pub const RunningForeground: Self = Self(4);
1544}
1545
1546unsafe impl Encode for XCUIApplicationState {
1547    const ENCODING: Encoding = NSUInteger::ENCODING;
1548}
1549
1550unsafe impl RefEncode for XCUIApplicationState {
1551    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1552}
1553
1554extern_class!(
1555    /// Proxy for an application that may or may not be running.
1556    ///
1557    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiapplication?language=objc)
1558    #[unsafe(super(XCUIElement, NSObject))]
1559    #[thread_kind = MainThreadOnly]
1560    #[derive(Debug, PartialEq, Eq, Hash)]
1561    pub struct XCUIApplication;
1562);
1563
1564extern_conformance!(
1565    unsafe impl NSObjectProtocol for XCUIApplication {}
1566);
1567
1568extern_conformance!(
1569    unsafe impl XCUIElementAttributes for XCUIApplication {}
1570);
1571
1572extern_conformance!(
1573    unsafe impl XCUIElementTypeQueryProvider for XCUIApplication {}
1574);
1575
1576impl XCUIApplication {
1577    extern_methods!(
1578        /// Returns a proxy for the application specified by the "Target Application" target setting.
1579        #[unsafe(method(init))]
1580        #[unsafe(method_family = init)]
1581        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1582
1583        #[unsafe(method(new))]
1584        #[unsafe(method_family = new)]
1585        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1586
1587        /// Returns a proxy for an application associated with the specified bundle identifier.
1588        #[unsafe(method(initWithBundleIdentifier:))]
1589        #[unsafe(method_family = init)]
1590        pub fn initWithBundleIdentifier(
1591            this: Allocated<Self>,
1592            bundle_identifier: &NSString,
1593        ) -> Retained<Self>;
1594
1595        /// Returns a proxy for the application at the specified file system URL.
1596        #[unsafe(method(initWithURL:))]
1597        #[unsafe(method_family = init)]
1598        pub fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
1599
1600        /// Launches the application synchronously. On return the application ready to handle events. If the
1601        /// application is already running, the existing instance will be terminated to ensure a clean state
1602        /// for the launched instance.
1603        ///
1604        /// Any failure in the launch sequence will be reported as a test failure and the test will be halted
1605        /// at that point.
1606        #[unsafe(method(launch))]
1607        #[unsafe(method_family = none)]
1608        pub fn launch(&self);
1609
1610        /// Launches the application synchronously using the provided URL. On return the application is ready
1611        /// to handle events, similar to the behavior of -launch.
1612        ///
1613        /// Any failure in the launch sequence, or any failure in using the provided URL, will be reported as a
1614        /// test failure and the test will be halted at that point.
1615        #[unsafe(method(openURL:))]
1616        #[unsafe(method_family = none)]
1617        pub fn openURL(&self, url: &NSURL);
1618
1619        /// Activates the application synchronously. On return the application is ready to handle events.
1620        /// If the application was not running prior, it will be launched automatically. If the application
1621        /// would be launched as a result of this method and was previously launched via -launch, the launch
1622        /// arguments and environment variables that were used then will be supplied again for the new launch.
1623        ///
1624        /// Unlike -launch, if the application is already running this call will not terminate the existing
1625        /// instance.
1626        ///
1627        /// Any failure in the activation or launch sequence will be reported as a test failure and the test
1628        /// will be halted at that point.
1629        #[unsafe(method(activate))]
1630        #[unsafe(method_family = none)]
1631        pub fn activate(&self);
1632
1633        /// Terminates any running instance of the application. If the application has an existing debug session
1634        /// via Xcode, the termination is implemented as a halt via that debug connection. Otherwise, a SIGKILL
1635        /// is sent to the process.
1636        #[unsafe(method(terminate))]
1637        #[unsafe(method_family = none)]
1638        pub fn terminate(&self);
1639
1640        /// The arguments that will be passed to the application on launch. If not modified, these are the
1641        /// arguments that Xcode will pass on launch. Those arguments can be changed, added to, or removed.
1642        /// Unlike NSTask, it is legal to modify these arguments after the application has been launched. These
1643        /// changes will not affect the current launch session, but will take effect the next time the application
1644        /// is launched.
1645        #[unsafe(method(launchArguments))]
1646        #[unsafe(method_family = none)]
1647        pub fn launchArguments(&self) -> Retained<NSArray<NSString>>;
1648
1649        /// Setter for [`launchArguments`][Self::launchArguments].
1650        ///
1651        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1652        #[unsafe(method(setLaunchArguments:))]
1653        #[unsafe(method_family = none)]
1654        pub fn setLaunchArguments(&self, launch_arguments: &NSArray<NSString>);
1655
1656        /// The environment that will be passed to the application on launch. If not modified, this is the
1657        /// environment that Xcode will pass on launch. Those variables can be changed, added to, or removed.
1658        /// Unlike NSTask, it is legal to modify the environment after the application has been launched. These
1659        /// changes will not affect the current launch session, but will take effect the next time the application
1660        /// is launched.
1661        #[unsafe(method(launchEnvironment))]
1662        #[unsafe(method_family = none)]
1663        pub fn launchEnvironment(&self) -> Retained<NSDictionary<NSString, NSString>>;
1664
1665        /// Setter for [`launchEnvironment`][Self::launchEnvironment].
1666        ///
1667        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1668        #[unsafe(method(setLaunchEnvironment:))]
1669        #[unsafe(method_family = none)]
1670        pub fn setLaunchEnvironment(&self, launch_environment: &NSDictionary<NSString, NSString>);
1671
1672        /// The most recently observed state of the application. Applications are passively monitored to update
1673        /// this property as they change state. Consequently, updates to this property are inherently asynchronous.
1674        ///
1675        /// Some guarantees are made, however:
1676        ///
1677        /// - When -launch and -activate return, if they were successful, the state of the application will be
1678        /// XCUIApplicationStateRunningBackground or XCUIApplicationStateRunningForeground, whichever is
1679        /// appropriate for the application. Most applications will be XCUIApplicationStateRunningForeground
1680        /// after launch or activation.
1681        ///
1682        /// - When -terminate returns, if it was successful, the state of the application will be
1683        /// XCUIApplicationStateNotRunning.
1684        #[unsafe(method(state))]
1685        #[unsafe(method_family = none)]
1686        pub fn state(&self) -> XCUIApplicationState;
1687
1688        /// Waits for the application to become a specific state, giving up after a number of seconds.
1689        ///
1690        /// Returns YES if the application is currently in or transitions to the desired state within the specified
1691        /// timeout period.
1692        #[must_use]
1693        #[unsafe(method(waitForState:timeout:))]
1694        #[unsafe(method_family = none)]
1695        pub fn waitForState_timeout(
1696            &self,
1697            state: XCUIApplicationState,
1698            timeout: NSTimeInterval,
1699        ) -> bool;
1700
1701        /// Reset the authorization status for a protected resource, such that the system will display the
1702        /// authorization prompt the next time the resource is accessed. The app does not have to be in a running state to
1703        /// use this API. If the app is running, it might get terminated while the reset occurs for some protected resources.
1704        ///
1705        /// Example usage:
1706        ///
1707        /// ```text
1708        ///  XCUIApplication *app = [XCUIApplication new];
1709        ///  [app resetAuthorizationStatusForResource:XCUIProtectedResourcePhotos];
1710        ///  [app launch];
1711        /// ```
1712        #[unsafe(method(resetAuthorizationStatusForResource:))]
1713        #[unsafe(method_family = none)]
1714        pub fn resetAuthorizationStatusForResource(&self, resource: XCUIProtectedResource);
1715
1716        #[cfg(feature = "block2")]
1717        /// Runs an accessibility audit on the current view. Generates XCTIssue objects for each issue returned by the audit, and fails the test case by recording each of these issues. Returns an error if the audit failed to run.
1718        ///
1719        ///
1720        /// Parameter `auditTypes`: Set of audit types which which configure what the audit will test for.
1721        ///
1722        /// Parameter `block`: An optional filter can be used to determine whether or not an issue should be recorded. To prevent an issue from recorded, return YES to handle it yourself.
1723        #[unsafe(method(performAccessibilityAuditWithAuditTypes:issueHandler:error:_))]
1724        #[unsafe(method_family = none)]
1725        pub fn performAccessibilityAuditWithAuditTypes_issueHandler_error(
1726            &self,
1727            audit_types: XCUIAccessibilityAuditType,
1728            block: Option<
1729                &block2::DynBlock<dyn Fn(NonNull<XCUIAccessibilityAuditIssue>) -> Bool + '_>,
1730            >,
1731        ) -> Result<(), Retained<NSError>>;
1732    );
1733}
1734
1735extern_class!(
1736    /// A coordinate represents a location on screen, relative to some element. Coordinates are dynamic, just like the elements to which they refer, and may compute different screen locations at different times, or be invalid if the referenced element does not exist.
1737    ///
1738    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuicoordinate?language=objc)
1739    #[unsafe(super(NSObject))]
1740    #[thread_kind = MainThreadOnly]
1741    #[derive(Debug, PartialEq, Eq, Hash)]
1742    pub struct XCUICoordinate;
1743);
1744
1745extern_conformance!(
1746    unsafe impl NSCopying for XCUICoordinate {}
1747);
1748
1749unsafe impl CopyingHelper for XCUICoordinate {
1750    type Result = Self;
1751}
1752
1753extern_conformance!(
1754    unsafe impl NSObjectProtocol for XCUICoordinate {}
1755);
1756
1757impl XCUICoordinate {
1758    extern_methods!(
1759        #[unsafe(method(new))]
1760        #[unsafe(method_family = new)]
1761        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1762
1763        #[unsafe(method(init))]
1764        #[unsafe(method_family = init)]
1765        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1766
1767        /// The element that the coordinate is based on, either directly or via the coordinate from which it was derived.
1768        #[unsafe(method(referencedElement))]
1769        #[unsafe(method_family = none)]
1770        pub fn referencedElement(&self) -> Retained<XCUIElement>;
1771
1772        #[cfg(feature = "objc2-core-foundation")]
1773        /// The dynamically computed value of the coordinate's location on screen. Note that this value is dependent on the current frame of the referenced element; if the element's frame changes, so will the value returned by this property. If the referenced element does exist when this is called, it will fail the test; check the referenced element's exists property if the element may not be present.
1774        #[unsafe(method(screenPoint))]
1775        #[unsafe(method_family = none)]
1776        pub fn screenPoint(&self) -> CGPoint;
1777
1778        #[cfg(feature = "objc2-core-foundation")]
1779        /// Creates a new coordinate with an absolute offset in points from the original coordinate.
1780        #[unsafe(method(coordinateWithOffset:))]
1781        #[unsafe(method_family = none)]
1782        pub fn coordinateWithOffset(&self, offset_vector: CGVector) -> Retained<XCUICoordinate>;
1783    );
1784}
1785
1786/// XCUICoordinateTouchEvents.
1787impl XCUICoordinate {
1788    extern_methods!(
1789        #[unsafe(method(tap))]
1790        #[unsafe(method_family = none)]
1791        pub fn tap(&self);
1792
1793        #[unsafe(method(doubleTap))]
1794        #[unsafe(method_family = none)]
1795        pub fn doubleTap(&self);
1796
1797        #[unsafe(method(pressForDuration:))]
1798        #[unsafe(method_family = none)]
1799        pub fn pressForDuration(&self, duration: NSTimeInterval);
1800
1801        #[unsafe(method(pressForDuration:thenDragToCoordinate:))]
1802        #[unsafe(method_family = none)]
1803        pub fn pressForDuration_thenDragToCoordinate(
1804            &self,
1805            duration: NSTimeInterval,
1806            other_coordinate: &XCUICoordinate,
1807        );
1808
1809        #[cfg(feature = "objc2-core-foundation")]
1810        #[unsafe(method(pressForDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:))]
1811        #[unsafe(method_family = none)]
1812        pub fn pressForDuration_thenDragToCoordinate_withVelocity_thenHoldForDuration(
1813            &self,
1814            duration: NSTimeInterval,
1815            other_coordinate: &XCUICoordinate,
1816            velocity: XCUIGestureVelocity,
1817            hold_duration: NSTimeInterval,
1818        );
1819
1820        /// Sends a swipe-up gesture.
1821        #[unsafe(method(swipeUp))]
1822        #[unsafe(method_family = none)]
1823        pub fn swipeUp(&self);
1824
1825        /// Sends a swipe-down gesture.
1826        #[unsafe(method(swipeDown))]
1827        #[unsafe(method_family = none)]
1828        pub fn swipeDown(&self);
1829
1830        /// Sends a swipe-left gesture.
1831        #[unsafe(method(swipeLeft))]
1832        #[unsafe(method_family = none)]
1833        pub fn swipeLeft(&self);
1834
1835        /// Sends a swipe-right gesture.
1836        #[unsafe(method(swipeRight))]
1837        #[unsafe(method_family = none)]
1838        pub fn swipeRight(&self);
1839
1840        #[cfg(feature = "objc2-core-foundation")]
1841        /// Sends a swipe in the specified direction with a specified velocity.
1842        ///
1843        /// Parameter `velocity`: The velocity pixels per second at which to perform the swipe at.
1844        #[unsafe(method(swipeUpWithVelocity:))]
1845        #[unsafe(method_family = none)]
1846        pub fn swipeUpWithVelocity(&self, velocity: XCUIGestureVelocity);
1847
1848        #[cfg(feature = "objc2-core-foundation")]
1849        #[unsafe(method(swipeDownWithVelocity:))]
1850        #[unsafe(method_family = none)]
1851        pub fn swipeDownWithVelocity(&self, velocity: XCUIGestureVelocity);
1852
1853        #[cfg(feature = "objc2-core-foundation")]
1854        #[unsafe(method(swipeLeftWithVelocity:))]
1855        #[unsafe(method_family = none)]
1856        pub fn swipeLeftWithVelocity(&self, velocity: XCUIGestureVelocity);
1857
1858        #[cfg(feature = "objc2-core-foundation")]
1859        #[unsafe(method(swipeRightWithVelocity:))]
1860        #[unsafe(method_family = none)]
1861        pub fn swipeRightWithVelocity(&self, velocity: XCUIGestureVelocity);
1862    );
1863}
1864
1865/// XCUICoordinateMouseEvents.
1866impl XCUICoordinate {
1867    extern_methods!(
1868        #[unsafe(method(hover))]
1869        #[unsafe(method_family = none)]
1870        pub fn hover(&self);
1871
1872        #[unsafe(method(click))]
1873        #[unsafe(method_family = none)]
1874        pub fn click(&self);
1875
1876        #[unsafe(method(doubleClick))]
1877        #[unsafe(method_family = none)]
1878        pub fn doubleClick(&self);
1879
1880        #[unsafe(method(rightClick))]
1881        #[unsafe(method_family = none)]
1882        pub fn rightClick(&self);
1883
1884        #[unsafe(method(clickForDuration:thenDragToCoordinate:))]
1885        #[unsafe(method_family = none)]
1886        pub fn clickForDuration_thenDragToCoordinate(
1887            &self,
1888            duration: NSTimeInterval,
1889            other_coordinate: &XCUICoordinate,
1890        );
1891
1892        #[cfg(feature = "objc2-core-foundation")]
1893        #[unsafe(method(clickForDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:))]
1894        #[unsafe(method_family = none)]
1895        pub fn clickForDuration_thenDragToCoordinate_withVelocity_thenHoldForDuration(
1896            &self,
1897            duration: NSTimeInterval,
1898            other_coordinate: &XCUICoordinate,
1899            velocity: XCUIGestureVelocity,
1900            hold_duration: NSTimeInterval,
1901        );
1902
1903        #[cfg(feature = "objc2-core-foundation")]
1904        #[unsafe(method(scrollByDeltaX:deltaY:))]
1905        #[unsafe(method_family = none)]
1906        pub fn scrollByDeltaX_deltaY(&self, delta_x: CGFloat, delta_y: CGFloat);
1907    );
1908}
1909
1910extern_class!(
1911    /// Represents a device's simulated location by wrapping a CLLocation object from Core Location
1912    ///
1913    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuilocation?language=objc)
1914    #[unsafe(super(NSObject))]
1915    #[thread_kind = MainThreadOnly]
1916    #[derive(Debug, PartialEq, Eq, Hash)]
1917    pub struct XCUILocation;
1918);
1919
1920extern_conformance!(
1921    unsafe impl NSObjectProtocol for XCUILocation {}
1922);
1923
1924impl XCUILocation {
1925    extern_methods!(
1926        #[unsafe(method(new))]
1927        #[unsafe(method_family = new)]
1928        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1929
1930        #[unsafe(method(init))]
1931        #[unsafe(method_family = init)]
1932        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1933
1934        #[cfg(feature = "objc2-core-location")]
1935        #[unsafe(method(initWithLocation:))]
1936        #[unsafe(method_family = init)]
1937        pub fn initWithLocation(this: Allocated<Self>, location: &CLLocation) -> Retained<Self>;
1938
1939        /// Provides debugging information about the underlying CLLocation wrapped by this object.
1940        #[unsafe(method(debugDescription))]
1941        #[unsafe(method_family = none)]
1942        pub fn debugDescription(&self) -> Retained<NSString>;
1943
1944        #[cfg(feature = "objc2-core-location")]
1945        /// Provides access to the CLLocation object stored by this XCUILocation instance.
1946        #[unsafe(method(location))]
1947        #[unsafe(method_family = none)]
1948        pub fn location(&self) -> Retained<CLLocation>;
1949    );
1950}
1951
1952/// Represents the light or dark UI style of a device.
1953///
1954///
1955/// Note: To maintain alignment with UIUserInterfaceStyle, we use `XCUIDeviceAppearanceUnspecified` to describe
1956/// UI styles that are unset.
1957///
1958/// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuideviceappearance?language=objc)
1959// NS_ENUM
1960#[repr(transparent)]
1961#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1962pub struct XCUIDeviceAppearance(pub NSInteger);
1963impl XCUIDeviceAppearance {
1964    #[doc(alias = "XCUIDeviceAppearanceUnspecified")]
1965    pub const Unspecified: Self = Self(0);
1966    #[doc(alias = "XCUIDeviceAppearanceLight")]
1967    pub const Light: Self = Self(1);
1968    #[doc(alias = "XCUIDeviceAppearanceDark")]
1969    pub const Dark: Self = Self(2);
1970}
1971
1972unsafe impl Encode for XCUIDeviceAppearance {
1973    const ENCODING: Encoding = NSInteger::ENCODING;
1974}
1975
1976unsafe impl RefEncode for XCUIDeviceAppearance {
1977    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1978}
1979
1980extern_class!(
1981    /// Represents a device, providing an interface for simulating events involving physical buttons and device state.
1982    ///
1983    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuidevice?language=objc)
1984    #[unsafe(super(NSObject))]
1985    #[thread_kind = MainThreadOnly]
1986    #[derive(Debug, PartialEq, Eq, Hash)]
1987    pub struct XCUIDevice;
1988);
1989
1990extern_conformance!(
1991    unsafe impl NSObjectProtocol for XCUIDevice {}
1992);
1993
1994impl XCUIDevice {
1995    extern_methods!(
1996        /// The current device.
1997        #[unsafe(method(sharedDevice))]
1998        #[unsafe(method_family = none)]
1999        pub fn sharedDevice(mtm: MainThreadMarker) -> Retained<XCUIDevice>;
2000
2001        #[unsafe(method(new))]
2002        #[unsafe(method_family = new)]
2003        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
2004
2005        #[deprecated]
2006        #[unsafe(method(init))]
2007        #[unsafe(method_family = init)]
2008        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2009
2010        /// The location currently being simulated by the device, if any.
2011        #[unsafe(method(location))]
2012        #[unsafe(method_family = none)]
2013        pub fn location(&self) -> Option<Retained<XCUILocation>>;
2014
2015        /// Setter for [`location`][Self::location].
2016        #[unsafe(method(setLocation:))]
2017        #[unsafe(method_family = none)]
2018        pub fn setLocation(&self, location: Option<&XCUILocation>);
2019
2020        /// Get or set the UI style of the device. Uses the `XCUIDeviceAppearance` enum to describe the UI style.
2021        #[unsafe(method(appearance))]
2022        #[unsafe(method_family = none)]
2023        pub fn appearance(&self) -> XCUIDeviceAppearance;
2024
2025        /// Setter for [`appearance`][Self::appearance].
2026        #[unsafe(method(setAppearance:))]
2027        #[unsafe(method_family = none)]
2028        pub fn setAppearance(&self, appearance: XCUIDeviceAppearance);
2029
2030        /// Access system features of the device, such as its running applications, or the ability to open files on it.
2031        #[unsafe(method(system))]
2032        #[unsafe(method_family = none)]
2033        pub fn system(&self) -> Retained<XCUISystem>;
2034    );
2035}
2036
2037extern "C" {
2038    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiidentifierclosewindow?language=objc)
2039    pub static XCUIIdentifierCloseWindow: &'static NSString;
2040}
2041
2042extern "C" {
2043    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiidentifierminimizewindow?language=objc)
2044    pub static XCUIIdentifierMinimizeWindow: &'static NSString;
2045}
2046
2047extern "C" {
2048    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiidentifierzoomwindow?language=objc)
2049    pub static XCUIIdentifierZoomWindow: &'static NSString;
2050}
2051
2052extern "C" {
2053    /// [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiidentifierfullscreenwindow?language=objc)
2054    pub static XCUIIdentifierFullScreenWindow: &'static NSString;
2055}
2056
2057extern_class!(
2058    /// Object for locating elements that can be chained with other queries.
2059    ///
2060    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuielementquery?language=objc)
2061    #[unsafe(super(NSObject))]
2062    #[thread_kind = MainThreadOnly]
2063    #[derive(Debug, PartialEq, Eq, Hash)]
2064    pub struct XCUIElementQuery;
2065);
2066
2067extern_conformance!(
2068    unsafe impl NSObjectProtocol for XCUIElementQuery {}
2069);
2070
2071extern_conformance!(
2072    unsafe impl XCUIElementTypeQueryProvider for XCUIElementQuery {}
2073);
2074
2075impl XCUIElementQuery {
2076    extern_methods!(
2077        #[unsafe(method(new))]
2078        #[unsafe(method_family = new)]
2079        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
2080
2081        #[unsafe(method(init))]
2082        #[unsafe(method_family = init)]
2083        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2084
2085        /// Returns an element that will use the query for resolution.
2086        #[unsafe(method(element))]
2087        #[unsafe(method_family = none)]
2088        pub fn element(&self) -> Retained<XCUIElement>;
2089
2090        /// Evaluates the query at the time it is called and returns the number of matches found.
2091        #[unsafe(method(count))]
2092        #[unsafe(method_family = none)]
2093        pub fn count(&self) -> NSUInteger;
2094
2095        /// Returns an element that will resolve to the index into the query's result set.
2096        #[deprecated]
2097        #[unsafe(method(elementAtIndex:))]
2098        #[unsafe(method_family = none)]
2099        pub fn elementAtIndex(&self, index: NSUInteger) -> Retained<XCUIElement>;
2100
2101        /// Returns an element that will use the index into the query's results to determine which underlying accessibility element it is matched with.
2102        #[unsafe(method(elementBoundByIndex:))]
2103        #[unsafe(method_family = none)]
2104        pub fn elementBoundByIndex(&self, index: NSUInteger) -> Retained<XCUIElement>;
2105
2106        /// Returns an element that matches the predicate. The predicate will be evaluated against objects of type id
2107        /// <XCUIElementAttributes
2108        /// >.
2109        #[unsafe(method(elementMatchingPredicate:))]
2110        #[unsafe(method_family = none)]
2111        pub fn elementMatchingPredicate(&self, predicate: &NSPredicate) -> Retained<XCUIElement>;
2112
2113        /// Returns an element that matches the type and identifier.
2114        #[unsafe(method(elementMatchingType:identifier:))]
2115        #[unsafe(method_family = none)]
2116        pub fn elementMatchingType_identifier(
2117            &self,
2118            element_type: XCUIElementType,
2119            identifier: Option<&NSString>,
2120        ) -> Retained<XCUIElement>;
2121
2122        /// Keyed subscripting is implemented as a shortcut for matching an identifier only. For example, app.descendants["Foo"] -> XCUIElement.
2123        #[unsafe(method(objectForKeyedSubscript:))]
2124        #[unsafe(method_family = none)]
2125        pub fn objectForKeyedSubscript(&self, key: &NSString) -> Retained<XCUIElement>;
2126
2127        /// Immediately evaluates the query and returns an array of elements bound to the resulting accessibility elements.
2128        #[unsafe(method(allElementsBoundByAccessibilityElement))]
2129        #[unsafe(method_family = none)]
2130        pub fn allElementsBoundByAccessibilityElement(&self) -> Retained<NSArray<XCUIElement>>;
2131
2132        /// Immediately evaluates the query and returns an array of elements bound by the index of each result.
2133        #[unsafe(method(allElementsBoundByIndex))]
2134        #[unsafe(method_family = none)]
2135        pub fn allElementsBoundByIndex(&self) -> Retained<NSArray<XCUIElement>>;
2136
2137        /// Returns a new query that finds the descendants of all the elements found by the receiver.
2138        #[unsafe(method(descendantsMatchingType:))]
2139        #[unsafe(method_family = none)]
2140        pub fn descendantsMatchingType(
2141            &self,
2142            r#type: XCUIElementType,
2143        ) -> Retained<XCUIElementQuery>;
2144
2145        /// Returns a new query that finds the direct children of all the elements found by the receiver.
2146        #[unsafe(method(childrenMatchingType:))]
2147        #[unsafe(method_family = none)]
2148        pub fn childrenMatchingType(&self, r#type: XCUIElementType) -> Retained<XCUIElementQuery>;
2149
2150        /// Returns a new query that applies the specified attributes or predicate to the receiver. The predicate will be evaluated against objects of type id
2151        /// <XCUIElementAttributes
2152        /// >.
2153        #[unsafe(method(matchingPredicate:))]
2154        #[unsafe(method_family = none)]
2155        pub fn matchingPredicate(&self, predicate: &NSPredicate) -> Retained<XCUIElementQuery>;
2156
2157        #[unsafe(method(matchingType:identifier:))]
2158        #[unsafe(method_family = none)]
2159        pub fn matchingType_identifier(
2160            &self,
2161            element_type: XCUIElementType,
2162            identifier: Option<&NSString>,
2163        ) -> Retained<XCUIElementQuery>;
2164
2165        #[unsafe(method(matchingIdentifier:))]
2166        #[unsafe(method_family = none)]
2167        pub fn matchingIdentifier(&self, identifier: &NSString) -> Retained<XCUIElementQuery>;
2168
2169        /// Returns a new query for finding elements that contain a descendant matching the specification. The predicate will be evaluated against objects of type id
2170        /// <XCUIElementAttributes
2171        /// >.
2172        #[unsafe(method(containingPredicate:))]
2173        #[unsafe(method_family = none)]
2174        pub fn containingPredicate(&self, predicate: &NSPredicate) -> Retained<XCUIElementQuery>;
2175
2176        #[unsafe(method(containingType:identifier:))]
2177        #[unsafe(method_family = none)]
2178        pub fn containingType_identifier(
2179            &self,
2180            element_type: XCUIElementType,
2181            identifier: Option<&NSString>,
2182        ) -> Retained<XCUIElementQuery>;
2183
2184        /// Provides debugging information about the query. The data in the string will vary based on the time
2185        /// at which it is captured, but it may include any of the following as well as additional data:
2186        /// • A description of each step of the query.
2187        /// • Information about the inputs and matched outputs of each step of the query.
2188        /// This data should be used for debugging only - depending on any of the data as part of a test is unsupported.
2189        #[unsafe(method(debugDescription))]
2190        #[unsafe(method_family = none)]
2191        pub fn debugDescription(&self) -> Retained<NSString>;
2192    );
2193}
2194
2195/// A button on a physical remote control.
2196///
2197/// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiremotebutton?language=objc)
2198// NS_ENUM
2199#[repr(transparent)]
2200#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2201pub struct XCUIRemoteButton(pub NSUInteger);
2202impl XCUIRemoteButton {
2203    #[doc(alias = "XCUIRemoteButtonUp")]
2204    pub const Up: Self = Self(0);
2205    #[doc(alias = "XCUIRemoteButtonDown")]
2206    pub const Down: Self = Self(1);
2207    #[doc(alias = "XCUIRemoteButtonLeft")]
2208    pub const Left: Self = Self(2);
2209    #[doc(alias = "XCUIRemoteButtonRight")]
2210    pub const Right: Self = Self(3);
2211    #[doc(alias = "XCUIRemoteButtonSelect")]
2212    pub const Select: Self = Self(4);
2213    #[doc(alias = "XCUIRemoteButtonMenu")]
2214    pub const Menu: Self = Self(5);
2215    #[doc(alias = "XCUIRemoteButtonPlayPause")]
2216    pub const PlayPause: Self = Self(6);
2217    #[doc(alias = "XCUIRemoteButtonHome")]
2218    pub const Home: Self = Self(7);
2219    #[doc(alias = "XCUIRemoteButtonPageUp")]
2220    pub const PageUp: Self = Self(9);
2221    #[doc(alias = "XCUIRemoteButtonPageDown")]
2222    pub const PageDown: Self = Self(10);
2223    #[doc(alias = "XCUIRemoteButtonGuide")]
2224    pub const Guide: Self = Self(11);
2225    #[doc(alias = "XCUIRemoteButtonTVProvider")]
2226    pub const TVProvider: Self = Self(12);
2227    #[doc(alias = "XCUIRemoteButtonOneTwoThree")]
2228    pub const OneTwoThree: Self = Self(13);
2229    #[doc(alias = "XCUIRemoteButtonFourColors")]
2230    pub const FourColors: Self = Self(14);
2231}
2232
2233unsafe impl Encode for XCUIRemoteButton {
2234    const ENCODING: Encoding = NSUInteger::ENCODING;
2235}
2236
2237unsafe impl RefEncode for XCUIRemoteButton {
2238    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2239}
2240
2241extern_class!(
2242    /// Represents an active screen of a device. One screen of each device is designated
2243    /// as the "main" screen, on macOS that is the one owning the menu bar, on other platforms
2244    /// it is the primary screen of the device.
2245    ///
2246    /// A screen can be asked for a screenshot using the methods declared in XCUIScreenshotProviding.
2247    ///
2248    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiscreen?language=objc)
2249    #[unsafe(super(NSObject))]
2250    #[thread_kind = MainThreadOnly]
2251    #[derive(Debug, PartialEq, Eq, Hash)]
2252    pub struct XCUIScreen;
2253);
2254
2255extern_conformance!(
2256    unsafe impl NSObjectProtocol for XCUIScreen {}
2257);
2258
2259extern_conformance!(
2260    unsafe impl XCUIScreenshotProviding for XCUIScreen {}
2261);
2262
2263impl XCUIScreen {
2264    extern_methods!(
2265        #[unsafe(method(new))]
2266        #[unsafe(method_family = new)]
2267        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
2268
2269        #[unsafe(method(init))]
2270        #[unsafe(method_family = init)]
2271        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2272
2273        /// Returns the current device's main screen.
2274        #[unsafe(method(mainScreen))]
2275        #[unsafe(method_family = none)]
2276        pub fn mainScreen(mtm: MainThreadMarker) -> Retained<XCUIScreen>;
2277
2278        /// Returns the list of active screens.
2279        /// The first screen returned in the list is the main screen.
2280        #[unsafe(method(screens))]
2281        #[unsafe(method_family = none)]
2282        pub fn screens(mtm: MainThreadMarker) -> Retained<NSArray<XCUIScreen>>;
2283    );
2284}
2285
2286extern_class!(
2287    /// Represents a captured screenshot.
2288    ///
2289    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuiscreenshot?language=objc)
2290    #[unsafe(super(NSObject))]
2291    #[thread_kind = MainThreadOnly]
2292    #[derive(Debug, PartialEq, Eq, Hash)]
2293    pub struct XCUIScreenshot;
2294);
2295
2296extern_conformance!(
2297    unsafe impl NSObjectProtocol for XCUIScreenshot {}
2298);
2299
2300impl XCUIScreenshot {
2301    extern_methods!(
2302        #[unsafe(method(new))]
2303        #[unsafe(method_family = new)]
2304        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
2305
2306        #[unsafe(method(init))]
2307        #[unsafe(method_family = init)]
2308        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2309
2310        #[cfg(feature = "objc2-app-kit")]
2311        #[cfg(target_os = "macos")]
2312        #[unsafe(method(image))]
2313        #[unsafe(method_family = none)]
2314        pub fn image(&self) -> Retained<NSImage>;
2315
2316        /// PNG image data of the underlying image.
2317        #[unsafe(method(PNGRepresentation))]
2318        #[unsafe(method_family = none)]
2319        pub fn PNGRepresentation(&self) -> Retained<NSData>;
2320    );
2321}
2322
2323extern_class!(
2324    /// Represents a device's base system, providing an interface for performing OS-specific actions like opening universal links.
2325    ///
2326    /// See also [Apple's documentation](https://developer.apple.com/documentation/xcuiautomation/xcuisystem?language=objc)
2327    #[unsafe(super(NSObject))]
2328    #[thread_kind = MainThreadOnly]
2329    #[derive(Debug, PartialEq, Eq, Hash)]
2330    pub struct XCUISystem;
2331);
2332
2333extern_conformance!(
2334    unsafe impl NSObjectProtocol for XCUISystem {}
2335);
2336
2337impl XCUISystem {
2338    extern_methods!(
2339        #[unsafe(method(new))]
2340        #[unsafe(method_family = new)]
2341        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
2342
2343        #[unsafe(method(init))]
2344        #[unsafe(method_family = init)]
2345        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2346
2347        /// Open a URL on the system using the default application for it.
2348        #[unsafe(method(openURL:))]
2349        #[unsafe(method_family = none)]
2350        pub fn openURL(&self, url: &NSURL);
2351    );
2352}