Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ax_enum_util.cc
Go to the documentation of this file.
1// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ax_enum_util.h"
6
7namespace ui {
8
10 switch (event) {
11 case ax::mojom::Event::kNone:
12 return "none";
13 case ax::mojom::Event::kActiveDescendantChanged:
14 return "activedescendantchanged";
15 case ax::mojom::Event::kAlert:
16 return "alert";
17 case ax::mojom::Event::kAriaAttributeChanged:
18 return "ariaAttributeChanged";
19 case ax::mojom::Event::kAutocorrectionOccured:
20 return "autocorrectionOccured";
21 case ax::mojom::Event::kBlur:
22 return "blur";
23 case ax::mojom::Event::kCheckedStateChanged:
24 return "checkedStateChanged";
25 case ax::mojom::Event::kChildrenChanged:
26 return "childrenChanged";
27 case ax::mojom::Event::kClicked:
28 return "clicked";
29 case ax::mojom::Event::kControlsChanged:
30 return "controlsChanged";
31 case ax::mojom::Event::kDocumentSelectionChanged:
32 return "documentSelectionChanged";
33 case ax::mojom::Event::kDocumentTitleChanged:
34 return "documentTitleChanged";
35 case ax::mojom::Event::kEndOfTest:
36 return "endOfTest";
37 case ax::mojom::Event::kExpandedChanged:
38 return "expandedChanged";
39 case ax::mojom::Event::kFocus:
40 return "focus";
41 case ax::mojom::Event::kFocusAfterMenuClose:
42 return "focusAfterMenuClose";
43 case ax::mojom::Event::kFocusContext:
44 return "focusContext";
45 case ax::mojom::Event::kHide:
46 return "hide";
47 case ax::mojom::Event::kHitTestResult:
48 return "hitTestResult";
49 case ax::mojom::Event::kHover:
50 return "hover";
51 case ax::mojom::Event::kImageFrameUpdated:
52 return "imageFrameUpdated";
53 case ax::mojom::Event::kInvalidStatusChanged:
54 return "invalidStatusChanged";
55 case ax::mojom::Event::kLayoutComplete:
56 return "layoutComplete";
57 case ax::mojom::Event::kLiveRegionCreated:
58 return "liveRegionCreated";
59 case ax::mojom::Event::kLiveRegionChanged:
60 return "liveRegionChanged";
61 case ax::mojom::Event::kLoadComplete:
62 return "loadComplete";
63 case ax::mojom::Event::kLoadStart:
64 return "loadStart";
65 case ax::mojom::Event::kLocationChanged:
66 return "locationChanged";
67 case ax::mojom::Event::kMediaStartedPlaying:
68 return "mediaStartedPlaying";
69 case ax::mojom::Event::kMediaStoppedPlaying:
70 return "mediaStoppedPlaying";
71 case ax::mojom::Event::kMenuEnd:
72 return "menuEnd";
73 case ax::mojom::Event::kMenuListItemSelected:
74 return "menuListItemSelected";
75 case ax::mojom::Event::kMenuListValueChanged:
76 return "menuListValueChanged";
77 case ax::mojom::Event::kMenuPopupEnd:
78 return "menuPopupEnd";
79 case ax::mojom::Event::kMenuPopupStart:
80 return "menuPopupStart";
81 case ax::mojom::Event::kMenuStart:
82 return "menuStart";
83 case ax::mojom::Event::kMouseCanceled:
84 return "mouseCanceled";
85 case ax::mojom::Event::kMouseDragged:
86 return "mouseDragged";
87 case ax::mojom::Event::kMouseMoved:
88 return "mouseMoved";
89 case ax::mojom::Event::kMousePressed:
90 return "mousePressed";
91 case ax::mojom::Event::kMouseReleased:
92 return "mouseReleased";
93 case ax::mojom::Event::kRowCollapsed:
94 return "rowCollapsed";
95 case ax::mojom::Event::kRowCountChanged:
96 return "rowCountChanged";
97 case ax::mojom::Event::kRowExpanded:
98 return "rowExpanded";
99 case ax::mojom::Event::kScrollPositionChanged:
100 return "scrollPositionChanged";
101 case ax::mojom::Event::kScrolledToAnchor:
102 return "scrolledToAnchor";
103 case ax::mojom::Event::kSelectedChildrenChanged:
104 return "selectedChildrenChanged";
105 case ax::mojom::Event::kSelection:
106 return "selection";
107 case ax::mojom::Event::kSelectionAdd:
108 return "selectionAdd";
109 case ax::mojom::Event::kSelectionRemove:
110 return "selectionRemove";
111 case ax::mojom::Event::kShow:
112 return "show";
113 case ax::mojom::Event::kStateChanged:
114 return "stateChanged";
115 case ax::mojom::Event::kTextChanged:
116 return "textChanged";
117 case ax::mojom::Event::kTextSelectionChanged:
118 return "textSelectionChanged";
119 case ax::mojom::Event::kTooltipClosed:
120 return "tooltipClosed";
121 case ax::mojom::Event::kTooltipOpened:
122 return "tooltipOpened";
123 case ax::mojom::Event::kWindowActivated:
124 return "windowActivated";
125 case ax::mojom::Event::kWindowDeactivated:
126 return "windowDeactivated";
127 case ax::mojom::Event::kWindowVisibilityChanged:
128 return "windowVisibilityChanged";
129 case ax::mojom::Event::kTreeChanged:
130 return "treeChanged";
131 case ax::mojom::Event::kValueChanged:
132 return "valueChanged";
133 }
134
135 return "";
136}
137
139 if (0 == strcmp(event, "none"))
140 return ax::mojom::Event::kNone;
141 if (0 == strcmp(event, "activedescendantchanged"))
142 return ax::mojom::Event::kActiveDescendantChanged;
143 if (0 == strcmp(event, "alert"))
144 return ax::mojom::Event::kAlert;
145 if (0 == strcmp(event, "ariaAttributeChanged"))
146 return ax::mojom::Event::kAriaAttributeChanged;
147 if (0 == strcmp(event, "autocorrectionOccured"))
148 return ax::mojom::Event::kAutocorrectionOccured;
149 if (0 == strcmp(event, "blur"))
150 return ax::mojom::Event::kBlur;
151 if (0 == strcmp(event, "checkedStateChanged"))
152 return ax::mojom::Event::kCheckedStateChanged;
153 if (0 == strcmp(event, "childrenChanged"))
154 return ax::mojom::Event::kChildrenChanged;
155 if (0 == strcmp(event, "clicked"))
156 return ax::mojom::Event::kClicked;
157 if (0 == strcmp(event, "controlsChanged"))
158 return ax::mojom::Event::kControlsChanged;
159 if (0 == strcmp(event, "documentSelectionChanged"))
160 return ax::mojom::Event::kDocumentSelectionChanged;
161 if (0 == strcmp(event, "documentTitleChanged"))
162 return ax::mojom::Event::kDocumentTitleChanged;
163 if (0 == strcmp(event, "endOfTest"))
164 return ax::mojom::Event::kEndOfTest;
165 if (0 == strcmp(event, "expandedChanged"))
166 return ax::mojom::Event::kExpandedChanged;
167 if (0 == strcmp(event, "focus"))
168 return ax::mojom::Event::kFocus;
169 if (0 == strcmp(event, "focusAfterMenuClose"))
170 return ax::mojom::Event::kFocusAfterMenuClose;
171 if (0 == strcmp(event, "focusContext"))
172 return ax::mojom::Event::kFocusContext;
173 if (0 == strcmp(event, "hide"))
174 return ax::mojom::Event::kHide;
175 if (0 == strcmp(event, "hitTestResult"))
176 return ax::mojom::Event::kHitTestResult;
177 if (0 == strcmp(event, "hover"))
178 return ax::mojom::Event::kHover;
179 if (0 == strcmp(event, "imageFrameUpdated"))
180 return ax::mojom::Event::kImageFrameUpdated;
181 if (0 == strcmp(event, "invalidStatusChanged"))
182 return ax::mojom::Event::kInvalidStatusChanged;
183 if (0 == strcmp(event, "layoutComplete"))
184 return ax::mojom::Event::kLayoutComplete;
185 if (0 == strcmp(event, "liveRegionCreated"))
186 return ax::mojom::Event::kLiveRegionCreated;
187 if (0 == strcmp(event, "liveRegionChanged"))
188 return ax::mojom::Event::kLiveRegionChanged;
189 if (0 == strcmp(event, "loadComplete"))
190 return ax::mojom::Event::kLoadComplete;
191 if (0 == strcmp(event, "loadStart"))
192 return ax::mojom::Event::kLoadStart;
193 if (0 == strcmp(event, "locationChanged"))
194 return ax::mojom::Event::kLocationChanged;
195 if (0 == strcmp(event, "mediaStartedPlaying"))
196 return ax::mojom::Event::kMediaStartedPlaying;
197 if (0 == strcmp(event, "mediaStoppedPlaying"))
198 return ax::mojom::Event::kMediaStoppedPlaying;
199 if (0 == strcmp(event, "menuEnd"))
200 return ax::mojom::Event::kMenuEnd;
201 if (0 == strcmp(event, "menuListItemSelected"))
202 return ax::mojom::Event::kMenuListItemSelected;
203 if (0 == strcmp(event, "menuListValueChanged"))
204 return ax::mojom::Event::kMenuListValueChanged;
205 if (0 == strcmp(event, "menuPopupEnd"))
206 return ax::mojom::Event::kMenuPopupEnd;
207 if (0 == strcmp(event, "menuPopupStart"))
208 return ax::mojom::Event::kMenuPopupStart;
209 if (0 == strcmp(event, "menuStart"))
210 return ax::mojom::Event::kMenuStart;
211 if (0 == strcmp(event, "mouseCanceled"))
212 return ax::mojom::Event::kMouseCanceled;
213 if (0 == strcmp(event, "mouseDragged"))
214 return ax::mojom::Event::kMouseDragged;
215 if (0 == strcmp(event, "mouseMoved"))
216 return ax::mojom::Event::kMouseMoved;
217 if (0 == strcmp(event, "mousePressed"))
218 return ax::mojom::Event::kMousePressed;
219 if (0 == strcmp(event, "mouseReleased"))
220 return ax::mojom::Event::kMouseReleased;
221 if (0 == strcmp(event, "rowCollapsed"))
222 return ax::mojom::Event::kRowCollapsed;
223 if (0 == strcmp(event, "rowCountChanged"))
224 return ax::mojom::Event::kRowCountChanged;
225 if (0 == strcmp(event, "rowExpanded"))
226 return ax::mojom::Event::kRowExpanded;
227 if (0 == strcmp(event, "scrollPositionChanged"))
228 return ax::mojom::Event::kScrollPositionChanged;
229 if (0 == strcmp(event, "scrolledToAnchor"))
230 return ax::mojom::Event::kScrolledToAnchor;
231 if (0 == strcmp(event, "selectedChildrenChanged"))
232 return ax::mojom::Event::kSelectedChildrenChanged;
233 if (0 == strcmp(event, "selection"))
234 return ax::mojom::Event::kSelection;
235 if (0 == strcmp(event, "selectionAdd"))
236 return ax::mojom::Event::kSelectionAdd;
237 if (0 == strcmp(event, "selectionRemove"))
238 return ax::mojom::Event::kSelectionRemove;
239 if (0 == strcmp(event, "show"))
240 return ax::mojom::Event::kShow;
241 if (0 == strcmp(event, "stateChanged"))
242 return ax::mojom::Event::kStateChanged;
243 if (0 == strcmp(event, "textChanged"))
244 return ax::mojom::Event::kTextChanged;
245 if (0 == strcmp(event, "textSelectionChanged"))
246 return ax::mojom::Event::kTextSelectionChanged;
247 if (0 == strcmp(event, "tooltipClosed"))
248 return ax::mojom::Event::kTooltipClosed;
249 if (0 == strcmp(event, "tooltipOpened"))
250 return ax::mojom::Event::kTooltipOpened;
251 if (0 == strcmp(event, "windowActivated"))
252 return ax::mojom::Event::kWindowActivated;
253 if (0 == strcmp(event, "windowDeactivated"))
254 return ax::mojom::Event::kWindowDeactivated;
255 if (0 == strcmp(event, "windowVisibilityChanged"))
256 return ax::mojom::Event::kWindowVisibilityChanged;
257 if (0 == strcmp(event, "treeChanged"))
258 return ax::mojom::Event::kTreeChanged;
259 if (0 == strcmp(event, "valueChanged"))
260 return ax::mojom::Event::kValueChanged;
261 return ax::mojom::Event::kNone;
262}
263
264const char* ToString(ax::mojom::Role role) {
265 switch (role) {
267 return "none";
269 return "abbr";
271 return "alertDialog";
273 return "alert";
275 return "anchor";
277 return "application";
279 return "article";
281 return "audio";
283 return "banner";
285 return "blockquote";
287 return "button";
289 return "canvas";
291 return "caption";
293 return "caret";
295 return "cell";
297 return "checkBox";
299 return "client";
301 return "code";
303 return "colorWell";
305 return "columnHeader";
307 return "column";
309 return "comboBoxGrouping";
311 return "comboBoxMenuButton";
313 return "comment";
315 return "complementary";
317 return "contentDeletion";
319 return "contentInsertion";
321 return "contentInfo";
323 return "date";
325 return "dateTime";
327 return "definition";
329 return "descriptionListDetail";
331 return "descriptionList";
333 return "descriptionListTerm";
335 return "desktop";
337 return "details";
339 return "dialog";
341 return "directory";
343 return "disclosureTriangle";
345 return "docAbstract";
347 return "docAcknowledgments";
349 return "docAfterword";
351 return "docAppendix";
353 return "docBackLink";
355 return "docBiblioEntry";
357 return "docBibliography";
359 return "docBiblioRef";
361 return "docChapter";
363 return "docColophon";
365 return "docConclusion";
367 return "docCover";
369 return "docCredit";
371 return "docCredits";
373 return "docDedication";
375 return "docEndnote";
377 return "docEndnotes";
379 return "docEpigraph";
381 return "docEpilogue";
383 return "docErrata";
385 return "docExample";
387 return "docFootnote";
389 return "docForeword";
391 return "docGlossary";
393 return "docGlossref";
395 return "docIndex";
397 return "docIntroduction";
399 return "docNoteRef";
401 return "docNotice";
403 return "docPageBreak";
405 return "docPageList";
407 return "docPart";
409 return "docPreface";
411 return "docPrologue";
413 return "docPullquote";
415 return "docQna";
417 return "docSubtitle";
419 return "docTip";
421 return "docToc";
423 return "document";
425 return "embeddedObject";
427 return "emphasis";
429 return "feed";
431 return "figcaption";
433 return "figure";
435 return "footer";
437 return "footerAsNonLandmark";
439 return "form";
441 return "genericContainer";
443 return "graphicsDocument";
445 return "graphicsObject";
447 return "graphicsSymbol";
449 return "grid";
451 return "group";
453 return "header";
455 return "headerAsNonLandmark";
457 return "heading";
459 return "iframe";
461 return "iframePresentational";
463 return "ignored";
465 return "imageMap";
467 return "image";
469 return "imeCandidate";
471 return "inlineTextBox";
473 return "inputTime";
475 return "keyboard";
477 return "labelText";
479 return "layoutTable";
481 return "layoutTableCell";
483 return "layoutTableRow";
485 return "legend";
487 return "lineBreak";
489 return "link";
491 return "list";
493 return "listBoxOption";
495 return "listBox";
497 return "listGrid";
499 return "listItem";
501 return "listMarker";
503 return "log";
505 return "main";
507 return "mark";
509 return "marquee";
511 return "math";
513 return "menu";
515 return "menuBar";
517 return "menuItem";
519 return "menuItemCheckBox";
521 return "menuItemRadio";
523 return "menuListOption";
525 return "menuListPopup";
527 return "meter";
529 return "navigation";
531 return "note";
533 return "pane";
535 return "paragraph";
537 return "pdfActionableHighlight";
539 return "pluginObject";
541 return "popUpButton";
543 return "portal";
545 return "pre";
547 return "presentational";
549 return "progressIndicator";
551 return "radioButton";
553 return "radioGroup";
555 return "region";
557 return "rootWebArea";
559 return "row";
561 return "rowGroup";
563 return "rowHeader";
565 return "ruby";
567 return "rubyAnnotation";
569 return "section";
571 return "strong";
573 return "suggestion";
575 return "svgRoot";
577 return "scrollBar";
579 return "scrollView";
581 return "search";
583 return "searchBox";
585 return "slider";
587 return "sliderThumb";
589 return "spinButton";
591 return "splitter";
593 return "staticText";
595 return "status";
597 return "switch";
599 return "tabList";
601 return "tabPanel";
603 return "tab";
605 return "table";
607 return "tableHeaderContainer";
609 return "term";
611 return "textField";
613 return "textFieldWithComboBox";
615 return "time";
617 return "timer";
619 return "titleBar";
621 return "toggleButton";
623 return "toolbar";
625 return "treeGrid";
627 return "treeItem";
629 return "tree";
631 return "unknown";
633 return "tooltip";
635 return "video";
637 return "webArea";
639 return "webView";
641 return "window";
642 }
643
644 return "";
645}
646
647ax::mojom::Role ParseRole(const char* role) {
648 if (0 == strcmp(role, "none"))
650 if (0 == strcmp(role, "abbr"))
652 if (0 == strcmp(role, "alertDialog"))
654 if (0 == strcmp(role, "alert"))
656 if (0 == strcmp(role, "anchor"))
658 if (0 == strcmp(role, "application"))
660 if (0 == strcmp(role, "article"))
662 if (0 == strcmp(role, "audio"))
664 if (0 == strcmp(role, "banner"))
666 if (0 == strcmp(role, "blockquote"))
668 if (0 == strcmp(role, "button"))
670 if (0 == strcmp(role, "canvas"))
672 if (0 == strcmp(role, "caption"))
674 if (0 == strcmp(role, "caret"))
676 if (0 == strcmp(role, "cell"))
678 if (0 == strcmp(role, "checkBox"))
680 if (0 == strcmp(role, "client"))
682 if (0 == strcmp(role, "code"))
684 if (0 == strcmp(role, "colorWell"))
686 if (0 == strcmp(role, "columnHeader"))
688 if (0 == strcmp(role, "column"))
690 if (0 == strcmp(role, "comboBoxGrouping"))
692 if (0 == strcmp(role, "comboBoxMenuButton"))
694 if (0 == strcmp(role, "comment"))
696 if (0 == strcmp(role, "complementary"))
698 if (0 == strcmp(role, "contentDeletion"))
700 if (0 == strcmp(role, "contentInsertion"))
702 if (0 == strcmp(role, "contentInfo"))
704 if (0 == strcmp(role, "date"))
706 if (0 == strcmp(role, "dateTime"))
708 if (0 == strcmp(role, "definition"))
710 if (0 == strcmp(role, "descriptionListDetail"))
712 if (0 == strcmp(role, "descriptionList"))
714 if (0 == strcmp(role, "descriptionListTerm"))
716 if (0 == strcmp(role, "desktop"))
718 if (0 == strcmp(role, "details"))
720 if (0 == strcmp(role, "dialog"))
722 if (0 == strcmp(role, "directory"))
724 if (0 == strcmp(role, "disclosureTriangle"))
726 if (0 == strcmp(role, "docAbstract"))
728 if (0 == strcmp(role, "docAcknowledgments"))
730 if (0 == strcmp(role, "docAfterword"))
732 if (0 == strcmp(role, "docAppendix"))
734 if (0 == strcmp(role, "docBackLink"))
736 if (0 == strcmp(role, "docBiblioEntry"))
738 if (0 == strcmp(role, "docBibliography"))
740 if (0 == strcmp(role, "docBiblioRef"))
742 if (0 == strcmp(role, "docChapter"))
744 if (0 == strcmp(role, "docColophon"))
746 if (0 == strcmp(role, "docConclusion"))
748 if (0 == strcmp(role, "docCover"))
750 if (0 == strcmp(role, "docCredit"))
752 if (0 == strcmp(role, "docCredits"))
754 if (0 == strcmp(role, "docDedication"))
756 if (0 == strcmp(role, "docEndnote"))
758 if (0 == strcmp(role, "docEndnotes"))
760 if (0 == strcmp(role, "docEpigraph"))
762 if (0 == strcmp(role, "docEpilogue"))
764 if (0 == strcmp(role, "docErrata"))
766 if (0 == strcmp(role, "docExample"))
768 if (0 == strcmp(role, "docFootnote"))
770 if (0 == strcmp(role, "docForeword"))
772 if (0 == strcmp(role, "docGlossary"))
774 if (0 == strcmp(role, "docGlossref"))
776 if (0 == strcmp(role, "docIndex"))
778 if (0 == strcmp(role, "docIntroduction"))
780 if (0 == strcmp(role, "docNoteRef"))
782 if (0 == strcmp(role, "docNotice"))
784 if (0 == strcmp(role, "docPageBreak"))
786 if (0 == strcmp(role, "docPageList"))
788 if (0 == strcmp(role, "docPart"))
790 if (0 == strcmp(role, "docPreface"))
792 if (0 == strcmp(role, "docPrologue"))
794 if (0 == strcmp(role, "docPullquote"))
796 if (0 == strcmp(role, "docQna"))
798 if (0 == strcmp(role, "docSubtitle"))
800 if (0 == strcmp(role, "docTip"))
802 if (0 == strcmp(role, "docToc"))
804 if (0 == strcmp(role, "document"))
806 if (0 == strcmp(role, "embeddedObject"))
808 if (0 == strcmp(role, "emphasis"))
810 if (0 == strcmp(role, "feed"))
812 if (0 == strcmp(role, "figcaption"))
814 if (0 == strcmp(role, "figure"))
816 if (0 == strcmp(role, "footer"))
818 if (0 == strcmp(role, "footerAsNonLandmark"))
820 if (0 == strcmp(role, "form"))
822 if (0 == strcmp(role, "genericContainer"))
824 if (0 == strcmp(role, "graphicsDocument"))
826 if (0 == strcmp(role, "graphicsObject"))
828 if (0 == strcmp(role, "graphicsSymbol"))
830 if (0 == strcmp(role, "grid"))
832 if (0 == strcmp(role, "group"))
834 if (0 == strcmp(role, "heading"))
836 if (0 == strcmp(role, "header"))
838 if (0 == strcmp(role, "headerAsNonLandmark"))
840 if (0 == strcmp(role, "pdfActionableHighlight"))
842 if (0 == strcmp(role, "iframe"))
844 if (0 == strcmp(role, "iframePresentational"))
846 if (0 == strcmp(role, "ignored"))
848 if (0 == strcmp(role, "imageMap"))
850 if (0 == strcmp(role, "image"))
852 if (0 == strcmp(role, "imeCandidate"))
854 if (0 == strcmp(role, "inlineTextBox"))
856 if (0 == strcmp(role, "inputTime"))
858 if (0 == strcmp(role, "keyboard"))
860 if (0 == strcmp(role, "labelText"))
862 if (0 == strcmp(role, "layoutTable"))
864 if (0 == strcmp(role, "layoutTableCell"))
866 if (0 == strcmp(role, "layoutTableRow"))
868 if (0 == strcmp(role, "legend"))
870 if (0 == strcmp(role, "lineBreak"))
872 if (0 == strcmp(role, "link"))
874 if (0 == strcmp(role, "listBoxOption"))
876 if (0 == strcmp(role, "listBox"))
878 if (0 == strcmp(role, "listGrid"))
880 if (0 == strcmp(role, "listItem"))
882 if (0 == strcmp(role, "listMarker"))
884 if (0 == strcmp(role, "list"))
886 if (0 == strcmp(role, "log"))
888 if (0 == strcmp(role, "main"))
890 if (0 == strcmp(role, "mark"))
892 if (0 == strcmp(role, "marquee"))
894 if (0 == strcmp(role, "math"))
896 if (0 == strcmp(role, "menu"))
898 if (0 == strcmp(role, "menuBar"))
900 if (0 == strcmp(role, "menuItem"))
902 if (0 == strcmp(role, "menuItemCheckBox"))
904 if (0 == strcmp(role, "menuItemRadio"))
906 if (0 == strcmp(role, "menuListOption"))
908 if (0 == strcmp(role, "menuListPopup"))
910 if (0 == strcmp(role, "meter"))
912 if (0 == strcmp(role, "navigation"))
914 if (0 == strcmp(role, "note"))
916 if (0 == strcmp(role, "pane"))
918 if (0 == strcmp(role, "paragraph"))
920 if (0 == strcmp(role, "pluginObject"))
922 if (0 == strcmp(role, "popUpButton"))
924 if (0 == strcmp(role, "portal"))
926 if (0 == strcmp(role, "pre"))
928 if (0 == strcmp(role, "presentational"))
930 if (0 == strcmp(role, "progressIndicator"))
932 if (0 == strcmp(role, "radioButton"))
934 if (0 == strcmp(role, "radioGroup"))
936 if (0 == strcmp(role, "region"))
938 if (0 == strcmp(role, "rootWebArea"))
940 if (0 == strcmp(role, "row"))
942 if (0 == strcmp(role, "rowGroup"))
944 if (0 == strcmp(role, "rowHeader"))
946 if (0 == strcmp(role, "ruby"))
948 if (0 == strcmp(role, "rubyAnnotation"))
950 if (0 == strcmp(role, "section"))
952 if (0 == strcmp(role, "scrollBar"))
954 if (0 == strcmp(role, "scrollView"))
956 if (0 == strcmp(role, "search"))
958 if (0 == strcmp(role, "searchBox"))
960 if (0 == strcmp(role, "slider"))
962 if (0 == strcmp(role, "sliderThumb"))
964 if (0 == strcmp(role, "spinButton"))
966 if (0 == strcmp(role, "splitter"))
968 if (0 == strcmp(role, "staticText"))
970 if (0 == strcmp(role, "status"))
972 if (0 == strcmp(role, "suggestion"))
974 if (0 == strcmp(role, "svgRoot"))
976 if (0 == strcmp(role, "switch"))
978 if (0 == strcmp(role, "strong"))
980 if (0 == strcmp(role, "tabList"))
982 if (0 == strcmp(role, "tabPanel"))
984 if (0 == strcmp(role, "tab"))
986 if (0 == strcmp(role, "tableHeaderContainer"))
988 if (0 == strcmp(role, "table"))
990 if (0 == strcmp(role, "term"))
992 if (0 == strcmp(role, "textField"))
994 if (0 == strcmp(role, "textFieldWithComboBox"))
996 if (0 == strcmp(role, "time"))
998 if (0 == strcmp(role, "timer"))
1000 if (0 == strcmp(role, "titleBar"))
1002 if (0 == strcmp(role, "toggleButton"))
1004 if (0 == strcmp(role, "toolbar"))
1006 if (0 == strcmp(role, "treeGrid"))
1008 if (0 == strcmp(role, "treeItem"))
1010 if (0 == strcmp(role, "tree"))
1012 if (0 == strcmp(role, "unknown"))
1014 if (0 == strcmp(role, "tooltip"))
1016 if (0 == strcmp(role, "video"))
1018 if (0 == strcmp(role, "webArea"))
1020 if (0 == strcmp(role, "webView"))
1022 if (0 == strcmp(role, "window"))
1025}
1026
1028 switch (state) {
1030 return "none";
1032 return "autofillAvailable";
1034 return "collapsed";
1036 return "default";
1038 return "editable";
1040 return "expanded";
1042 return "focusable";
1044 return "horizontal";
1046 return "hovered";
1048 return "ignored";
1050 return "invisible";
1052 return "linked";
1054 return "multiline";
1056 return "multiselectable";
1058 return "protected";
1060 return "required";
1062 return "richlyEditable";
1064 return "vertical";
1066 return "visited";
1067 }
1068
1069 return "";
1070}
1071
1073 if (0 == strcmp(state, "none"))
1075 if (0 == strcmp(state, "autofillAvailable"))
1077 if (0 == strcmp(state, "collapsed"))
1079 if (0 == strcmp(state, "default"))
1081 if (0 == strcmp(state, "editable"))
1083 if (0 == strcmp(state, "expanded"))
1085 if (0 == strcmp(state, "focusable"))
1087 if (0 == strcmp(state, "horizontal"))
1089 if (0 == strcmp(state, "hovered"))
1091 if (0 == strcmp(state, "ignored"))
1093 if (0 == strcmp(state, "invisible"))
1095 if (0 == strcmp(state, "linked"))
1097 if (0 == strcmp(state, "multiline"))
1099 if (0 == strcmp(state, "multiselectable"))
1101 if (0 == strcmp(state, "protected"))
1103 if (0 == strcmp(state, "required"))
1105 if (0 == strcmp(state, "richlyEditable"))
1107 if (0 == strcmp(state, "vertical"))
1109 if (0 == strcmp(state, "visited"))
1112}
1113
1115 switch (action) {
1117 return "none";
1119 return "blur";
1121 return "clearAccessibilityFocus";
1123 return "collapse";
1125 return "customAction";
1127 return "decrement";
1129 return "doDefault";
1131 return "expand";
1133 return "focus";
1135 return "getImageData";
1137 return "hitTest";
1139 return "increment";
1141 return "loadInlineTextBoxes";
1143 return "replaceSelectedText";
1145 return "scrollBackward";
1147 return "scrollForward";
1149 return "scrollUp";
1151 return "scrollDown";
1153 return "scrollLeft";
1155 return "scrollRight";
1157 return "scrollToMakeVisible";
1159 return "scrollToPoint";
1161 return "setAccessibilityFocus";
1163 return "setScrollOffset";
1165 return "setSelection";
1167 return "setSequentialFocusNavigationStartingPoint";
1169 return "setValue";
1171 return "showContextMenu";
1173 return "getTextLocation";
1175 return "annotatePageImages";
1177 return "signalEndOfTest";
1179 return "showTooltip";
1181 return "hideTooltip";
1183 return "internalInvalidateTree";
1184 }
1185
1186 return "";
1187}
1188
1190 if (0 == strcmp(action, "none"))
1192 if (0 == strcmp(action, "annotatePageImages"))
1194 if (0 == strcmp(action, "blur"))
1196 if (0 == strcmp(action, "clearAccessibilityFocus"))
1198 if (0 == strcmp(action, "collapse"))
1200 if (0 == strcmp(action, "customAction"))
1202 if (0 == strcmp(action, "decrement"))
1204 if (0 == strcmp(action, "doDefault"))
1206 if (0 == strcmp(action, "expand"))
1208 if (0 == strcmp(action, "focus"))
1210 if (0 == strcmp(action, "getImageData"))
1212 if (0 == strcmp(action, "getTextLocation"))
1214 if (0 == strcmp(action, "hitTest"))
1216 if (0 == strcmp(action, "increment"))
1218 if (0 == strcmp(action, "loadInlineTextBoxes"))
1220 if (0 == strcmp(action, "replaceSelectedText"))
1222 if (0 == strcmp(action, "scrollBackward"))
1224 if (0 == strcmp(action, "scrollForward"))
1226 if (0 == strcmp(action, "scrollUp"))
1228 if (0 == strcmp(action, "scrollDown"))
1230 if (0 == strcmp(action, "scrollLeft"))
1232 if (0 == strcmp(action, "scrollRight"))
1234 if (0 == strcmp(action, "scrollToMakeVisible"))
1236 if (0 == strcmp(action, "scrollToPoint"))
1238 if (0 == strcmp(action, "setAccessibilityFocus"))
1240 if (0 == strcmp(action, "setScrollOffset"))
1242 if (0 == strcmp(action, "setSelection"))
1244 if (0 == strcmp(action, "setSequentialFocusNavigationStartingPoint"))
1246 if (0 == strcmp(action, "setValue"))
1248 if (0 == strcmp(action, "showContextMenu"))
1250 if (0 == strcmp(action, "signalEndOfTest"))
1252 if (0 == strcmp(action, "showTooltip"))
1254 if (0 == strcmp(action, "hideTooltip"))
1256 if (0 == strcmp(action, "internalInvalidateTree"))
1259}
1260
1261const char* ToString(ax::mojom::ActionFlags action_flags) {
1262 switch (action_flags) {
1264 return "none";
1266 return "requestImages";
1268 return "requestInlineTextBoxes";
1269 }
1270
1271 return "";
1272}
1273
1274ax::mojom::ActionFlags ParseActionFlags(const char* action_flags) {
1275 if (0 == strcmp(action_flags, "none"))
1277 if (0 == strcmp(action_flags, "requestImages"))
1279 if (0 == strcmp(action_flags, "requestInlineTextBoxes"))
1282}
1283
1284const char* ToString(ax::mojom::ScrollAlignment scroll_alignment) {
1285 switch (scroll_alignment) {
1287 return "none";
1289 return "scrollAlignmentCenter";
1291 return "scrollAlignmentTop";
1293 return "scrollAlignmentBottom";
1295 return "scrollAlignmentLeft";
1297 return "scrollAlignmentRight";
1299 return "scrollAlignmentClosestEdge";
1300 }
1301}
1302
1304 if (0 == strcmp(scroll_alignment, "none"))
1306 if (0 == strcmp(scroll_alignment, "scrollAlignmentCenter"))
1308 if (0 == strcmp(scroll_alignment, "scrollAlignmentTop"))
1310 if (0 == strcmp(scroll_alignment, "scrollAlignmentBottom"))
1312 if (0 == strcmp(scroll_alignment, "scrollAlignmentLeft"))
1314 if (0 == strcmp(scroll_alignment, "scrollAlignmentRight"))
1316 if (0 == strcmp(scroll_alignment, "scrollAlignmentClosestEdge"))
1319}
1320
1321const char* ToString(ax::mojom::DefaultActionVerb default_action_verb) {
1322 switch (default_action_verb) {
1324 return "none";
1326 return "activate";
1328 return "check";
1330 return "click";
1332 // Some screen readers, such as Jaws, expect the following spelling of
1333 // this verb.
1334 return "click-ancestor";
1336 return "jump";
1338 return "open";
1340 return "press";
1342 return "select";
1344 return "uncheck";
1345 }
1346
1347 return "";
1348}
1349
1351 const char* default_action_verb) {
1352 if (0 == strcmp(default_action_verb, "none"))
1354 if (0 == strcmp(default_action_verb, "activate"))
1356 if (0 == strcmp(default_action_verb, "check"))
1358 if (0 == strcmp(default_action_verb, "click"))
1360 // Some screen readers, such as Jaws, expect the following spelling of this
1361 // verb.
1362 if (0 == strcmp(default_action_verb, "click-ancestor"))
1364 if (0 == strcmp(default_action_verb, "jump"))
1366 if (0 == strcmp(default_action_verb, "open"))
1368 if (0 == strcmp(default_action_verb, "press"))
1370 if (0 == strcmp(default_action_verb, "select"))
1372 if (0 == strcmp(default_action_verb, "uncheck"))
1375}
1376
1377const char* ToString(ax::mojom::Mutation mutation) {
1378 switch (mutation) {
1380 return "none";
1382 return "nodeCreated";
1384 return "subtreeCreated";
1386 return "nodeChanged";
1388 return "nodeRemoved";
1389 }
1390
1391 return "";
1392}
1393
1394ax::mojom::Mutation ParseMutation(const char* mutation) {
1395 if (0 == strcmp(mutation, "none"))
1397 if (0 == strcmp(mutation, "nodeCreated"))
1399 if (0 == strcmp(mutation, "subtreeCreated"))
1401 if (0 == strcmp(mutation, "nodeChanged"))
1403 if (0 == strcmp(mutation, "nodeRemoved"))
1406}
1407
1408const char* ToString(ax::mojom::StringAttribute string_attribute) {
1409 switch (string_attribute) {
1411 return "none";
1413 return "accessKey";
1415 return "ariaInvalidValue";
1417 return "autoComplete";
1419 return "childTreeId";
1421 return "className";
1423 return "containerLiveRelevant";
1425 return "containerLiveStatus";
1427 return "description";
1429 return "display";
1431 return "fontFamily";
1433 return "htmlTag";
1435 return "imageAnnotation";
1437 return "imageDataUrl";
1439 return "innerHtml";
1441 return "inputType";
1443 return "keyShortcuts";
1445 return "language";
1447 return "name";
1449 return "liveRelevant";
1451 return "liveStatus";
1453 return "placeholder";
1455 return "role";
1457 return "roleDescription";
1459 return "tooltip";
1461 return "url";
1463 return "value";
1464 }
1465
1466 return "";
1467}
1468
1470 if (0 == strcmp(string_attribute, "none"))
1472 if (0 == strcmp(string_attribute, "accessKey"))
1474 if (0 == strcmp(string_attribute, "ariaInvalidValue"))
1476 if (0 == strcmp(string_attribute, "autoComplete"))
1478 if (0 == strcmp(string_attribute, "childTreeId"))
1480 if (0 == strcmp(string_attribute, "className"))
1482 if (0 == strcmp(string_attribute, "containerLiveRelevant"))
1484 if (0 == strcmp(string_attribute, "containerLiveStatus"))
1486 if (0 == strcmp(string_attribute, "description"))
1488 if (0 == strcmp(string_attribute, "display"))
1490 if (0 == strcmp(string_attribute, "fontFamily"))
1492 if (0 == strcmp(string_attribute, "htmlTag"))
1494 if (0 == strcmp(string_attribute, "imageAnnotation"))
1496 if (0 == strcmp(string_attribute, "imageDataUrl"))
1498 if (0 == strcmp(string_attribute, "innerHtml"))
1500 if (0 == strcmp(string_attribute, "inputType"))
1502 if (0 == strcmp(string_attribute, "keyShortcuts"))
1504 if (0 == strcmp(string_attribute, "language"))
1506 if (0 == strcmp(string_attribute, "name"))
1508 if (0 == strcmp(string_attribute, "liveRelevant"))
1510 if (0 == strcmp(string_attribute, "liveStatus"))
1512 if (0 == strcmp(string_attribute, "placeholder"))
1514 if (0 == strcmp(string_attribute, "role"))
1516 if (0 == strcmp(string_attribute, "roleDescription"))
1518 if (0 == strcmp(string_attribute, "tooltip"))
1520 if (0 == strcmp(string_attribute, "url"))
1522 if (0 == strcmp(string_attribute, "value"))
1525}
1526
1527const char* ToString(ax::mojom::IntAttribute int_attribute) {
1528 switch (int_attribute) {
1530 return "none";
1532 return "defaultActionVerb";
1534 return "dropeffect";
1536 return "scrollX";
1538 return "scrollXMin";
1540 return "scrollXMax";
1542 return "scrollY";
1544 return "scrollYMin";
1546 return "scrollYMax";
1548 return "textSelStart";
1550 return "textSelEnd";
1552 return "ariaColumnCount";
1554 return "ariaCellColumnIndex";
1556 return "ariaCellColumnSpan";
1558 return "ariaRowCount";
1560 return "ariaCellRowIndex";
1562 return "ariaCellRowSpan";
1564 return "tableRowCount";
1566 return "tableColumnCount";
1568 return "tableHeaderId";
1570 return "tableRowIndex";
1572 return "tableRowHeaderId";
1574 return "tableColumnIndex";
1576 return "tableColumnHeaderId";
1578 return "tableCellColumnIndex";
1580 return "tableCellColumnSpan";
1582 return "tableCellRowIndex";
1584 return "tableCellRowSpan";
1586 return "sortDirection";
1588 return "hierarchicalLevel";
1590 return "nameFrom";
1592 return "descriptionFrom";
1594 return "activedescendantId";
1596 return "errormessageId";
1598 return "inPageLinkTargetId";
1600 return "memberOfId";
1602 return "nextOnLineId";
1604 return "popupForId";
1606 return "previousOnLineId";
1608 return "restriction";
1610 return "setSize";
1612 return "posInSet";
1614 return "colorValue";
1616 return "ariaCurrentState";
1618 return "backgroundColor";
1620 return "color";
1622 return "haspopup";
1624 return "invalidState";
1626 return "checkedState";
1628 return "listStyle";
1630 return "text-align";
1632 return "textDirection";
1634 return "textPosition";
1636 return "textStyle";
1638 return "textOverlineStyle";
1640 return "textStrikethroughStyle";
1642 return "textUnderlineStyle";
1644 return "previousFocusId";
1646 return "nextFocusId";
1648 return "imageAnnotationStatus";
1650 return "domNodeId";
1651 }
1652
1653 return "";
1654}
1655
1656ax::mojom::IntAttribute ParseIntAttribute(const char* int_attribute) {
1657 if (0 == strcmp(int_attribute, "none"))
1659 if (0 == strcmp(int_attribute, "defaultActionVerb"))
1661 if (0 == strcmp(int_attribute, "dropeffect"))
1663 if (0 == strcmp(int_attribute, "scrollX"))
1665 if (0 == strcmp(int_attribute, "scrollXMin"))
1667 if (0 == strcmp(int_attribute, "scrollXMax"))
1669 if (0 == strcmp(int_attribute, "scrollY"))
1671 if (0 == strcmp(int_attribute, "scrollYMin"))
1673 if (0 == strcmp(int_attribute, "scrollYMax"))
1675 if (0 == strcmp(int_attribute, "textSelStart"))
1677 if (0 == strcmp(int_attribute, "textSelEnd"))
1679 if (0 == strcmp(int_attribute, "ariaColumnCount"))
1681 if (0 == strcmp(int_attribute, "ariaCellColumnIndex"))
1683 if (0 == strcmp(int_attribute, "ariaCellColumnSpan"))
1685 if (0 == strcmp(int_attribute, "ariaRowCount"))
1687 if (0 == strcmp(int_attribute, "ariaCellRowIndex"))
1689 if (0 == strcmp(int_attribute, "ariaCellRowSpan"))
1691 if (0 == strcmp(int_attribute, "tableRowCount"))
1693 if (0 == strcmp(int_attribute, "tableColumnCount"))
1695 if (0 == strcmp(int_attribute, "tableHeaderId"))
1697 if (0 == strcmp(int_attribute, "tableRowIndex"))
1699 if (0 == strcmp(int_attribute, "tableRowHeaderId"))
1701 if (0 == strcmp(int_attribute, "tableColumnIndex"))
1703 if (0 == strcmp(int_attribute, "tableColumnHeaderId"))
1705 if (0 == strcmp(int_attribute, "tableCellColumnIndex"))
1707 if (0 == strcmp(int_attribute, "tableCellColumnSpan"))
1709 if (0 == strcmp(int_attribute, "tableCellRowIndex"))
1711 if (0 == strcmp(int_attribute, "tableCellRowSpan"))
1713 if (0 == strcmp(int_attribute, "sortDirection"))
1715 if (0 == strcmp(int_attribute, "hierarchicalLevel"))
1717 if (0 == strcmp(int_attribute, "nameFrom"))
1719 if (0 == strcmp(int_attribute, "descriptionFrom"))
1721 if (0 == strcmp(int_attribute, "activedescendantId"))
1723 if (0 == strcmp(int_attribute, "errormessageId"))
1725 if (0 == strcmp(int_attribute, "inPageLinkTargetId"))
1727 if (0 == strcmp(int_attribute, "memberOfId"))
1729 if (0 == strcmp(int_attribute, "nextOnLineId"))
1731 if (0 == strcmp(int_attribute, "popupForId"))
1733 if (0 == strcmp(int_attribute, "previousOnLineId"))
1735 if (0 == strcmp(int_attribute, "restriction"))
1737 if (0 == strcmp(int_attribute, "setSize"))
1739 if (0 == strcmp(int_attribute, "posInSet"))
1741 if (0 == strcmp(int_attribute, "colorValue"))
1743 if (0 == strcmp(int_attribute, "ariaCurrentState"))
1745 if (0 == strcmp(int_attribute, "backgroundColor"))
1747 if (0 == strcmp(int_attribute, "color"))
1749 if (0 == strcmp(int_attribute, "haspopup"))
1751 if (0 == strcmp(int_attribute, "invalidState"))
1753 if (0 == strcmp(int_attribute, "checkedState"))
1755 if (0 == strcmp(int_attribute, "listStyle"))
1757 if (0 == strcmp(int_attribute, "text-align"))
1759 if (0 == strcmp(int_attribute, "textDirection"))
1761 if (0 == strcmp(int_attribute, "textPosition"))
1763 if (0 == strcmp(int_attribute, "textStyle"))
1765 if (0 == strcmp(int_attribute, "textOverlineStyle"))
1767 if (0 == strcmp(int_attribute, "textStrikethroughStyle"))
1769 if (0 == strcmp(int_attribute, "textUnderlineStyle"))
1771 if (0 == strcmp(int_attribute, "previousFocusId"))
1773 if (0 == strcmp(int_attribute, "nextFocusId"))
1775 if (0 == strcmp(int_attribute, "imageAnnotationStatus"))
1777 if (0 == strcmp(int_attribute, "domNodeId"))
1780}
1781
1782const char* ToString(ax::mojom::FloatAttribute float_attribute) {
1783 switch (float_attribute) {
1785 return "none";
1787 return "valueForRange";
1789 return "minValueForRange";
1791 return "maxValueForRange";
1793 return "stepValueForRange";
1795 return "fontSize";
1797 return "fontWeight";
1799 return "textIndent";
1800 }
1801
1802 return "";
1803}
1804
1806 if (0 == strcmp(float_attribute, "none"))
1808 if (0 == strcmp(float_attribute, "valueForRange"))
1810 if (0 == strcmp(float_attribute, "minValueForRange"))
1812 if (0 == strcmp(float_attribute, "maxValueForRange"))
1814 if (0 == strcmp(float_attribute, "stepValueForRange"))
1816 if (0 == strcmp(float_attribute, "fontSize"))
1818 if (0 == strcmp(float_attribute, "fontWeight"))
1820 if (0 == strcmp(float_attribute, "textIndent"))
1823}
1824
1825const char* ToString(ax::mojom::BoolAttribute bool_attribute) {
1826 switch (bool_attribute) {
1828 return "none";
1830 return "busy";
1832 return "editableRoot";
1834 return "containerLiveAtomic";
1836 return "containerLiveBusy";
1838 return "grabbed";
1840 return "liveAtomic";
1842 return "modal";
1844 return "updateLocationOnly";
1846 return "canvasHasFallback";
1848 return "scrollable";
1850 return "clickable";
1852 return "clipsChildren";
1854 return "notUserSelectableStyle";
1856 return "selected";
1858 return "selectedFromFocus";
1860 return "supportsTextLocation";
1862 return "isLineBreakingObject";
1864 return "isPageBreakingObject";
1866 return "hasAriaAttribute";
1867 }
1868
1869 return "";
1870}
1871
1873 if (0 == strcmp(bool_attribute, "none"))
1875 if (0 == strcmp(bool_attribute, "busy"))
1877 if (0 == strcmp(bool_attribute, "editableRoot"))
1879 if (0 == strcmp(bool_attribute, "containerLiveAtomic"))
1881 if (0 == strcmp(bool_attribute, "containerLiveBusy"))
1883 if (0 == strcmp(bool_attribute, "grabbed"))
1885 if (0 == strcmp(bool_attribute, "liveAtomic"))
1887 if (0 == strcmp(bool_attribute, "modal"))
1889 if (0 == strcmp(bool_attribute, "updateLocationOnly"))
1891 if (0 == strcmp(bool_attribute, "canvasHasFallback"))
1893 if (0 == strcmp(bool_attribute, "scrollable"))
1895 if (0 == strcmp(bool_attribute, "clickable"))
1897 if (0 == strcmp(bool_attribute, "clipsChildren"))
1899 if (0 == strcmp(bool_attribute, "notUserSelectableStyle"))
1901 if (0 == strcmp(bool_attribute, "selected"))
1903 if (0 == strcmp(bool_attribute, "selectedFromFocus"))
1905 if (0 == strcmp(bool_attribute, "supportsTextLocation"))
1907 if (0 == strcmp(bool_attribute, "isLineBreakingObject"))
1909 if (0 == strcmp(bool_attribute, "isPageBreakingObject"))
1911 if (0 == strcmp(bool_attribute, "hasAriaAttribute"))
1914}
1915
1916const char* ToString(ax::mojom::IntListAttribute int_list_attribute) {
1917 switch (int_list_attribute) {
1919 return "none";
1921 return "indirectChildIds";
1923 return "controlsIds";
1925 return "detailsIds";
1927 return "describedbyIds";
1929 return "flowtoIds";
1931 return "labelledbyIds";
1933 return "radioGroupIds";
1935 return "markerTypes";
1937 return "markerStarts";
1939 return "markerEnds";
1941 return "characterOffsets";
1943 return "cachedLineStarts";
1945 return "wordStarts";
1947 return "wordEnds";
1949 return "customActionIds";
1950 }
1951
1952 return "";
1953}
1954
1956 const char* int_list_attribute) {
1957 if (0 == strcmp(int_list_attribute, "none"))
1959 if (0 == strcmp(int_list_attribute, "indirectChildIds"))
1961 if (0 == strcmp(int_list_attribute, "controlsIds"))
1963 if (0 == strcmp(int_list_attribute, "detailsIds"))
1965 if (0 == strcmp(int_list_attribute, "describedbyIds"))
1967 if (0 == strcmp(int_list_attribute, "flowtoIds"))
1969 if (0 == strcmp(int_list_attribute, "labelledbyIds"))
1971 if (0 == strcmp(int_list_attribute, "radioGroupIds"))
1973 if (0 == strcmp(int_list_attribute, "markerTypes"))
1975 if (0 == strcmp(int_list_attribute, "markerStarts"))
1977 if (0 == strcmp(int_list_attribute, "markerEnds"))
1979 if (0 == strcmp(int_list_attribute, "characterOffsets"))
1981 if (0 == strcmp(int_list_attribute, "cachedLineStarts"))
1983 if (0 == strcmp(int_list_attribute, "wordStarts"))
1985 if (0 == strcmp(int_list_attribute, "wordEnds"))
1987 if (0 == strcmp(int_list_attribute, "customActionIds"))
1990}
1991
1992const char* ToString(ax::mojom::StringListAttribute string_list_attribute) {
1993 switch (string_list_attribute) {
1995 return "none";
1997 return "customActionDescriptions";
1998 }
1999
2000 return "";
2001}
2002
2004 const char* string_list_attribute) {
2005 if (0 == strcmp(string_list_attribute, "none"))
2007 if (0 == strcmp(string_list_attribute, "customActionDescriptions"))
2010}
2011
2012const char* ToString(ax::mojom::ListStyle list_style) {
2013 switch (list_style) {
2015 return "none";
2017 return "circle";
2019 return "disc";
2021 return "image";
2023 return "numeric";
2025 return "other";
2027 return "square";
2028 }
2029
2030 return "";
2031}
2032
2033ax::mojom::ListStyle ParseListStyle(const char* list_style) {
2034 if (0 == strcmp(list_style, "none"))
2036 if (0 == strcmp(list_style, "circle"))
2038 if (0 == strcmp(list_style, "disc"))
2040 if (0 == strcmp(list_style, "image"))
2042 if (0 == strcmp(list_style, "numeric"))
2044 if (0 == strcmp(list_style, "other"))
2046 if (0 == strcmp(list_style, "square"))
2049}
2050
2051const char* ToString(ax::mojom::MarkerType marker_type) {
2052 switch (marker_type) {
2054 return "none";
2056 return "spelling";
2058 return "grammar";
2060 return "textMatch";
2062 return "activeSuggestion";
2064 return "suggestion";
2065 }
2066
2067 return "";
2068}
2069
2070ax::mojom::MarkerType ParseMarkerType(const char* marker_type) {
2071 if (0 == strcmp(marker_type, "none"))
2073 if (0 == strcmp(marker_type, "spelling"))
2075 if (0 == strcmp(marker_type, "grammar"))
2077 if (0 == strcmp(marker_type, "textMatch"))
2079 if (0 == strcmp(marker_type, "activeSuggestion"))
2081 if (0 == strcmp(marker_type, "suggestion"))
2084}
2085
2086const char* ToString(ax::mojom::MoveDirection move_direction) {
2087 switch (move_direction) {
2089 return "forward";
2091 return "backward";
2092 }
2093
2094 return "";
2095}
2096
2098 if (0 == strcmp(move_direction, "forward"))
2100 if (0 == strcmp(move_direction, "backward"))
2103}
2104
2105const char* ToString(ax::mojom::Command command) {
2106 switch (command) {
2108 return "clearSelection";
2110 return "cut";
2112 return "delete";
2114 return "dictate";
2116 return "extendSelection";
2118 return "format";
2120 return "insert";
2122 return "marker";
2124 return "moveSelection";
2126 return "paste";
2128 return "replace";
2130 return "setSelection";
2132 return "type";
2133 }
2134
2135 return "";
2136}
2137
2138ax::mojom::Command ParseCommand(const char* command) {
2139 if (0 == strcmp(command, "clearSelection"))
2141 if (0 == strcmp(command, "cut"))
2143 if (0 == strcmp(command, "delete"))
2145 if (0 == strcmp(command, "dictate"))
2147 if (0 == strcmp(command, "extendSelection"))
2149 if (0 == strcmp(command, "format"))
2151 if (0 == strcmp(command, "insert"))
2153 if (0 == strcmp(command, "marker"))
2155 if (0 == strcmp(command, "moveSelection"))
2157 if (0 == strcmp(command, "paste"))
2159 if (0 == strcmp(command, "replace"))
2161 if (0 == strcmp(command, "setSelection"))
2163 if (0 == strcmp(command, "type"))
2165
2166 // Return the default command.
2168}
2169
2170const char* ToString(ax::mojom::TextBoundary text_boundary) {
2171 switch (text_boundary) {
2173 return "character";
2175 return "format";
2177 return "lineEnd";
2179 return "lineStart";
2181 return "lineStartOrEnd";
2183 return "object";
2185 return "pageEnd";
2187 return "pageStart";
2189 return "pageStartOrEnd";
2191 return "paragraphEnd";
2193 return "paragraphStart";
2195 return "paragraphStartOrEnd";
2197 return "sentenceEnd";
2199 return "sentenceStart";
2201 return "sentenceStartOrEnd";
2203 return "webPage";
2205 return "wordEnd";
2207 return "wordStart";
2209 return "wordStartOrEnd";
2210 }
2211
2212 return "";
2213}
2214
2215ax::mojom::TextBoundary ParseTextBoundary(const char* text_boundary) {
2216 if (0 == strcmp(text_boundary, "object"))
2218 if (0 == strcmp(text_boundary, "character"))
2220 if (0 == strcmp(text_boundary, "format"))
2222 if (0 == strcmp(text_boundary, "lineEnd"))
2224 if (0 == strcmp(text_boundary, "lineStart"))
2226 if (0 == strcmp(text_boundary, "lineStartOrEnd"))
2228 if (0 == strcmp(text_boundary, "pageEnd"))
2230 if (0 == strcmp(text_boundary, "pageStart"))
2232 if (0 == strcmp(text_boundary, "pageStartOrEnd"))
2234 if (0 == strcmp(text_boundary, "paragraphEnd"))
2236 if (0 == strcmp(text_boundary, "paragraphStart"))
2238 if (0 == strcmp(text_boundary, "paragraphStartOrEnd"))
2240 if (0 == strcmp(text_boundary, "sentenceEnd"))
2242 if (0 == strcmp(text_boundary, "sentenceStart"))
2244 if (0 == strcmp(text_boundary, "sentenceStartOrEnd"))
2246 if (0 == strcmp(text_boundary, "webPage"))
2248 if (0 == strcmp(text_boundary, "wordEnd"))
2250 if (0 == strcmp(text_boundary, "wordStart"))
2252 if (0 == strcmp(text_boundary, "wordStartOrEnd"))
2255}
2256
2257const char* ToString(ax::mojom::TextDecorationStyle text_decoration_style) {
2258 switch (text_decoration_style) {
2260 return "none";
2262 return "solid";
2264 return "dashed";
2266 return "dotted";
2268 return "double";
2270 return "wavy";
2271 }
2272
2273 return "";
2274}
2275
2277 const char* text_decoration_style) {
2278 if (0 == strcmp(text_decoration_style, "none"))
2280 if (0 == strcmp(text_decoration_style, "solid"))
2282 if (0 == strcmp(text_decoration_style, "dashed"))
2284 if (0 == strcmp(text_decoration_style, "dotted"))
2286 if (0 == strcmp(text_decoration_style, "double"))
2288 if (0 == strcmp(text_decoration_style, "wavy"))
2291}
2292
2293const char* ToString(ax::mojom::TextAlign text_align) {
2294 switch (text_align) {
2296 return "none";
2298 return "left";
2300 return "right";
2302 return "center";
2304 return "justify";
2305 }
2306
2307 return "";
2308}
2309
2310ax::mojom::TextAlign ParseTextAlign(const char* text_align) {
2311 if (0 == strcmp(text_align, "none"))
2313 if (0 == strcmp(text_align, "left"))
2315 if (0 == strcmp(text_align, "right"))
2317 if (0 == strcmp(text_align, "center"))
2319 if (0 == strcmp(text_align, "justify"))
2322}
2323
2324const char* ToString(ax::mojom::WritingDirection text_direction) {
2325 switch (text_direction) {
2327 return "none";
2329 return "ltr";
2331 return "rtl";
2333 return "ttb";
2335 return "btt";
2336 }
2337
2338 return "";
2339}
2340
2342 if (0 == strcmp(text_direction, "none"))
2344 if (0 == strcmp(text_direction, "ltr"))
2346 if (0 == strcmp(text_direction, "rtl"))
2348 if (0 == strcmp(text_direction, "ttb"))
2350 if (0 == strcmp(text_direction, "btt"))
2353}
2354
2355const char* ToString(ax::mojom::TextPosition text_position) {
2356 switch (text_position) {
2358 return "none";
2360 return "subscript";
2362 return "superscript";
2363 }
2364
2365 return "";
2366}
2367
2368ax::mojom::TextPosition ParseTextPosition(const char* text_position) {
2369 if (0 == strcmp(text_position, "none"))
2371 if (0 == strcmp(text_position, "subscript"))
2373 if (0 == strcmp(text_position, "superscript"))
2376}
2377
2378const char* ToString(ax::mojom::TextStyle text_style) {
2379 switch (text_style) {
2381 return "none";
2383 return "bold";
2385 return "italic";
2387 return "underline";
2389 return "lineThrough";
2391 return "overline";
2392 }
2393
2394 return "";
2395}
2396
2397ax::mojom::TextStyle ParseTextStyle(const char* text_style) {
2398 if (0 == strcmp(text_style, "none"))
2400 if (0 == strcmp(text_style, "bold"))
2402 if (0 == strcmp(text_style, "italic"))
2404 if (0 == strcmp(text_style, "underline"))
2406 if (0 == strcmp(text_style, "lineThrough"))
2408 if (0 == strcmp(text_style, "overline"))
2411}
2412
2413const char* ToString(ax::mojom::AriaCurrentState aria_current_state) {
2414 switch (aria_current_state) {
2416 return "none";
2418 return "false";
2420 return "true";
2422 return "page";
2424 return "step";
2426 return "location";
2428 return "unclippedLocation";
2430 return "date";
2432 return "time";
2433 }
2434
2435 return "";
2436}
2437
2439 const char* aria_current_state) {
2440 if (0 == strcmp(aria_current_state, "none"))
2442 if (0 == strcmp(aria_current_state, "false"))
2444 if (0 == strcmp(aria_current_state, "true"))
2446 if (0 == strcmp(aria_current_state, "page"))
2448 if (0 == strcmp(aria_current_state, "step"))
2450 if (0 == strcmp(aria_current_state, "location"))
2452 if (0 == strcmp(aria_current_state, "unclippedLocation"))
2454 if (0 == strcmp(aria_current_state, "date"))
2456 if (0 == strcmp(aria_current_state, "time"))
2459}
2460
2461const char* ToString(ax::mojom::HasPopup has_popup) {
2462 switch (has_popup) {
2464 return "";
2466 return "true";
2468 return "menu";
2470 return "listbox";
2472 return "tree";
2474 return "grid";
2476 return "dialog";
2477 }
2478
2479 return "";
2480}
2481
2482ax::mojom::HasPopup ParseHasPopup(const char* has_popup) {
2483 if (0 == strcmp(has_popup, "true"))
2485 if (0 == strcmp(has_popup, "menu"))
2487 if (0 == strcmp(has_popup, "listbox"))
2489 if (0 == strcmp(has_popup, "tree"))
2491 if (0 == strcmp(has_popup, "grid"))
2493 if (0 == strcmp(has_popup, "dialog"))
2495
2497}
2498
2499const char* ToString(ax::mojom::InvalidState invalid_state) {
2500 switch (invalid_state) {
2502 return "none";
2504 return "false";
2506 return "true";
2508 return "other";
2509 }
2510
2511 return "";
2512}
2513
2514ax::mojom::InvalidState ParseInvalidState(const char* invalid_state) {
2515 if (0 == strcmp(invalid_state, "none"))
2517 if (0 == strcmp(invalid_state, "false"))
2519 if (0 == strcmp(invalid_state, "true"))
2521 if (0 == strcmp(invalid_state, "other"))
2524}
2525
2526const char* ToString(ax::mojom::Restriction restriction) {
2527 switch (restriction) {
2529 return "none";
2531 return "readOnly";
2533 return "disabled";
2534 }
2535
2536 return "";
2537}
2538
2540 if (0 == strcmp(restriction, "none"))
2542 if (0 == strcmp(restriction, "readOnly"))
2544 if (0 == strcmp(restriction, "disabled"))
2547}
2548
2549const char* ToString(ax::mojom::CheckedState checked_state) {
2550 switch (checked_state) {
2552 return "none";
2554 return "false";
2556 return "true";
2558 return "mixed";
2559 }
2560
2561 return "";
2562}
2563
2564ax::mojom::CheckedState ParseCheckedState(const char* checked_state) {
2565 if (0 == strcmp(checked_state, "none"))
2567 if (0 == strcmp(checked_state, "false"))
2569 if (0 == strcmp(checked_state, "true"))
2571 if (0 == strcmp(checked_state, "mixed"))
2574}
2575
2576const char* ToString(ax::mojom::SortDirection sort_direction) {
2577 switch (sort_direction) {
2579 return "none";
2581 return "unsorted";
2583 return "ascending";
2585 return "descending";
2587 return "other";
2588 }
2589
2590 return "";
2591}
2592
2594 if (0 == strcmp(sort_direction, "none"))
2596 if (0 == strcmp(sort_direction, "unsorted"))
2598 if (0 == strcmp(sort_direction, "ascending"))
2600 if (0 == strcmp(sort_direction, "descending"))
2602 if (0 == strcmp(sort_direction, "other"))
2605}
2606
2607const char* ToString(ax::mojom::NameFrom name_from) {
2608 switch (name_from) {
2610 return "none";
2612 return "uninitialized";
2614 return "attribute";
2616 return "attributeExplicitlyEmpty";
2618 return "caption";
2620 return "contents";
2622 return "placeholder";
2624 return "relatedElement";
2626 return "title";
2628 return "value";
2629 }
2630
2631 return "";
2632}
2633
2634ax::mojom::NameFrom ParseNameFrom(const char* name_from) {
2635 if (0 == strcmp(name_from, "none"))
2637 if (0 == strcmp(name_from, "uninitialized"))
2639 if (0 == strcmp(name_from, "attribute"))
2641 if (0 == strcmp(name_from, "attributeExplicitlyEmpty"))
2643 if (0 == strcmp(name_from, "caption"))
2645 if (0 == strcmp(name_from, "contents"))
2647 if (0 == strcmp(name_from, "placeholder"))
2649 if (0 == strcmp(name_from, "relatedElement"))
2651 if (0 == strcmp(name_from, "title"))
2653 if (0 == strcmp(name_from, "value"))
2656}
2657
2658const char* ToString(ax::mojom::DescriptionFrom description_from) {
2659 switch (description_from) {
2661 return "none";
2663 return "uninitialized";
2665 return "attribute";
2667 return "contents";
2669 return "relatedElement";
2671 return "title";
2672 }
2673
2674 return "";
2675}
2676
2678 if (0 == strcmp(description_from, "none"))
2680 if (0 == strcmp(description_from, "uninitialized"))
2682 if (0 == strcmp(description_from, "attribute"))
2684 if (0 == strcmp(description_from, "contents"))
2686 if (0 == strcmp(description_from, "relatedElement"))
2688 if (0 == strcmp(description_from, "title"))
2691}
2692
2693const char* ToString(ax::mojom::EventFrom event_from) {
2694 switch (event_from) {
2696 return "none";
2698 return "user";
2700 return "page";
2702 return "action";
2703 }
2704
2705 return "";
2706}
2707
2708ax::mojom::EventFrom ParseEventFrom(const char* event_from) {
2709 if (0 == strcmp(event_from, "none"))
2711 if (0 == strcmp(event_from, "user"))
2713 if (0 == strcmp(event_from, "page"))
2715 if (0 == strcmp(event_from, "action"))
2718}
2719
2720const char* ToString(ax::mojom::Gesture gesture) {
2721 switch (gesture) {
2723 return "none";
2725 return "click";
2727 return "swipeLeft1";
2729 return "swipeUp1";
2731 return "swipeRight1";
2733 return "swipeDown1";
2735 return "swipeLeft2";
2737 return "swipeUp2";
2739 return "swipeRight2";
2741 return "swipeDown2";
2743 return "swipeLeft3";
2745 return "swipeUp3";
2747 return "swipeRight3";
2749 return "swipeDown3";
2751 return "swipeLeft4";
2753 return "swipeUp4";
2755 return "swipeRight4";
2757 return "swipeDown4";
2759 return "tap2";
2761 return "tap3";
2763 return "tap4";
2765 return "touchExplore";
2766 }
2767
2768 return "";
2769}
2770
2771ax::mojom::Gesture ParseGesture(const char* gesture) {
2772 if (0 == strcmp(gesture, "none"))
2774 if (0 == strcmp(gesture, "click"))
2776 if (0 == strcmp(gesture, "swipeLeft1"))
2778 if (0 == strcmp(gesture, "swipeUp1"))
2780 if (0 == strcmp(gesture, "swipeRight1"))
2782 if (0 == strcmp(gesture, "swipeDown1"))
2784 if (0 == strcmp(gesture, "swipeLeft2"))
2786 if (0 == strcmp(gesture, "swipeUp2"))
2788 if (0 == strcmp(gesture, "swipeRight2"))
2790 if (0 == strcmp(gesture, "swipeDown2"))
2792 if (0 == strcmp(gesture, "swipeLeft3"))
2794 if (0 == strcmp(gesture, "swipeUp3"))
2796 if (0 == strcmp(gesture, "swipeRight3"))
2798 if (0 == strcmp(gesture, "swipeDown3"))
2800 if (0 == strcmp(gesture, "swipeLeft4"))
2802 if (0 == strcmp(gesture, "swipeUp4"))
2804 if (0 == strcmp(gesture, "swipeRight4"))
2806 if (0 == strcmp(gesture, "swipeDown4"))
2808 if (0 == strcmp(gesture, "tap2"))
2810 if (0 == strcmp(gesture, "tap3"))
2812 if (0 == strcmp(gesture, "tap4"))
2814 if (0 == strcmp(gesture, "touchExplore"))
2817}
2818
2819const char* ToString(ax::mojom::TextAffinity text_affinity) {
2820 switch (text_affinity) {
2822 return "none";
2824 return "downstream";
2826 return "upstream";
2827 }
2828
2829 return "";
2830}
2831
2832ax::mojom::TextAffinity ParseTextAffinity(const char* text_affinity) {
2833 if (0 == strcmp(text_affinity, "none"))
2835 if (0 == strcmp(text_affinity, "downstream"))
2837 if (0 == strcmp(text_affinity, "upstream"))
2840}
2841
2842const char* ToString(ax::mojom::TreeOrder tree_order) {
2843 switch (tree_order) {
2845 return "none";
2847 return "undefined";
2849 return "before";
2851 return "equal";
2853 return "after";
2854 }
2855
2856 return "";
2857}
2858
2859ax::mojom::TreeOrder ParseTreeOrder(const char* tree_order) {
2860 if (0 == strcmp(tree_order, "none"))
2862 if (0 == strcmp(tree_order, "undefined"))
2864 if (0 == strcmp(tree_order, "before"))
2866 if (0 == strcmp(tree_order, "equal"))
2868 if (0 == strcmp(tree_order, "after"))
2871}
2872
2874 switch (status) {
2876 return "none";
2878 return "kWillNotAnnotateDueToScheme";
2880 return "ineligibleForAnnotation";
2882 return "eligibleForAnnotation";
2884 return "silentlyEligibleForAnnotation";
2886 return "annotationPending";
2888 return "annotationSucceeded";
2890 return "annotationEmpty";
2892 return "annotationAdult";
2894 return "annotationProcessFailed";
2895 }
2896
2897 return "";
2898}
2899
2901 const char* status) {
2902 if (0 == strcmp(status, "none"))
2904 if (0 == strcmp(status, "kWillNotAnnotateDueToScheme"))
2906 if (0 == strcmp(status, "ineligibleForAnnotation"))
2908 if (0 == strcmp(status, "eligibleForAnnotation"))
2910 if (0 == strcmp(status, "silentlyEligibleForAnnotation"))
2912 if (0 == strcmp(status, "annotationPending"))
2914 if (0 == strcmp(status, "annotationSucceeded"))
2916 if (0 == strcmp(status, "annotationEmpty"))
2918 if (0 == strcmp(status, "annotationAdult"))
2920 if (0 == strcmp(status, "annotationProcessFailed"))
2922
2924}
2925
2926const char* ToString(ax::mojom::Dropeffect dropeffect) {
2927 switch (dropeffect) {
2929 return "copy";
2931 return "execute";
2933 return "link";
2935 return "move";
2937 return "popup";
2939 return "none";
2940 }
2941
2942 return "";
2943}
2944
2946 if (0 == strcmp(dropeffect, "copy"))
2948 if (0 == strcmp(dropeffect, "execute"))
2950 if (0 == strcmp(dropeffect, "link"))
2952 if (0 == strcmp(dropeffect, "move"))
2954 if (0 == strcmp(dropeffect, "popup"))
2957}
2958
2959} // namespace ui
AtkStateType state
FlKeyEvent * event
StringListAttribute
Definition ax_enums.h:850
@ kSetSequentialFocusNavigationStartingPoint
ImageAnnotationStatus
Definition ax_enums.h:1170
DefaultActionVerb
Definition ax_enums.h:489
TextDecorationStyle
Definition ax_enums.h:995
ax::mojom::IntListAttribute ParseIntListAttribute(const char *int_list_attribute)
ax::mojom::MoveDirection ParseMoveDirection(const char *move_direction)
ax::mojom::Event ParseEvent(const char *event)
ax::mojom::DescriptionFrom ParseDescriptionFrom(const char *description_from)
ax::mojom::FloatAttribute ParseFloatAttribute(const char *float_attribute)
ax::mojom::TextBoundary ParseTextBoundary(const char *text_boundary)
ax::mojom::ListStyle ParseListStyle(const char *list_style)
ax::mojom::TreeOrder ParseTreeOrder(const char *tree_order)
ax::mojom::ActionFlags ParseActionFlags(const char *action_flags)
ax::mojom::TextAlign ParseTextAlign(const char *text_align)
ax::mojom::Action ParseAction(const char *action)
const char * ToString(ax::mojom::Event event)
ax::mojom::Restriction ParseRestriction(const char *restriction)
ax::mojom::StringAttribute ParseStringAttribute(const char *string_attribute)
ax::mojom::Command ParseCommand(const char *command)
ax::mojom::SortDirection ParseSortDirection(const char *sort_direction)
ax::mojom::HasPopup ParseHasPopup(const char *has_popup)
ax::mojom::NameFrom ParseNameFrom(const char *name_from)
ax::mojom::StringListAttribute ParseStringListAttribute(const char *string_list_attribute)
ax::mojom::TextPosition ParseTextPosition(const char *text_position)
ax::mojom::Role ParseRole(const char *role)
ax::mojom::WritingDirection ParseTextDirection(const char *text_direction)
ax::mojom::IntAttribute ParseIntAttribute(const char *int_attribute)
ax::mojom::EventFrom ParseEventFrom(const char *event_from)
ax::mojom::TextAffinity ParseTextAffinity(const char *text_affinity)
ax::mojom::Dropeffect ParseDropeffect(const char *dropeffect)
ax::mojom::BoolAttribute ParseBoolAttribute(const char *bool_attribute)
ax::mojom::DefaultActionVerb ParseDefaultActionVerb(const char *default_action_verb)
ax::mojom::TextDecorationStyle ParseTextDecorationStyle(const char *text_decoration_style)
ax::mojom::AriaCurrentState ParseAriaCurrentState(const char *aria_current_state)
ax::mojom::InvalidState ParseInvalidState(const char *invalid_state)
ax::mojom::MarkerType ParseMarkerType(const char *marker_type)
ax::mojom::ImageAnnotationStatus ParseImageAnnotationStatus(const char *status)
ax::mojom::CheckedState ParseCheckedState(const char *checked_state)
ax::mojom::ScrollAlignment ParseScrollAlignment(const char *scroll_alignment)
ax::mojom::Mutation ParseMutation(const char *mutation)
ax::mojom::Gesture ParseGesture(const char *gesture)
ax::mojom::State ParseState(const char *state)
ax::mojom::TextStyle ParseTextStyle(const char *text_style)