1#![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#[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#[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 pub unsafe trait XCUIElementAttributes: MainThreadOnly {
239 #[unsafe(method(identifier))]
241 #[unsafe(method_family = none)]
242 fn identifier(&self) -> Retained<NSString>;
243
244 #[cfg(feature = "objc2-core-foundation")]
245 #[unsafe(method(frame))]
247 #[unsafe(method_family = none)]
248 fn frame(&self) -> CGRect;
249
250 #[unsafe(method(value))]
252 #[unsafe(method_family = none)]
253 fn value(&self) -> Option<Retained<AnyObject>>;
254
255 #[unsafe(method(title))]
257 #[unsafe(method_family = none)]
258 fn title(&self) -> Retained<NSString>;
259
260 #[unsafe(method(label))]
262 #[unsafe(method_family = none)]
263 fn label(&self) -> Retained<NSString>;
264
265 #[unsafe(method(elementType))]
267 #[unsafe(method_family = none)]
268 fn elementType(&self) -> XCUIElementType;
269
270 #[unsafe(method(isEnabled))]
272 #[unsafe(method_family = none)]
273 fn isEnabled(&self) -> bool;
274
275 #[unsafe(method(horizontalSizeClass))]
277 #[unsafe(method_family = none)]
278 fn horizontalSizeClass(&self) -> XCUIUserInterfaceSizeClass;
279
280 #[unsafe(method(verticalSizeClass))]
282 #[unsafe(method_family = none)]
283 fn verticalSizeClass(&self) -> XCUIUserInterfaceSizeClass;
284
285 #[unsafe(method(placeholderValue))]
287 #[unsafe(method_family = none)]
288 fn placeholderValue(&self) -> Option<Retained<NSString>>;
289
290 #[unsafe(method(isSelected))]
292 #[unsafe(method_family = none)]
293 fn isSelected(&self) -> bool;
294 }
295);
296
297pub type XCUIElementAttributeName = NSString;
302
303extern "C" {
304 pub static XCUIElementAttributeNameChildren: &'static XCUIElementAttributeName;
308}
309
310extern "C" {
311 pub static XCUIElementAttributeNameElementType: &'static XCUIElementAttributeName;
315}
316
317extern "C" {
318 pub static XCUIElementAttributeNameIdentifier: &'static XCUIElementAttributeName;
322}
323
324extern "C" {
325 pub static XCUIElementAttributeNameValue: &'static XCUIElementAttributeName;
329}
330
331extern "C" {
332 pub static XCUIElementAttributeNamePlaceholderValue: &'static XCUIElementAttributeName;
336}
337
338extern "C" {
339 pub static XCUIElementAttributeNameTitle: &'static XCUIElementAttributeName;
343}
344
345extern "C" {
346 pub static XCUIElementAttributeNameLabel: &'static XCUIElementAttributeName;
350}
351
352extern "C" {
353 pub static XCUIElementAttributeNameFrame: &'static XCUIElementAttributeName;
357}
358
359extern "C" {
360 pub static XCUIElementAttributeNameEnabled: &'static XCUIElementAttributeName;
364}
365
366extern "C" {
367 pub static XCUIElementAttributeNameSelected: &'static XCUIElementAttributeName;
371}
372
373extern "C" {
374 pub static XCUIElementAttributeNameHasFocus: &'static XCUIElementAttributeName;
378}
379
380extern "C" {
381 pub static XCUIElementAttributeNameHorizontalSizeClass: &'static XCUIElementAttributeName;
385}
386
387extern "C" {
388 pub static XCUIElementAttributeNameVerticalSizeClass: &'static XCUIElementAttributeName;
392}
393
394extern_protocol!(
395 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 #[unsafe(method(firstMatch))]
731 #[unsafe(method_family = none)]
732 fn firstMatch(&self) -> Retained<XCUIElement>;
733 }
734);
735
736pub type XCUIKeyboardKey = NSString;
743
744extern "C" {
745 pub static XCUIKeyboardKeyDelete: &'static XCUIKeyboardKey;
747}
748
749extern "C" {
750 pub static XCUIKeyboardKeyReturn: &'static XCUIKeyboardKey;
752}
753
754extern "C" {
755 pub static XCUIKeyboardKeyEnter: &'static XCUIKeyboardKey;
757}
758
759extern "C" {
760 pub static XCUIKeyboardKeyTab: &'static XCUIKeyboardKey;
762}
763
764extern "C" {
765 pub static XCUIKeyboardKeySpace: &'static XCUIKeyboardKey;
767}
768
769extern "C" {
770 pub static XCUIKeyboardKeyEscape: &'static XCUIKeyboardKey;
772}
773
774extern "C" {
775 pub static XCUIKeyboardKeyUpArrow: &'static XCUIKeyboardKey;
777}
778
779extern "C" {
780 pub static XCUIKeyboardKeyDownArrow: &'static XCUIKeyboardKey;
782}
783
784extern "C" {
785 pub static XCUIKeyboardKeyLeftArrow: &'static XCUIKeyboardKey;
787}
788
789extern "C" {
790 pub static XCUIKeyboardKeyRightArrow: &'static XCUIKeyboardKey;
792}
793
794extern "C" {
795 pub static XCUIKeyboardKeyF1: &'static XCUIKeyboardKey;
797}
798
799extern "C" {
800 pub static XCUIKeyboardKeyF2: &'static XCUIKeyboardKey;
802}
803
804extern "C" {
805 pub static XCUIKeyboardKeyF3: &'static XCUIKeyboardKey;
807}
808
809extern "C" {
810 pub static XCUIKeyboardKeyF4: &'static XCUIKeyboardKey;
812}
813
814extern "C" {
815 pub static XCUIKeyboardKeyF5: &'static XCUIKeyboardKey;
817}
818
819extern "C" {
820 pub static XCUIKeyboardKeyF6: &'static XCUIKeyboardKey;
822}
823
824extern "C" {
825 pub static XCUIKeyboardKeyF7: &'static XCUIKeyboardKey;
827}
828
829extern "C" {
830 pub static XCUIKeyboardKeyF8: &'static XCUIKeyboardKey;
832}
833
834extern "C" {
835 pub static XCUIKeyboardKeyF9: &'static XCUIKeyboardKey;
837}
838
839extern "C" {
840 pub static XCUIKeyboardKeyF10: &'static XCUIKeyboardKey;
842}
843
844extern "C" {
845 pub static XCUIKeyboardKeyF11: &'static XCUIKeyboardKey;
847}
848
849extern "C" {
850 pub static XCUIKeyboardKeyF12: &'static XCUIKeyboardKey;
852}
853
854extern "C" {
855 pub static XCUIKeyboardKeyF13: &'static XCUIKeyboardKey;
857}
858
859extern "C" {
860 pub static XCUIKeyboardKeyF14: &'static XCUIKeyboardKey;
862}
863
864extern "C" {
865 pub static XCUIKeyboardKeyF15: &'static XCUIKeyboardKey;
867}
868
869extern "C" {
870 pub static XCUIKeyboardKeyF16: &'static XCUIKeyboardKey;
872}
873
874extern "C" {
875 pub static XCUIKeyboardKeyF17: &'static XCUIKeyboardKey;
877}
878
879extern "C" {
880 pub static XCUIKeyboardKeyF18: &'static XCUIKeyboardKey;
882}
883
884extern "C" {
885 pub static XCUIKeyboardKeyF19: &'static XCUIKeyboardKey;
887}
888
889extern "C" {
890 pub static XCUIKeyboardKeyForwardDelete: &'static XCUIKeyboardKey;
892}
893
894extern "C" {
895 pub static XCUIKeyboardKeyHome: &'static XCUIKeyboardKey;
897}
898
899extern "C" {
900 pub static XCUIKeyboardKeyEnd: &'static XCUIKeyboardKey;
902}
903
904extern "C" {
905 pub static XCUIKeyboardKeyPageUp: &'static XCUIKeyboardKey;
907}
908
909extern "C" {
910 pub static XCUIKeyboardKeyPageDown: &'static XCUIKeyboardKey;
912}
913
914extern "C" {
915 pub static XCUIKeyboardKeyClear: &'static XCUIKeyboardKey;
917}
918
919extern "C" {
920 pub static XCUIKeyboardKeyHelp: &'static XCUIKeyboardKey;
922}
923
924extern "C" {
925 pub static XCUIKeyboardKeyCapsLock: &'static XCUIKeyboardKey;
927}
928
929extern "C" {
930 pub static XCUIKeyboardKeyShift: &'static XCUIKeyboardKey;
932}
933
934extern "C" {
935 pub static XCUIKeyboardKeyControl: &'static XCUIKeyboardKey;
937}
938
939extern "C" {
940 pub static XCUIKeyboardKeyOption: &'static XCUIKeyboardKey;
942}
943
944extern "C" {
945 pub static XCUIKeyboardKeyCommand: &'static XCUIKeyboardKey;
947}
948
949extern "C" {
950 pub static XCUIKeyboardKeyRightShift: &'static XCUIKeyboardKey;
952}
953
954extern "C" {
955 pub static XCUIKeyboardKeyRightControl: &'static XCUIKeyboardKey;
957}
958
959extern "C" {
960 pub static XCUIKeyboardKeyRightOption: &'static XCUIKeyboardKey;
962}
963
964extern "C" {
965 pub static XCUIKeyboardKeyRightCommand: &'static XCUIKeyboardKey;
967}
968
969extern "C" {
970 pub static XCUIKeyboardKeySecondaryFn: &'static XCUIKeyboardKey;
972}
973
974extern_protocol!(
975 pub unsafe trait XCUIScreenshotProviding: NSObjectProtocol + MainThreadOnly {
977 #[unsafe(method(screenshot))]
982 #[unsafe(method_family = none)]
983 fn screenshot(&self) -> Retained<XCUIScreenshot>;
984 }
985);
986
987#[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#[cfg(feature = "objc2-core-foundation")]
1026pub type XCUIGestureVelocity = CGFloat;
1027
1028extern "C" {
1029 #[cfg(feature = "objc2-core-foundation")]
1031 pub static XCUIGestureVelocityDefault: XCUIGestureVelocity;
1032}
1033
1034extern "C" {
1035 #[cfg(feature = "objc2-core-foundation")]
1037 pub static XCUIGestureVelocitySlow: XCUIGestureVelocity;
1038}
1039
1040extern "C" {
1041 #[cfg(feature = "objc2-core-foundation")]
1043 pub static XCUIGestureVelocityFast: XCUIGestureVelocity;
1044}
1045
1046extern_class!(
1047 #[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 #[unsafe(method(exists))]
1081 #[unsafe(method_family = none)]
1082 pub fn exists(&self) -> bool;
1083
1084 #[must_use]
1086 #[unsafe(method(waitForExistenceWithTimeout:))]
1087 #[unsafe(method_family = none)]
1088 pub fn waitForExistenceWithTimeout(&self, timeout: NSTimeInterval) -> bool;
1089
1090 #[unsafe(method(waitForNonExistenceWithTimeout:))]
1092 #[unsafe(method_family = none)]
1093 pub fn waitForNonExistenceWithTimeout(&self, timeout: NSTimeInterval) -> bool;
1094
1095 #[unsafe(method(isHittable))]
1097 #[unsafe(method_family = none)]
1098 pub fn isHittable(&self) -> bool;
1099
1100 #[unsafe(method(descendantsMatchingType:))]
1102 #[unsafe(method_family = none)]
1103 pub fn descendantsMatchingType(
1104 &self,
1105 r#type: XCUIElementType,
1106 ) -> Retained<XCUIElementQuery>;
1107
1108 #[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 #[unsafe(method(coordinateWithNormalizedOffset:))]
1116 #[unsafe(method_family = none)]
1117 pub fn coordinateWithNormalizedOffset(
1118 &self,
1119 normalized_offset: CGVector,
1120 ) -> Retained<XCUICoordinate>;
1121
1122 #[unsafe(method(debugDescription))]
1129 #[unsafe(method_family = none)]
1130 pub fn debugDescription(&self) -> Retained<NSString>;
1131 );
1132}
1133
1134impl XCUIElement {
1136 extern_methods!();
1137}
1138
1139extern_conformance!(
1140 unsafe impl XCUIScreenshotProviding for XCUIElement {}
1141);
1142
1143impl XCUIElement {
1148 extern_methods!(
1149 #[unsafe(method(typeText:))]
1155 #[unsafe(method_family = none)]
1156 pub fn typeText(&self, text: &NSString);
1157
1158 #[cfg(feature = "block2")]
1159 #[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 #[unsafe(method(typeKey:modifierFlags:))]
1175 #[unsafe(method_family = none)]
1176 pub fn typeKey_modifierFlags(&self, key: &NSString, flags: XCUIKeyModifierFlags);
1177 );
1178}
1179
1180impl XCUIElement {
1182 extern_methods!(
1183 #[unsafe(method(tap))]
1185 #[unsafe(method_family = none)]
1186 pub fn tap(&self);
1187
1188 #[unsafe(method(doubleTap))]
1190 #[unsafe(method_family = none)]
1191 pub fn doubleTap(&self);
1192
1193 #[unsafe(method(pressForDuration:))]
1198 #[unsafe(method_family = none)]
1199 pub fn pressForDuration(&self, duration: NSTimeInterval);
1200
1201 #[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 #[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 #[unsafe(method(swipeUp))]
1236 #[unsafe(method_family = none)]
1237 pub fn swipeUp(&self);
1238
1239 #[unsafe(method(swipeDown))]
1241 #[unsafe(method_family = none)]
1242 pub fn swipeDown(&self);
1243
1244 #[unsafe(method(swipeLeft))]
1246 #[unsafe(method_family = none)]
1247 pub fn swipeLeft(&self);
1248
1249 #[unsafe(method(swipeRight))]
1251 #[unsafe(method_family = none)]
1252 pub fn swipeRight(&self);
1253
1254 #[cfg(feature = "objc2-core-foundation")]
1255 #[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
1279impl XCUIElement {
1281 extern_methods!(
1282 #[unsafe(method(hover))]
1284 #[unsafe(method_family = none)]
1285 pub fn hover(&self);
1286
1287 #[unsafe(method(click))]
1289 #[unsafe(method_family = none)]
1290 pub fn click(&self);
1291
1292 #[unsafe(method(doubleClick))]
1294 #[unsafe(method_family = none)]
1295 pub fn doubleClick(&self);
1296
1297 #[unsafe(method(rightClick))]
1299 #[unsafe(method_family = none)]
1300 pub fn rightClick(&self);
1301
1302 #[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 #[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 #[unsafe(method(scrollByDeltaX:deltaY:))]
1335 #[unsafe(method_family = none)]
1336 pub fn scrollByDeltaX_deltaY(&self, delta_x: CGFloat, delta_y: CGFloat);
1337 );
1338}
1339
1340impl XCUIElement {
1344 extern_methods!(
1345 #[cfg(feature = "objc2-core-foundation")]
1346 #[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 #[unsafe(method(normalizedSliderPosition))]
1354 #[unsafe(method_family = none)]
1355 pub fn normalizedSliderPosition(&self) -> CGFloat;
1356 );
1357}
1358
1359extern_protocol!(
1360 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 #[unsafe(method(dictionaryRepresentation))]
1370 #[unsafe(method_family = none)]
1371 fn dictionaryRepresentation(
1372 &self,
1373 ) -> Retained<NSDictionary<XCUIElementAttributeName, AnyObject>>;
1374 }
1375);
1376
1377extern_protocol!(
1378 pub unsafe trait XCUIElementSnapshotProviding:
1380 NSObjectProtocol + MainThreadOnly
1381 {
1382 #[unsafe(method(snapshotWithError:_))]
1384 #[unsafe(method_family = none)]
1385 fn snapshotWithError(
1386 &self,
1387 ) -> Result<Retained<ProtocolObject<dyn XCUIElementSnapshot>>, Retained<NSError>>;
1388 }
1389);
1390
1391impl XCUIElement {
1393 extern_methods!();
1394}
1395
1396extern_conformance!(
1397 unsafe impl XCUIElementSnapshotProviding for XCUIElement {}
1398);
1399
1400#[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#[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 #[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 #[unsafe(method(element))]
1502 #[unsafe(method_family = none)]
1503 pub fn element(&self, mtm: MainThreadMarker) -> Option<Retained<XCUIElement>>;
1504
1505 #[unsafe(method(compactDescription))]
1507 #[unsafe(method_family = none)]
1508 pub fn compactDescription(&self) -> Retained<NSString>;
1509
1510 #[unsafe(method(detailedDescription))]
1512 #[unsafe(method_family = none)]
1513 pub fn detailedDescription(&self) -> Retained<NSString>;
1514
1515 #[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#[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 #[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 #[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 #[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 #[unsafe(method(initWithURL:))]
1597 #[unsafe(method_family = init)]
1598 pub fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
1599
1600 #[unsafe(method(launch))]
1607 #[unsafe(method_family = none)]
1608 pub fn launch(&self);
1609
1610 #[unsafe(method(openURL:))]
1616 #[unsafe(method_family = none)]
1617 pub fn openURL(&self, url: &NSURL);
1618
1619 #[unsafe(method(activate))]
1630 #[unsafe(method_family = none)]
1631 pub fn activate(&self);
1632
1633 #[unsafe(method(terminate))]
1637 #[unsafe(method_family = none)]
1638 pub fn terminate(&self);
1639
1640 #[unsafe(method(launchArguments))]
1646 #[unsafe(method_family = none)]
1647 pub fn launchArguments(&self) -> Retained<NSArray<NSString>>;
1648
1649 #[unsafe(method(setLaunchArguments:))]
1653 #[unsafe(method_family = none)]
1654 pub fn setLaunchArguments(&self, launch_arguments: &NSArray<NSString>);
1655
1656 #[unsafe(method(launchEnvironment))]
1662 #[unsafe(method_family = none)]
1663 pub fn launchEnvironment(&self) -> Retained<NSDictionary<NSString, NSString>>;
1664
1665 #[unsafe(method(setLaunchEnvironment:))]
1669 #[unsafe(method_family = none)]
1670 pub fn setLaunchEnvironment(&self, launch_environment: &NSDictionary<NSString, NSString>);
1671
1672 #[unsafe(method(state))]
1685 #[unsafe(method_family = none)]
1686 pub fn state(&self) -> XCUIApplicationState;
1687
1688 #[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 #[unsafe(method(resetAuthorizationStatusForResource:))]
1713 #[unsafe(method_family = none)]
1714 pub fn resetAuthorizationStatusForResource(&self, resource: XCUIProtectedResource);
1715
1716 #[cfg(feature = "block2")]
1717 #[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 #[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 #[unsafe(method(referencedElement))]
1769 #[unsafe(method_family = none)]
1770 pub fn referencedElement(&self) -> Retained<XCUIElement>;
1771
1772 #[cfg(feature = "objc2-core-foundation")]
1773 #[unsafe(method(screenPoint))]
1775 #[unsafe(method_family = none)]
1776 pub fn screenPoint(&self) -> CGPoint;
1777
1778 #[cfg(feature = "objc2-core-foundation")]
1779 #[unsafe(method(coordinateWithOffset:))]
1781 #[unsafe(method_family = none)]
1782 pub fn coordinateWithOffset(&self, offset_vector: CGVector) -> Retained<XCUICoordinate>;
1783 );
1784}
1785
1786impl 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 #[unsafe(method(swipeUp))]
1822 #[unsafe(method_family = none)]
1823 pub fn swipeUp(&self);
1824
1825 #[unsafe(method(swipeDown))]
1827 #[unsafe(method_family = none)]
1828 pub fn swipeDown(&self);
1829
1830 #[unsafe(method(swipeLeft))]
1832 #[unsafe(method_family = none)]
1833 pub fn swipeLeft(&self);
1834
1835 #[unsafe(method(swipeRight))]
1837 #[unsafe(method_family = none)]
1838 pub fn swipeRight(&self);
1839
1840 #[cfg(feature = "objc2-core-foundation")]
1841 #[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
1865impl 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 #[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 #[unsafe(method(debugDescription))]
1941 #[unsafe(method_family = none)]
1942 pub fn debugDescription(&self) -> Retained<NSString>;
1943
1944 #[cfg(feature = "objc2-core-location")]
1945 #[unsafe(method(location))]
1947 #[unsafe(method_family = none)]
1948 pub fn location(&self) -> Retained<CLLocation>;
1949 );
1950}
1951
1952#[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 #[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 #[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 #[unsafe(method(location))]
2012 #[unsafe(method_family = none)]
2013 pub fn location(&self) -> Option<Retained<XCUILocation>>;
2014
2015 #[unsafe(method(setLocation:))]
2017 #[unsafe(method_family = none)]
2018 pub fn setLocation(&self, location: Option<&XCUILocation>);
2019
2020 #[unsafe(method(appearance))]
2022 #[unsafe(method_family = none)]
2023 pub fn appearance(&self) -> XCUIDeviceAppearance;
2024
2025 #[unsafe(method(setAppearance:))]
2027 #[unsafe(method_family = none)]
2028 pub fn setAppearance(&self, appearance: XCUIDeviceAppearance);
2029
2030 #[unsafe(method(system))]
2032 #[unsafe(method_family = none)]
2033 pub fn system(&self) -> Retained<XCUISystem>;
2034 );
2035}
2036
2037extern "C" {
2038 pub static XCUIIdentifierCloseWindow: &'static NSString;
2040}
2041
2042extern "C" {
2043 pub static XCUIIdentifierMinimizeWindow: &'static NSString;
2045}
2046
2047extern "C" {
2048 pub static XCUIIdentifierZoomWindow: &'static NSString;
2050}
2051
2052extern "C" {
2053 pub static XCUIIdentifierFullScreenWindow: &'static NSString;
2055}
2056
2057extern_class!(
2058 #[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 #[unsafe(method(element))]
2087 #[unsafe(method_family = none)]
2088 pub fn element(&self) -> Retained<XCUIElement>;
2089
2090 #[unsafe(method(count))]
2092 #[unsafe(method_family = none)]
2093 pub fn count(&self) -> NSUInteger;
2094
2095 #[deprecated]
2097 #[unsafe(method(elementAtIndex:))]
2098 #[unsafe(method_family = none)]
2099 pub fn elementAtIndex(&self, index: NSUInteger) -> Retained<XCUIElement>;
2100
2101 #[unsafe(method(elementBoundByIndex:))]
2103 #[unsafe(method_family = none)]
2104 pub fn elementBoundByIndex(&self, index: NSUInteger) -> Retained<XCUIElement>;
2105
2106 #[unsafe(method(elementMatchingPredicate:))]
2110 #[unsafe(method_family = none)]
2111 pub fn elementMatchingPredicate(&self, predicate: &NSPredicate) -> Retained<XCUIElement>;
2112
2113 #[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 #[unsafe(method(objectForKeyedSubscript:))]
2124 #[unsafe(method_family = none)]
2125 pub fn objectForKeyedSubscript(&self, key: &NSString) -> Retained<XCUIElement>;
2126
2127 #[unsafe(method(allElementsBoundByAccessibilityElement))]
2129 #[unsafe(method_family = none)]
2130 pub fn allElementsBoundByAccessibilityElement(&self) -> Retained<NSArray<XCUIElement>>;
2131
2132 #[unsafe(method(allElementsBoundByIndex))]
2134 #[unsafe(method_family = none)]
2135 pub fn allElementsBoundByIndex(&self) -> Retained<NSArray<XCUIElement>>;
2136
2137 #[unsafe(method(descendantsMatchingType:))]
2139 #[unsafe(method_family = none)]
2140 pub fn descendantsMatchingType(
2141 &self,
2142 r#type: XCUIElementType,
2143 ) -> Retained<XCUIElementQuery>;
2144
2145 #[unsafe(method(childrenMatchingType:))]
2147 #[unsafe(method_family = none)]
2148 pub fn childrenMatchingType(&self, r#type: XCUIElementType) -> Retained<XCUIElementQuery>;
2149
2150 #[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 #[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 #[unsafe(method(debugDescription))]
2190 #[unsafe(method_family = none)]
2191 pub fn debugDescription(&self) -> Retained<NSString>;
2192 );
2193}
2194
2195#[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 #[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 #[unsafe(method(mainScreen))]
2275 #[unsafe(method_family = none)]
2276 pub fn mainScreen(mtm: MainThreadMarker) -> Retained<XCUIScreen>;
2277
2278 #[unsafe(method(screens))]
2281 #[unsafe(method_family = none)]
2282 pub fn screens(mtm: MainThreadMarker) -> Retained<NSArray<XCUIScreen>>;
2283 );
2284}
2285
2286extern_class!(
2287 #[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 #[unsafe(method(PNGRepresentation))]
2318 #[unsafe(method_family = none)]
2319 pub fn PNGRepresentation(&self) -> Retained<NSData>;
2320 );
2321}
2322
2323extern_class!(
2324 #[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 #[unsafe(method(openURL:))]
2349 #[unsafe(method_family = none)]
2350 pub fn openURL(&self, url: &NSURL);
2351 );
2352}