NavigationType.h 728 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/String.h>
  8. // FIXME: Generate this from the IDL file that just has an enum in it
  9. namespace Web::Bindings {
  10. enum class NavigationType {
  11. Push,
  12. Replace,
  13. Reload,
  14. Traverse,
  15. };
  16. inline String idl_enum_to_string(NavigationType value)
  17. {
  18. switch (value) {
  19. case NavigationType::Push:
  20. return "Push"_string;
  21. case NavigationType::Replace:
  22. return "Replace"_string;
  23. case NavigationType::Reload:
  24. return "Reload"_string;
  25. case NavigationType::Traverse:
  26. return "Traverse"_string;
  27. default:
  28. return "<unknown>"_string;
  29. }
  30. }
  31. }