SelectItem.h 638 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2023, Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/String.h>
  8. #include <LibIPC/Forward.h>
  9. namespace Web::HTML {
  10. struct SelectItem {
  11. enum class Type {
  12. OptionGroup,
  13. Option,
  14. Separator,
  15. };
  16. Type type;
  17. Optional<String> label = {};
  18. Optional<String> value = {};
  19. Optional<Vector<SelectItem>> items = {};
  20. bool selected = false;
  21. };
  22. }
  23. namespace IPC {
  24. template<>
  25. ErrorOr<void> encode(Encoder&, Web::HTML::SelectItem const&);
  26. template<>
  27. ErrorOr<Web::HTML::SelectItem> decode(Decoder&);
  28. }