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 #ifndef UI_ACCESSIBILITY_AX_ENUM_UTIL_H_ 6 #define UI_ACCESSIBILITY_AX_ENUM_UTIL_H_ 7 8 #include "ui/accessibility/ax_base_export.h" 9 #include "ui/accessibility/ax_enums.mojom-forward.h" 10 11 namespace ui { 12 13 // ax::mojom::Event 14 AX_BASE_EXPORT const char* ToString(ax::mojom::Event event); 15 AX_BASE_EXPORT ax::mojom::Event ParseEvent(const char* event); 16 17 // ax::mojom::Role 18 AX_BASE_EXPORT const char* ToString(ax::mojom::Role role); 19 AX_BASE_EXPORT ax::mojom::Role ParseRole(const char* role); 20 21 // ax::mojom::State 22 AX_BASE_EXPORT const char* ToString(ax::mojom::State state); 23 AX_BASE_EXPORT ax::mojom::State ParseState(const char* state); 24 25 // ax::mojom::Action 26 AX_BASE_EXPORT const char* ToString(ax::mojom::Action action); 27 AX_BASE_EXPORT ax::mojom::Action ParseAction(const char* action); 28 29 // ax::mojom::ActionFlags 30 AX_BASE_EXPORT const char* ToString(ax::mojom::ActionFlags action_flags); 31 AX_BASE_EXPORT ax::mojom::ActionFlags ParseActionFlags( 32 const char* action_flags); 33 34 // ax::mojom::DefaultActionVerb 35 AX_BASE_EXPORT const char* ToString( 36 ax::mojom::DefaultActionVerb default_action_verb); 37 AX_BASE_EXPORT ax::mojom::DefaultActionVerb ParseDefaultActionVerb( 38 const char* default_action_verb); 39 40 // ax::mojom::Mutation 41 AX_BASE_EXPORT const char* ToString(ax::mojom::Mutation mutation); 42 AX_BASE_EXPORT ax::mojom::Mutation ParseMutation(const char* mutation); 43 44 // ax::mojom::StringAttribute 45 AX_BASE_EXPORT const char* ToString( 46 ax::mojom::StringAttribute string_attribute); 47 AX_BASE_EXPORT ax::mojom::StringAttribute ParseStringAttribute( 48 const char* string_attribute); 49 50 // ax::mojom::IntAttribute 51 AX_BASE_EXPORT const char* ToString(ax::mojom::IntAttribute int_attribute); 52 AX_BASE_EXPORT ax::mojom::IntAttribute ParseIntAttribute( 53 const char* int_attribute); 54 55 // ax::mojom::FloatAttribute 56 AX_BASE_EXPORT const char* ToString(ax::mojom::FloatAttribute float_attribute); 57 AX_BASE_EXPORT ax::mojom::FloatAttribute ParseFloatAttribute( 58 const char* float_attribute); 59 60 // ax::mojom::BoolAttribute 61 AX_BASE_EXPORT const char* ToString(ax::mojom::BoolAttribute bool_attribute); 62 AX_BASE_EXPORT ax::mojom::BoolAttribute ParseBoolAttribute( 63 const char* bool_attribute); 64 65 // ax::mojom::IntListAttribute 66 AX_BASE_EXPORT const char* ToString( 67 ax::mojom::IntListAttribute int_list_attribute); 68 AX_BASE_EXPORT ax::mojom::IntListAttribute ParseIntListAttribute( 69 const char* int_list_attribute); 70 71 // ax::mojom::StringListAttribute 72 AX_BASE_EXPORT const char* ToString( 73 ax::mojom::StringListAttribute string_list_attribute); 74 AX_BASE_EXPORT ax::mojom::StringListAttribute ParseStringListAttribute( 75 const char* string_list_attribute); 76 77 // ax::mojom::ListStyle 78 AX_BASE_EXPORT const char* ToString(ax::mojom::ListStyle list_style); 79 AX_BASE_EXPORT ax::mojom::ListStyle ParseListStyle(const char* list_style); 80 81 // ax::mojom::MarkerType 82 AX_BASE_EXPORT const char* ToString(ax::mojom::MarkerType marker_type); 83 AX_BASE_EXPORT ax::mojom::MarkerType ParseMarkerType(const char* marker_type); 84 85 // ax::mojom::MoveDirection 86 AX_BASE_EXPORT const char* ToString(ax::mojom::MoveDirection move_direction); 87 AX_BASE_EXPORT ax::mojom::MoveDirection ParseMoveDirection( 88 const char* move_direction); 89 90 // ax::mojom::EditCommand 91 AX_BASE_EXPORT const char* ToString(ax::mojom::EditCommand edit_command); 92 AX_BASE_EXPORT ax::mojom::EditCommand ParseEditCommand( 93 const char* edit_command); 94 95 // ax::mojom::SelectionCommand 96 AX_BASE_EXPORT const char* ToString( 97 ax::mojom::SelectionCommand selection_command); 98 AX_BASE_EXPORT ax::mojom::SelectionCommand ParseSelectionCommand( 99 const char* selection_command); 100 101 // ax::mojom::TextBoundary 102 AX_BASE_EXPORT const char* ToString(ax::mojom::TextBoundary text_boundary); 103 AX_BASE_EXPORT ax::mojom::TextBoundary ParseTextBoundary( 104 const char* text_boundary); 105 106 // ax:mojom::TextDecorationStyle 107 AX_BASE_EXPORT const char* ToString( 108 ax::mojom::TextDecorationStyle text_decoration_style); 109 AX_BASE_EXPORT ax::mojom::TextDecorationStyle ParseTextDecorationStyle( 110 const char* text_decoration_style); 111 112 // ax::mojom::TextDirection 113 AX_BASE_EXPORT const char* ToString(ax::mojom::TextDirection text_direction); 114 AX_BASE_EXPORT ax::mojom::TextDirection ParseTextDirection( 115 const char* text_direction); 116 117 // ax::mojom::TextPosition 118 AX_BASE_EXPORT const char* ToString(ax::mojom::TextPosition text_position); 119 AX_BASE_EXPORT ax::mojom::TextPosition ParseTextPosition( 120 const char* text_position); 121 122 // ax::mojom::TextStyle 123 AX_BASE_EXPORT const char* ToString(ax::mojom::TextStyle text_style); 124 AX_BASE_EXPORT ax::mojom::TextStyle ParseTextStyle(const char* text_style); 125 126 // ax::mojom::AriaCurrentState 127 AX_BASE_EXPORT const char* ToString( 128 ax::mojom::AriaCurrentState aria_current_state); 129 AX_BASE_EXPORT ax::mojom::AriaCurrentState ParseAriaCurrentState( 130 const char* aria_current_state); 131 132 // ax::mojom::HasPopup 133 AX_BASE_EXPORT const char* ToString(ax::mojom::HasPopup has_popup); 134 AX_BASE_EXPORT ax::mojom::HasPopup ParseHasPopup(const char* has_popup); 135 136 // ax::mojom::InvalidState 137 AX_BASE_EXPORT const char* ToString(ax::mojom::InvalidState invalid_state); 138 AX_BASE_EXPORT ax::mojom::InvalidState ParseInvalidState( 139 const char* invalid_state); 140 141 // ax::mojom::Restriction 142 AX_BASE_EXPORT const char* ToString(ax::mojom::Restriction restriction); 143 AX_BASE_EXPORT ax::mojom::Restriction ParseRestriction(const char* restriction); 144 145 // ax::mojom::CheckedState 146 AX_BASE_EXPORT const char* ToString(ax::mojom::CheckedState checked_state); 147 AX_BASE_EXPORT ax::mojom::CheckedState ParseCheckedState( 148 const char* checked_state); 149 150 // ax::mojom::SortDirection 151 AX_BASE_EXPORT const char* ToString(ax::mojom::SortDirection sort_direction); 152 AX_BASE_EXPORT ax::mojom::SortDirection ParseSortDirection( 153 const char* sort_direction); 154 155 // ax::mojom::NameFrom 156 AX_BASE_EXPORT const char* ToString(ax::mojom::NameFrom name_from); 157 AX_BASE_EXPORT ax::mojom::NameFrom ParseNameFrom(const char* name_from); 158 159 // ax::mojom::DescriptionFrom 160 AX_BASE_EXPORT const char* ToString( 161 ax::mojom::DescriptionFrom description_from); 162 AX_BASE_EXPORT ax::mojom::DescriptionFrom ParseDescriptionFrom( 163 const char* description_from); 164 165 // ax::mojom::EventFrom 166 AX_BASE_EXPORT const char* ToString(ax::mojom::EventFrom event_from); 167 AX_BASE_EXPORT ax::mojom::EventFrom ParseEventFrom(const char* event_from); 168 169 // ax::mojom::Gesture 170 AX_BASE_EXPORT const char* ToString(ax::mojom::Gesture gesture); 171 AX_BASE_EXPORT ax::mojom::Gesture ParseGesture(const char* gesture); 172 173 // ax::mojom::TextAffinity 174 AX_BASE_EXPORT const char* ToString(ax::mojom::TextAffinity text_affinity); 175 AX_BASE_EXPORT ax::mojom::TextAffinity ParseTextAffinity( 176 const char* text_affinity); 177 178 // ax::mojom::TreeOrder 179 AX_BASE_EXPORT const char* ToString(ax::mojom::TreeOrder tree_order); 180 AX_BASE_EXPORT ax::mojom::TreeOrder ParseTreeOrder(const char* tree_order); 181 182 // ax::mojom::ImageAnnotationStatus 183 AX_BASE_EXPORT const char* ToString(ax::mojom::ImageAnnotationStatus status); 184 AX_BASE_EXPORT ax::mojom::ImageAnnotationStatus ParseImageAnnotationStatus( 185 const char* status); 186 187 // ax::mojom::Dropeffect 188 AX_BASE_EXPORT const char* ToString(ax::mojom::Dropeffect dropeffect); 189 AX_BASE_EXPORT ax::mojom::Dropeffect ParseDropeffect(const char* dropeffect); 190 191 } // namespace ui 192 193 #endif // UI_ACCESSIBILITY_AX_ENUM_UTIL_H_ 194