WebViewHints.h 776 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Optional.h>
  8. #include <AK/Types.h>
  9. #include <LibIPC/Forward.h>
  10. #include <LibWeb/Forward.h>
  11. #include <LibWeb/HTML/TokenizedFeatures.h>
  12. #include <LibWeb/PixelUnits.h>
  13. namespace Web::HTML {
  14. struct WebViewHints {
  15. bool popup = false;
  16. Optional<DevicePixels> width;
  17. Optional<DevicePixels> height;
  18. Optional<DevicePixels> screen_x;
  19. Optional<DevicePixels> screen_y;
  20. static WebViewHints from_tokenised_features(TokenizedFeature::Map const&, Page const&);
  21. };
  22. }
  23. namespace IPC {
  24. template<>
  25. ErrorOr<void> encode(Encoder&, Web::HTML::WebViewHints const&);
  26. template<>
  27. ErrorOr<Web::HTML::WebViewHints> decode(Decoder&);
  28. }