#ifndef UI_ACCESSIBILITY_AX_ENUM_UTIL_H_
#define UI_ACCESSIBILITY_AX_ENUM_UTIL_H_
#include <optional>
#include <string>
#include "base/containers/flat_map.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/types/cxx23_to_underlying.h"
#include "ui/accessibility/ax_base_export.h"
#include "ui/accessibility/ax_enums.mojom-forward.h"
namespace ui {
AX_BASE_EXPORT const char* ToString(ax::mojom::Event event);
AX_BASE_EXPORT const char* ToString(ax::mojom::Role role);
AX_BASE_EXPORT ax::mojom::Role StringToRole(const std::string& role);
AX_BASE_EXPORT const char* ToString(ax::mojom::State state);
AX_BASE_EXPORT ax::mojom::State StringToState(const std::string& state);
AX_BASE_EXPORT const char* ToString(ax::mojom::Action action);
AX_BASE_EXPORT const char* ToString(ax::mojom::ActionFlags action_flags);
AX_BASE_EXPORT const char* ToString(
ax::mojom::DefaultActionVerb default_action_verb);
AX_BASE_EXPORT const char* ToString(ax::mojom::Mutation mutation);
AX_BASE_EXPORT const char* ToString(
ax::mojom::StringAttribute string_attribute);
AX_BASE_EXPORT ax::mojom::StringAttribute StringToStringAttribute(
const std::string& string_attribute);
AX_BASE_EXPORT const char* ToString(ax::mojom::IntAttribute int_attribute);
AX_BASE_EXPORT ax::mojom::IntAttribute StringToIntAttribute(
const std::string& int_attribute);
AX_BASE_EXPORT const char* ToString(ax::mojom::FloatAttribute float_attribute);
AX_BASE_EXPORT const char* ToString(ax::mojom::BoolAttribute bool_attribute);
AX_BASE_EXPORT ax::mojom::BoolAttribute StringToBoolAttribute(
const std::string& bool_attribute);
AX_BASE_EXPORT const char* ToString(
ax::mojom::IntListAttribute int_list_attribute);
AX_BASE_EXPORT const char* ToString(
ax::mojom::StringListAttribute string_list_attribute);
AX_BASE_EXPORT const char* ToString(ax::mojom::ListStyle list_style);
AX_BASE_EXPORT const char* ToString(ax::mojom::MarkerType marker_type);
AX_BASE_EXPORT const char* ToString(ax::mojom::HighlightType highlight_type);
AX_BASE_EXPORT const char* ToString(ax::mojom::MoveDirection move_direction);
AX_BASE_EXPORT const char* ToString(ax::mojom::Command command);
AX_BASE_EXPORT const char* ToString(ax::mojom::InputEventType input_event_type);
AX_BASE_EXPORT const char* ToString(ax::mojom::TextBoundary text_boundary);
AX_BASE_EXPORT const char* ToString(ax::mojom::TextAlign text_align);
AX_BASE_EXPORT const char* ToString(
ax::mojom::WritingDirection writing_direction);
AX_BASE_EXPORT const char* ToString(ax::mojom::TextPosition text_position);
AX_BASE_EXPORT const char* ToString(ax::mojom::TextStyle text_style);
AX_BASE_EXPORT const char* ToString(
ax::mojom::TextDecorationStyle text_decoration_style);
AX_BASE_EXPORT const char* ToString(
ax::mojom::AriaCurrentState aria_current_state);
AX_BASE_EXPORT const char* ToString(ax::mojom::HasPopup has_popup);
AX_BASE_EXPORT const char* ToString(ax::mojom::IsPopup is_popup);
AX_BASE_EXPORT const char* ToString(ax::mojom::InvalidState invalid_state);
AX_BASE_EXPORT const char* ToString(ax::mojom::Restriction restriction);
AX_BASE_EXPORT const char* ToString(ax::mojom::CheckedState checked_state);
AX_BASE_EXPORT const char* ToString(ax::mojom::SortDirection sort_direction);
AX_BASE_EXPORT const char* ToString(ax::mojom::NameFrom name_from);
AX_BASE_EXPORT const char* ToString(
ax::mojom::DescriptionFrom description_from);
AX_BASE_EXPORT const char* ToString(ax::mojom::EventFrom event_from);
AX_BASE_EXPORT const char* ToString(ax::mojom::Gesture gesture);
AX_BASE_EXPORT const char* ToString(ax::mojom::TextAffinity text_affinity);
AX_BASE_EXPORT const char* ToString(ax::mojom::TreeOrder tree_order);
AX_BASE_EXPORT const char* ToString(ax::mojom::ImageAnnotationStatus status);
AX_BASE_EXPORT const char* ToString(
ax::mojom::AriaNotificationInterrupt interrupt);
AX_BASE_EXPORT const char* ToString(
ax::mojom::AriaNotificationPriority priority);
template <typename T>
std::optional<T> MaybeParseAXEnum(const char* attribute) { … }
template <typename T>
T ParseAXEnum(const char* attribute) { … }
}
#endif