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
9const char* ToString(ax::mojom::Event event) {
10 switch (event) {
12 return "none";
14 return "activedescendantchanged";
16 return "alert";
18 return "ariaAttributeChanged";
20 return "autocorrectionOccured";
22 return "blur";
24 return "checkedStateChanged";
26 return "childrenChanged";
28 return "clicked";
30 return "controlsChanged";
32 return "documentSelectionChanged";
34 return "documentTitleChanged";
36 return "endOfTest";
38 return "expandedChanged";
40 return "focus";
42 return "focusAfterMenuClose";
44 return "focusContext";
46 return "hide";
48 return "hitTestResult";
50 return "hover";
52 return "imageFrameUpdated";
54 return "invalidStatusChanged";
56 return "layoutComplete";
58 return "liveRegionCreated";
60 return "liveRegionChanged";
62 return "loadComplete";
64 return "loadStart";
66 return "locationChanged";
68 return "mediaStartedPlaying";
70 return "mediaStoppedPlaying";
72 return "menuEnd";
74 return "menuListItemSelected";
76 return "menuListValueChanged";
78 return "menuPopupEnd";
80 return "menuPopupStart";
82 return "menuStart";
84 return "mouseCanceled";
86 return "mouseDragged";
88 return "mouseMoved";
90 return "mousePressed";
92 return "mouseReleased";
94 return "rowCollapsed";
96 return "rowCountChanged";
98 return "rowExpanded";
100 return "scrollPositionChanged";
102 return "scrolledToAnchor";
104 return "selectedChildrenChanged";
106 return "selection";
108 return "selectionAdd";
110 return "selectionRemove";
112 return "show";
114 return "stateChanged";
116 return "textChanged";
118 return "textSelectionChanged";
120 return "tooltipClosed";
122 return "tooltipOpened";
124 return "windowActivated";
126 return "windowDeactivated";
128 return "windowVisibilityChanged";
130 return "treeChanged";
132 return "valueChanged";
133 }
134
135 return "";
136}
137
138ax::mojom::Event ParseEvent(const char* event) {
139 if (0 == strcmp(event, "none"))
141 if (0 == strcmp(event, "activedescendantchanged"))
143 if (0 == strcmp(event, "alert"))
145 if (0 == strcmp(event, "ariaAttributeChanged"))
147 if (0 == strcmp(event, "autocorrectionOccured"))
149 if (0 == strcmp(event, "blur"))
151 if (0 == strcmp(event, "checkedStateChanged"))
153 if (0 == strcmp(event, "childrenChanged"))
155 if (0 == strcmp(event, "clicked"))
157 if (0 == strcmp(event, "controlsChanged"))
159 if (0 == strcmp(event, "documentSelectionChanged"))
161 if (0 == strcmp(event, "documentTitleChanged"))
163 if (0 == strcmp(event, "endOfTest"))
165 if (0 == strcmp(event, "expandedChanged"))
167 if (0 == strcmp(event, "focus"))
169 if (0 == strcmp(event, "focusAfterMenuClose"))
171 if (0 == strcmp(event, "focusContext"))
173 if (0 == strcmp(event, "hide"))
175 if (0 == strcmp(event, "hitTestResult"))
177 if (0 == strcmp(event, "hover"))
179 if (0 == strcmp(event, "imageFrameUpdated"))
181 if (0 == strcmp(event, "invalidStatusChanged"))
183 if (0 == strcmp(event, "layoutComplete"))
185 if (0 == strcmp(event, "liveRegionCreated"))
187 if (0 == strcmp(event, "liveRegionChanged"))
189 if (0 == strcmp(event, "loadComplete"))
191 if (0 == strcmp(event, "loadStart"))
193 if (0 == strcmp(event, "locationChanged"))
195 if (0 == strcmp(event, "mediaStartedPlaying"))
197 if (0 == strcmp(event, "mediaStoppedPlaying"))
199 if (0 == strcmp(event, "menuEnd"))
201 if (0 == strcmp(event, "menuListItemSelected"))
203 if (0 == strcmp(event, "menuListValueChanged"))
205 if (0 == strcmp(event, "menuPopupEnd"))
207 if (0 == strcmp(event, "menuPopupStart"))
209 if (0 == strcmp(event, "menuStart"))
211 if (0 == strcmp(event, "mouseCanceled"))
213 if (0 == strcmp(event, "mouseDragged"))
215 if (0 == strcmp(event, "mouseMoved"))
217 if (0 == strcmp(event, "mousePressed"))
219 if (0 == strcmp(event, "mouseReleased"))
221 if (0 == strcmp(event, "rowCollapsed"))
223 if (0 == strcmp(event, "rowCountChanged"))
225 if (0 == strcmp(event, "rowExpanded"))
227 if (0 == strcmp(event, "scrollPositionChanged"))
229 if (0 == strcmp(event, "scrolledToAnchor"))
231 if (0 == strcmp(event, "selectedChildrenChanged"))
233 if (0 == strcmp(event, "selection"))
235 if (0 == strcmp(event, "selectionAdd"))
237 if (0 == strcmp(event, "selectionRemove"))
239 if (0 == strcmp(event, "show"))
241 if (0 == strcmp(event, "stateChanged"))
243 if (0 == strcmp(event, "textChanged"))
245 if (0 == strcmp(event, "textSelectionChanged"))
247 if (0 == strcmp(event, "tooltipClosed"))
249 if (0 == strcmp(event, "tooltipOpened"))
251 if (0 == strcmp(event, "windowActivated"))
253 if (0 == strcmp(event, "windowDeactivated"))
255 if (0 == strcmp(event, "windowVisibilityChanged"))
257 if (0 == strcmp(event, "treeChanged"))
259 if (0 == strcmp(event, "valueChanged"))
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
1027const char* ToString(ax::mojom::State state) {
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
1072ax::mojom::State ParseState(const char* state) {
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 "identifier";
1437 return "imageAnnotation";
1439 return "imageDataUrl";
1441 return "innerHtml";
1443 return "inputType";
1445 return "keyShortcuts";
1447 return "language";
1449 return "name";
1451 return "liveRelevant";
1453 return "liveStatus";
1455 return "placeholder";
1457 return "role";
1459 return "roleDescription";
1461 return "tooltip";
1463 return "url";
1465 return "value";
1466 }
1467
1468 return "";
1469}
1470
1472 if (0 == strcmp(string_attribute, "none"))
1474 if (0 == strcmp(string_attribute, "accessKey"))
1476 if (0 == strcmp(string_attribute, "ariaInvalidValue"))
1478 if (0 == strcmp(string_attribute, "autoComplete"))
1480 if (0 == strcmp(string_attribute, "childTreeId"))
1482 if (0 == strcmp(string_attribute, "className"))
1484 if (0 == strcmp(string_attribute, "containerLiveRelevant"))
1486 if (0 == strcmp(string_attribute, "containerLiveStatus"))
1488 if (0 == strcmp(string_attribute, "description"))
1490 if (0 == strcmp(string_attribute, "display"))
1492 if (0 == strcmp(string_attribute, "fontFamily"))
1494 if (0 == strcmp(string_attribute, "htmlTag"))
1496 if (0 == strcmp(string_attribute, "identifier"))
1498 if (0 == strcmp(string_attribute, "imageAnnotation"))
1500 if (0 == strcmp(string_attribute, "imageDataUrl"))
1502 if (0 == strcmp(string_attribute, "innerHtml"))
1504 if (0 == strcmp(string_attribute, "inputType"))
1506 if (0 == strcmp(string_attribute, "keyShortcuts"))
1508 if (0 == strcmp(string_attribute, "language"))
1510 if (0 == strcmp(string_attribute, "name"))
1512 if (0 == strcmp(string_attribute, "liveRelevant"))
1514 if (0 == strcmp(string_attribute, "liveStatus"))
1516 if (0 == strcmp(string_attribute, "placeholder"))
1518 if (0 == strcmp(string_attribute, "role"))
1520 if (0 == strcmp(string_attribute, "roleDescription"))
1522 if (0 == strcmp(string_attribute, "tooltip"))
1524 if (0 == strcmp(string_attribute, "url"))
1526 if (0 == strcmp(string_attribute, "value"))
1529}
1530
1531const char* ToString(ax::mojom::IntAttribute int_attribute) {
1532 switch (int_attribute) {
1534 return "none";
1536 return "defaultActionVerb";
1538 return "dropeffect";
1540 return "scrollX";
1542 return "scrollXMin";
1544 return "scrollXMax";
1546 return "scrollY";
1548 return "scrollYMin";
1550 return "scrollYMax";
1552 return "textSelStart";
1554 return "textSelEnd";
1556 return "ariaColumnCount";
1558 return "ariaCellColumnIndex";
1560 return "ariaCellColumnSpan";
1562 return "ariaRowCount";
1564 return "ariaCellRowIndex";
1566 return "ariaCellRowSpan";
1568 return "tableRowCount";
1570 return "tableColumnCount";
1572 return "tableHeaderId";
1574 return "tableRowIndex";
1576 return "tableRowHeaderId";
1578 return "tableColumnIndex";
1580 return "tableColumnHeaderId";
1582 return "tableCellColumnIndex";
1584 return "tableCellColumnSpan";
1586 return "tableCellRowIndex";
1588 return "tableCellRowSpan";
1590 return "sortDirection";
1592 return "hierarchicalLevel";
1594 return "nameFrom";
1596 return "descriptionFrom";
1598 return "activedescendantId";
1600 return "errormessageId";
1602 return "inPageLinkTargetId";
1604 return "memberOfId";
1606 return "nextOnLineId";
1608 return "popupForId";
1610 return "previousOnLineId";
1612 return "restriction";
1614 return "setSize";
1616 return "posInSet";
1618 return "colorValue";
1620 return "ariaCurrentState";
1622 return "backgroundColor";
1624 return "color";
1626 return "haspopup";
1628 return "invalidState";
1630 return "checkedState";
1632 return "listStyle";
1634 return "text-align";
1636 return "textDirection";
1638 return "textPosition";
1640 return "textStyle";
1642 return "textOverlineStyle";
1644 return "textStrikethroughStyle";
1646 return "textUnderlineStyle";
1648 return "previousFocusId";
1650 return "nextFocusId";
1652 return "imageAnnotationStatus";
1654 return "domNodeId";
1655 }
1656
1657 return "";
1658}
1659
1660ax::mojom::IntAttribute ParseIntAttribute(const char* int_attribute) {
1661 if (0 == strcmp(int_attribute, "none"))
1663 if (0 == strcmp(int_attribute, "defaultActionVerb"))
1665 if (0 == strcmp(int_attribute, "dropeffect"))
1667 if (0 == strcmp(int_attribute, "scrollX"))
1669 if (0 == strcmp(int_attribute, "scrollXMin"))
1671 if (0 == strcmp(int_attribute, "scrollXMax"))
1673 if (0 == strcmp(int_attribute, "scrollY"))
1675 if (0 == strcmp(int_attribute, "scrollYMin"))
1677 if (0 == strcmp(int_attribute, "scrollYMax"))
1679 if (0 == strcmp(int_attribute, "textSelStart"))
1681 if (0 == strcmp(int_attribute, "textSelEnd"))
1683 if (0 == strcmp(int_attribute, "ariaColumnCount"))
1685 if (0 == strcmp(int_attribute, "ariaCellColumnIndex"))
1687 if (0 == strcmp(int_attribute, "ariaCellColumnSpan"))
1689 if (0 == strcmp(int_attribute, "ariaRowCount"))
1691 if (0 == strcmp(int_attribute, "ariaCellRowIndex"))
1693 if (0 == strcmp(int_attribute, "ariaCellRowSpan"))
1695 if (0 == strcmp(int_attribute, "tableRowCount"))
1697 if (0 == strcmp(int_attribute, "tableColumnCount"))
1699 if (0 == strcmp(int_attribute, "tableHeaderId"))
1701 if (0 == strcmp(int_attribute, "tableRowIndex"))
1703 if (0 == strcmp(int_attribute, "tableRowHeaderId"))
1705 if (0 == strcmp(int_attribute, "tableColumnIndex"))
1707 if (0 == strcmp(int_attribute, "tableColumnHeaderId"))
1709 if (0 == strcmp(int_attribute, "tableCellColumnIndex"))
1711 if (0 == strcmp(int_attribute, "tableCellColumnSpan"))
1713 if (0 == strcmp(int_attribute, "tableCellRowIndex"))
1715 if (0 == strcmp(int_attribute, "tableCellRowSpan"))
1717 if (0 == strcmp(int_attribute, "sortDirection"))
1719 if (0 == strcmp(int_attribute, "hierarchicalLevel"))
1721 if (0 == strcmp(int_attribute, "nameFrom"))
1723 if (0 == strcmp(int_attribute, "descriptionFrom"))
1725 if (0 == strcmp(int_attribute, "activedescendantId"))
1727 if (0 == strcmp(int_attribute, "errormessageId"))
1729 if (0 == strcmp(int_attribute, "inPageLinkTargetId"))
1731 if (0 == strcmp(int_attribute, "memberOfId"))
1733 if (0 == strcmp(int_attribute, "nextOnLineId"))
1735 if (0 == strcmp(int_attribute, "popupForId"))
1737 if (0 == strcmp(int_attribute, "previousOnLineId"))
1739 if (0 == strcmp(int_attribute, "restriction"))
1741 if (0 == strcmp(int_attribute, "setSize"))
1743 if (0 == strcmp(int_attribute, "posInSet"))
1745 if (0 == strcmp(int_attribute, "colorValue"))
1747 if (0 == strcmp(int_attribute, "ariaCurrentState"))
1749 if (0 == strcmp(int_attribute, "backgroundColor"))
1751 if (0 == strcmp(int_attribute, "color"))
1753 if (0 == strcmp(int_attribute, "haspopup"))
1755 if (0 == strcmp(int_attribute, "invalidState"))
1757 if (0 == strcmp(int_attribute, "checkedState"))
1759 if (0 == strcmp(int_attribute, "listStyle"))
1761 if (0 == strcmp(int_attribute, "text-align"))
1763 if (0 == strcmp(int_attribute, "textDirection"))
1765 if (0 == strcmp(int_attribute, "textPosition"))
1767 if (0 == strcmp(int_attribute, "textStyle"))
1769 if (0 == strcmp(int_attribute, "textOverlineStyle"))
1771 if (0 == strcmp(int_attribute, "textStrikethroughStyle"))
1773 if (0 == strcmp(int_attribute, "textUnderlineStyle"))
1775 if (0 == strcmp(int_attribute, "previousFocusId"))
1777 if (0 == strcmp(int_attribute, "nextFocusId"))
1779 if (0 == strcmp(int_attribute, "imageAnnotationStatus"))
1781 if (0 == strcmp(int_attribute, "domNodeId"))
1784}
1785
1786const char* ToString(ax::mojom::FloatAttribute float_attribute) {
1787 switch (float_attribute) {
1789 return "none";
1791 return "valueForRange";
1793 return "minValueForRange";
1795 return "maxValueForRange";
1797 return "stepValueForRange";
1799 return "fontSize";
1801 return "fontWeight";
1803 return "textIndent";
1804 }
1805
1806 return "";
1807}
1808
1810 if (0 == strcmp(float_attribute, "none"))
1812 if (0 == strcmp(float_attribute, "valueForRange"))
1814 if (0 == strcmp(float_attribute, "minValueForRange"))
1816 if (0 == strcmp(float_attribute, "maxValueForRange"))
1818 if (0 == strcmp(float_attribute, "stepValueForRange"))
1820 if (0 == strcmp(float_attribute, "fontSize"))
1822 if (0 == strcmp(float_attribute, "fontWeight"))
1824 if (0 == strcmp(float_attribute, "textIndent"))
1827}
1828
1829const char* ToString(ax::mojom::BoolAttribute bool_attribute) {
1830 switch (bool_attribute) {
1832 return "none";
1834 return "busy";
1836 return "editableRoot";
1838 return "containerLiveAtomic";
1840 return "containerLiveBusy";
1842 return "grabbed";
1844 return "liveAtomic";
1846 return "modal";
1848 return "updateLocationOnly";
1850 return "canvasHasFallback";
1852 return "scrollable";
1854 return "clickable";
1856 return "clipsChildren";
1858 return "notUserSelectableStyle";
1860 return "selected";
1862 return "selectedFromFocus";
1864 return "supportsTextLocation";
1866 return "isLineBreakingObject";
1868 return "isPageBreakingObject";
1870 return "hasAriaAttribute";
1871 }
1872
1873 return "";
1874}
1875
1877 if (0 == strcmp(bool_attribute, "none"))
1879 if (0 == strcmp(bool_attribute, "busy"))
1881 if (0 == strcmp(bool_attribute, "editableRoot"))
1883 if (0 == strcmp(bool_attribute, "containerLiveAtomic"))
1885 if (0 == strcmp(bool_attribute, "containerLiveBusy"))
1887 if (0 == strcmp(bool_attribute, "grabbed"))
1889 if (0 == strcmp(bool_attribute, "liveAtomic"))
1891 if (0 == strcmp(bool_attribute, "modal"))
1893 if (0 == strcmp(bool_attribute, "updateLocationOnly"))
1895 if (0 == strcmp(bool_attribute, "canvasHasFallback"))
1897 if (0 == strcmp(bool_attribute, "scrollable"))
1899 if (0 == strcmp(bool_attribute, "clickable"))
1901 if (0 == strcmp(bool_attribute, "clipsChildren"))
1903 if (0 == strcmp(bool_attribute, "notUserSelectableStyle"))
1905 if (0 == strcmp(bool_attribute, "selected"))
1907 if (0 == strcmp(bool_attribute, "selectedFromFocus"))
1909 if (0 == strcmp(bool_attribute, "supportsTextLocation"))
1911 if (0 == strcmp(bool_attribute, "isLineBreakingObject"))
1913 if (0 == strcmp(bool_attribute, "isPageBreakingObject"))
1915 if (0 == strcmp(bool_attribute, "hasAriaAttribute"))
1918}
1919
1920const char* ToString(ax::mojom::IntListAttribute int_list_attribute) {
1921 switch (int_list_attribute) {
1923 return "none";
1925 return "indirectChildIds";
1927 return "controlsIds";
1929 return "detailsIds";
1931 return "describedbyIds";
1933 return "flowtoIds";
1935 return "labelledbyIds";
1937 return "radioGroupIds";
1939 return "markerTypes";
1941 return "markerStarts";
1943 return "markerEnds";
1945 return "characterOffsets";
1947 return "cachedLineStarts";
1949 return "wordStarts";
1951 return "wordEnds";
1953 return "customActionIds";
1954 }
1955
1956 return "";
1957}
1958
1960 const char* int_list_attribute) {
1961 if (0 == strcmp(int_list_attribute, "none"))
1963 if (0 == strcmp(int_list_attribute, "indirectChildIds"))
1965 if (0 == strcmp(int_list_attribute, "controlsIds"))
1967 if (0 == strcmp(int_list_attribute, "detailsIds"))
1969 if (0 == strcmp(int_list_attribute, "describedbyIds"))
1971 if (0 == strcmp(int_list_attribute, "flowtoIds"))
1973 if (0 == strcmp(int_list_attribute, "labelledbyIds"))
1975 if (0 == strcmp(int_list_attribute, "radioGroupIds"))
1977 if (0 == strcmp(int_list_attribute, "markerTypes"))
1979 if (0 == strcmp(int_list_attribute, "markerStarts"))
1981 if (0 == strcmp(int_list_attribute, "markerEnds"))
1983 if (0 == strcmp(int_list_attribute, "characterOffsets"))
1985 if (0 == strcmp(int_list_attribute, "cachedLineStarts"))
1987 if (0 == strcmp(int_list_attribute, "wordStarts"))
1989 if (0 == strcmp(int_list_attribute, "wordEnds"))
1991 if (0 == strcmp(int_list_attribute, "customActionIds"))
1994}
1995
1996const char* ToString(ax::mojom::StringListAttribute string_list_attribute) {
1997 switch (string_list_attribute) {
1999 return "none";
2001 return "customActionDescriptions";
2002 }
2003
2004 return "";
2005}
2006
2008 const char* string_list_attribute) {
2009 if (0 == strcmp(string_list_attribute, "none"))
2011 if (0 == strcmp(string_list_attribute, "customActionDescriptions"))
2014}
2015
2016const char* ToString(ax::mojom::ListStyle list_style) {
2017 switch (list_style) {
2019 return "none";
2021 return "circle";
2023 return "disc";
2025 return "image";
2027 return "numeric";
2029 return "other";
2031 return "square";
2032 }
2033
2034 return "";
2035}
2036
2037ax::mojom::ListStyle ParseListStyle(const char* list_style) {
2038 if (0 == strcmp(list_style, "none"))
2040 if (0 == strcmp(list_style, "circle"))
2042 if (0 == strcmp(list_style, "disc"))
2044 if (0 == strcmp(list_style, "image"))
2046 if (0 == strcmp(list_style, "numeric"))
2048 if (0 == strcmp(list_style, "other"))
2050 if (0 == strcmp(list_style, "square"))
2053}
2054
2055const char* ToString(ax::mojom::MarkerType marker_type) {
2056 switch (marker_type) {
2058 return "none";
2060 return "spelling";
2062 return "grammar";
2064 return "textMatch";
2066 return "activeSuggestion";
2068 return "suggestion";
2069 }
2070
2071 return "";
2072}
2073
2074ax::mojom::MarkerType ParseMarkerType(const char* marker_type) {
2075 if (0 == strcmp(marker_type, "none"))
2077 if (0 == strcmp(marker_type, "spelling"))
2079 if (0 == strcmp(marker_type, "grammar"))
2081 if (0 == strcmp(marker_type, "textMatch"))
2083 if (0 == strcmp(marker_type, "activeSuggestion"))
2085 if (0 == strcmp(marker_type, "suggestion"))
2088}
2089
2090const char* ToString(ax::mojom::MoveDirection move_direction) {
2091 switch (move_direction) {
2093 return "forward";
2095 return "backward";
2096 }
2097
2098 return "";
2099}
2100
2102 if (0 == strcmp(move_direction, "forward"))
2104 if (0 == strcmp(move_direction, "backward"))
2107}
2108
2109const char* ToString(ax::mojom::Command command) {
2110 switch (command) {
2112 return "clearSelection";
2114 return "cut";
2116 return "delete";
2118 return "dictate";
2120 return "extendSelection";
2122 return "format";
2124 return "insert";
2126 return "marker";
2128 return "moveSelection";
2130 return "paste";
2132 return "replace";
2134 return "setSelection";
2136 return "type";
2137 }
2138
2139 return "";
2140}
2141
2142ax::mojom::Command ParseCommand(const char* command) {
2143 if (0 == strcmp(command, "clearSelection"))
2145 if (0 == strcmp(command, "cut"))
2147 if (0 == strcmp(command, "delete"))
2149 if (0 == strcmp(command, "dictate"))
2151 if (0 == strcmp(command, "extendSelection"))
2153 if (0 == strcmp(command, "format"))
2155 if (0 == strcmp(command, "insert"))
2157 if (0 == strcmp(command, "marker"))
2159 if (0 == strcmp(command, "moveSelection"))
2161 if (0 == strcmp(command, "paste"))
2163 if (0 == strcmp(command, "replace"))
2165 if (0 == strcmp(command, "setSelection"))
2167 if (0 == strcmp(command, "type"))
2169
2170 // Return the default command.
2172}
2173
2174const char* ToString(ax::mojom::TextBoundary text_boundary) {
2175 switch (text_boundary) {
2177 return "character";
2179 return "format";
2181 return "lineEnd";
2183 return "lineStart";
2185 return "lineStartOrEnd";
2187 return "object";
2189 return "pageEnd";
2191 return "pageStart";
2193 return "pageStartOrEnd";
2195 return "paragraphEnd";
2197 return "paragraphStart";
2199 return "paragraphStartOrEnd";
2201 return "sentenceEnd";
2203 return "sentenceStart";
2205 return "sentenceStartOrEnd";
2207 return "webPage";
2209 return "wordEnd";
2211 return "wordStart";
2213 return "wordStartOrEnd";
2214 }
2215
2216 return "";
2217}
2218
2219ax::mojom::TextBoundary ParseTextBoundary(const char* text_boundary) {
2220 if (0 == strcmp(text_boundary, "object"))
2222 if (0 == strcmp(text_boundary, "character"))
2224 if (0 == strcmp(text_boundary, "format"))
2226 if (0 == strcmp(text_boundary, "lineEnd"))
2228 if (0 == strcmp(text_boundary, "lineStart"))
2230 if (0 == strcmp(text_boundary, "lineStartOrEnd"))
2232 if (0 == strcmp(text_boundary, "pageEnd"))
2234 if (0 == strcmp(text_boundary, "pageStart"))
2236 if (0 == strcmp(text_boundary, "pageStartOrEnd"))
2238 if (0 == strcmp(text_boundary, "paragraphEnd"))
2240 if (0 == strcmp(text_boundary, "paragraphStart"))
2242 if (0 == strcmp(text_boundary, "paragraphStartOrEnd"))
2244 if (0 == strcmp(text_boundary, "sentenceEnd"))
2246 if (0 == strcmp(text_boundary, "sentenceStart"))
2248 if (0 == strcmp(text_boundary, "sentenceStartOrEnd"))
2250 if (0 == strcmp(text_boundary, "webPage"))
2252 if (0 == strcmp(text_boundary, "wordEnd"))
2254 if (0 == strcmp(text_boundary, "wordStart"))
2256 if (0 == strcmp(text_boundary, "wordStartOrEnd"))
2259}
2260
2261const char* ToString(ax::mojom::TextDecorationStyle text_decoration_style) {
2262 switch (text_decoration_style) {
2264 return "none";
2266 return "solid";
2268 return "dashed";
2270 return "dotted";
2272 return "double";
2274 return "wavy";
2275 }
2276
2277 return "";
2278}
2279
2281 const char* text_decoration_style) {
2282 if (0 == strcmp(text_decoration_style, "none"))
2284 if (0 == strcmp(text_decoration_style, "solid"))
2286 if (0 == strcmp(text_decoration_style, "dashed"))
2288 if (0 == strcmp(text_decoration_style, "dotted"))
2290 if (0 == strcmp(text_decoration_style, "double"))
2292 if (0 == strcmp(text_decoration_style, "wavy"))
2295}
2296
2297const char* ToString(ax::mojom::TextAlign text_align) {
2298 switch (text_align) {
2300 return "none";
2302 return "left";
2304 return "right";
2306 return "center";
2308 return "justify";
2309 }
2310
2311 return "";
2312}
2313
2314ax::mojom::TextAlign ParseTextAlign(const char* text_align) {
2315 if (0 == strcmp(text_align, "none"))
2317 if (0 == strcmp(text_align, "left"))
2319 if (0 == strcmp(text_align, "right"))
2321 if (0 == strcmp(text_align, "center"))
2323 if (0 == strcmp(text_align, "justify"))
2326}
2327
2328const char* ToString(ax::mojom::WritingDirection text_direction) {
2329 switch (text_direction) {
2331 return "none";
2333 return "ltr";
2335 return "rtl";
2337 return "ttb";
2339 return "btt";
2340 }
2341
2342 return "";
2343}
2344
2346 if (0 == strcmp(text_direction, "none"))
2348 if (0 == strcmp(text_direction, "ltr"))
2350 if (0 == strcmp(text_direction, "rtl"))
2352 if (0 == strcmp(text_direction, "ttb"))
2354 if (0 == strcmp(text_direction, "btt"))
2357}
2358
2359const char* ToString(ax::mojom::TextPosition text_position) {
2360 switch (text_position) {
2362 return "none";
2364 return "subscript";
2366 return "superscript";
2367 }
2368
2369 return "";
2370}
2371
2372ax::mojom::TextPosition ParseTextPosition(const char* text_position) {
2373 if (0 == strcmp(text_position, "none"))
2375 if (0 == strcmp(text_position, "subscript"))
2377 if (0 == strcmp(text_position, "superscript"))
2380}
2381
2382const char* ToString(ax::mojom::TextStyle text_style) {
2383 switch (text_style) {
2385 return "none";
2387 return "bold";
2389 return "italic";
2391 return "underline";
2393 return "lineThrough";
2395 return "overline";
2396 }
2397
2398 return "";
2399}
2400
2401ax::mojom::TextStyle ParseTextStyle(const char* text_style) {
2402 if (0 == strcmp(text_style, "none"))
2404 if (0 == strcmp(text_style, "bold"))
2406 if (0 == strcmp(text_style, "italic"))
2408 if (0 == strcmp(text_style, "underline"))
2410 if (0 == strcmp(text_style, "lineThrough"))
2412 if (0 == strcmp(text_style, "overline"))
2415}
2416
2417const char* ToString(ax::mojom::AriaCurrentState aria_current_state) {
2418 switch (aria_current_state) {
2420 return "none";
2422 return "false";
2424 return "true";
2426 return "page";
2428 return "step";
2430 return "location";
2432 return "unclippedLocation";
2434 return "date";
2436 return "time";
2437 }
2438
2439 return "";
2440}
2441
2443 const char* aria_current_state) {
2444 if (0 == strcmp(aria_current_state, "none"))
2446 if (0 == strcmp(aria_current_state, "false"))
2448 if (0 == strcmp(aria_current_state, "true"))
2450 if (0 == strcmp(aria_current_state, "page"))
2452 if (0 == strcmp(aria_current_state, "step"))
2454 if (0 == strcmp(aria_current_state, "location"))
2456 if (0 == strcmp(aria_current_state, "unclippedLocation"))
2458 if (0 == strcmp(aria_current_state, "date"))
2460 if (0 == strcmp(aria_current_state, "time"))
2463}
2464
2465const char* ToString(ax::mojom::HasPopup has_popup) {
2466 switch (has_popup) {
2468 return "";
2470 return "true";
2472 return "menu";
2474 return "listbox";
2476 return "tree";
2478 return "grid";
2480 return "dialog";
2481 }
2482
2483 return "";
2484}
2485
2486ax::mojom::HasPopup ParseHasPopup(const char* has_popup) {
2487 if (0 == strcmp(has_popup, "true"))
2489 if (0 == strcmp(has_popup, "menu"))
2491 if (0 == strcmp(has_popup, "listbox"))
2493 if (0 == strcmp(has_popup, "tree"))
2495 if (0 == strcmp(has_popup, "grid"))
2497 if (0 == strcmp(has_popup, "dialog"))
2499
2501}
2502
2503const char* ToString(ax::mojom::InvalidState invalid_state) {
2504 switch (invalid_state) {
2506 return "none";
2508 return "false";
2510 return "true";
2512 return "other";
2513 }
2514
2515 return "";
2516}
2517
2518ax::mojom::InvalidState ParseInvalidState(const char* invalid_state) {
2519 if (0 == strcmp(invalid_state, "none"))
2521 if (0 == strcmp(invalid_state, "false"))
2523 if (0 == strcmp(invalid_state, "true"))
2525 if (0 == strcmp(invalid_state, "other"))
2528}
2529
2530const char* ToString(ax::mojom::Restriction restriction) {
2531 switch (restriction) {
2533 return "none";
2535 return "readOnly";
2537 return "disabled";
2538 }
2539
2540 return "";
2541}
2542
2544 if (0 == strcmp(restriction, "none"))
2546 if (0 == strcmp(restriction, "readOnly"))
2548 if (0 == strcmp(restriction, "disabled"))
2551}
2552
2553const char* ToString(ax::mojom::CheckedState checked_state) {
2554 switch (checked_state) {
2556 return "none";
2558 return "false";
2560 return "true";
2562 return "mixed";
2563 }
2564
2565 return "";
2566}
2567
2568ax::mojom::CheckedState ParseCheckedState(const char* checked_state) {
2569 if (0 == strcmp(checked_state, "none"))
2571 if (0 == strcmp(checked_state, "false"))
2573 if (0 == strcmp(checked_state, "true"))
2575 if (0 == strcmp(checked_state, "mixed"))
2578}
2579
2580const char* ToString(ax::mojom::SortDirection sort_direction) {
2581 switch (sort_direction) {
2583 return "none";
2585 return "unsorted";
2587 return "ascending";
2589 return "descending";
2591 return "other";
2592 }
2593
2594 return "";
2595}
2596
2598 if (0 == strcmp(sort_direction, "none"))
2600 if (0 == strcmp(sort_direction, "unsorted"))
2602 if (0 == strcmp(sort_direction, "ascending"))
2604 if (0 == strcmp(sort_direction, "descending"))
2606 if (0 == strcmp(sort_direction, "other"))
2609}
2610
2611const char* ToString(ax::mojom::NameFrom name_from) {
2612 switch (name_from) {
2614 return "none";
2616 return "uninitialized";
2618 return "attribute";
2620 return "attributeExplicitlyEmpty";
2622 return "caption";
2624 return "contents";
2626 return "placeholder";
2628 return "relatedElement";
2630 return "title";
2632 return "value";
2633 }
2634
2635 return "";
2636}
2637
2638ax::mojom::NameFrom ParseNameFrom(const char* name_from) {
2639 if (0 == strcmp(name_from, "none"))
2641 if (0 == strcmp(name_from, "uninitialized"))
2643 if (0 == strcmp(name_from, "attribute"))
2645 if (0 == strcmp(name_from, "attributeExplicitlyEmpty"))
2647 if (0 == strcmp(name_from, "caption"))
2649 if (0 == strcmp(name_from, "contents"))
2651 if (0 == strcmp(name_from, "placeholder"))
2653 if (0 == strcmp(name_from, "relatedElement"))
2655 if (0 == strcmp(name_from, "title"))
2657 if (0 == strcmp(name_from, "value"))
2660}
2661
2662const char* ToString(ax::mojom::DescriptionFrom description_from) {
2663 switch (description_from) {
2665 return "none";
2667 return "uninitialized";
2669 return "attribute";
2671 return "contents";
2673 return "relatedElement";
2675 return "title";
2676 }
2677
2678 return "";
2679}
2680
2682 if (0 == strcmp(description_from, "none"))
2684 if (0 == strcmp(description_from, "uninitialized"))
2686 if (0 == strcmp(description_from, "attribute"))
2688 if (0 == strcmp(description_from, "contents"))
2690 if (0 == strcmp(description_from, "relatedElement"))
2692 if (0 == strcmp(description_from, "title"))
2695}
2696
2697const char* ToString(ax::mojom::EventFrom event_from) {
2698 switch (event_from) {
2700 return "none";
2702 return "user";
2704 return "page";
2706 return "action";
2707 }
2708
2709 return "";
2710}
2711
2712ax::mojom::EventFrom ParseEventFrom(const char* event_from) {
2713 if (0 == strcmp(event_from, "none"))
2715 if (0 == strcmp(event_from, "user"))
2717 if (0 == strcmp(event_from, "page"))
2719 if (0 == strcmp(event_from, "action"))
2722}
2723
2724const char* ToString(ax::mojom::Gesture gesture) {
2725 switch (gesture) {
2727 return "none";
2729 return "click";
2731 return "swipeLeft1";
2733 return "swipeUp1";
2735 return "swipeRight1";
2737 return "swipeDown1";
2739 return "swipeLeft2";
2741 return "swipeUp2";
2743 return "swipeRight2";
2745 return "swipeDown2";
2747 return "swipeLeft3";
2749 return "swipeUp3";
2751 return "swipeRight3";
2753 return "swipeDown3";
2755 return "swipeLeft4";
2757 return "swipeUp4";
2759 return "swipeRight4";
2761 return "swipeDown4";
2763 return "tap2";
2765 return "tap3";
2767 return "tap4";
2769 return "touchExplore";
2770 }
2771
2772 return "";
2773}
2774
2775ax::mojom::Gesture ParseGesture(const char* gesture) {
2776 if (0 == strcmp(gesture, "none"))
2778 if (0 == strcmp(gesture, "click"))
2780 if (0 == strcmp(gesture, "swipeLeft1"))
2782 if (0 == strcmp(gesture, "swipeUp1"))
2784 if (0 == strcmp(gesture, "swipeRight1"))
2786 if (0 == strcmp(gesture, "swipeDown1"))
2788 if (0 == strcmp(gesture, "swipeLeft2"))
2790 if (0 == strcmp(gesture, "swipeUp2"))
2792 if (0 == strcmp(gesture, "swipeRight2"))
2794 if (0 == strcmp(gesture, "swipeDown2"))
2796 if (0 == strcmp(gesture, "swipeLeft3"))
2798 if (0 == strcmp(gesture, "swipeUp3"))
2800 if (0 == strcmp(gesture, "swipeRight3"))
2802 if (0 == strcmp(gesture, "swipeDown3"))
2804 if (0 == strcmp(gesture, "swipeLeft4"))
2806 if (0 == strcmp(gesture, "swipeUp4"))
2808 if (0 == strcmp(gesture, "swipeRight4"))
2810 if (0 == strcmp(gesture, "swipeDown4"))
2812 if (0 == strcmp(gesture, "tap2"))
2814 if (0 == strcmp(gesture, "tap3"))
2816 if (0 == strcmp(gesture, "tap4"))
2818 if (0 == strcmp(gesture, "touchExplore"))
2821}
2822
2823const char* ToString(ax::mojom::TextAffinity text_affinity) {
2824 switch (text_affinity) {
2826 return "none";
2828 return "downstream";
2830 return "upstream";
2831 }
2832
2833 return "";
2834}
2835
2836ax::mojom::TextAffinity ParseTextAffinity(const char* text_affinity) {
2837 if (0 == strcmp(text_affinity, "none"))
2839 if (0 == strcmp(text_affinity, "downstream"))
2841 if (0 == strcmp(text_affinity, "upstream"))
2844}
2845
2846const char* ToString(ax::mojom::TreeOrder tree_order) {
2847 switch (tree_order) {
2849 return "none";
2851 return "undefined";
2853 return "before";
2855 return "equal";
2857 return "after";
2858 }
2859
2860 return "";
2861}
2862
2863ax::mojom::TreeOrder ParseTreeOrder(const char* tree_order) {
2864 if (0 == strcmp(tree_order, "none"))
2866 if (0 == strcmp(tree_order, "undefined"))
2868 if (0 == strcmp(tree_order, "before"))
2870 if (0 == strcmp(tree_order, "equal"))
2872 if (0 == strcmp(tree_order, "after"))
2875}
2876
2878 switch (status) {
2880 return "none";
2882 return "kWillNotAnnotateDueToScheme";
2884 return "ineligibleForAnnotation";
2886 return "eligibleForAnnotation";
2888 return "silentlyEligibleForAnnotation";
2890 return "annotationPending";
2892 return "annotationSucceeded";
2894 return "annotationEmpty";
2896 return "annotationAdult";
2898 return "annotationProcessFailed";
2899 }
2900
2901 return "";
2902}
2903
2905 const char* status) {
2906 if (0 == strcmp(status, "none"))
2908 if (0 == strcmp(status, "kWillNotAnnotateDueToScheme"))
2910 if (0 == strcmp(status, "ineligibleForAnnotation"))
2912 if (0 == strcmp(status, "eligibleForAnnotation"))
2914 if (0 == strcmp(status, "silentlyEligibleForAnnotation"))
2916 if (0 == strcmp(status, "annotationPending"))
2918 if (0 == strcmp(status, "annotationSucceeded"))
2920 if (0 == strcmp(status, "annotationEmpty"))
2922 if (0 == strcmp(status, "annotationAdult"))
2924 if (0 == strcmp(status, "annotationProcessFailed"))
2926
2928}
2929
2930const char* ToString(ax::mojom::Dropeffect dropeffect) {
2931 switch (dropeffect) {
2933 return "copy";
2935 return "execute";
2937 return "link";
2939 return "move";
2941 return "popup";
2943 return "none";
2944 }
2945
2946 return "";
2947}
2948
2950 if (0 == strcmp(dropeffect, "copy"))
2952 if (0 == strcmp(dropeffect, "execute"))
2954 if (0 == strcmp(dropeffect, "link"))
2956 if (0 == strcmp(dropeffect, "move"))
2958 if (0 == strcmp(dropeffect, "popup"))
2961}
2962
2963} // namespace ui
StringListAttribute
Definition ax_enums.h:851
@ kSetSequentialFocusNavigationStartingPoint
ImageAnnotationStatus
Definition ax_enums.h:1171
DefaultActionVerb
Definition ax_enums.h:489
TextDecorationStyle
Definition ax_enums.h:996
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)