InputState.h 821 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/HashMap.h>
  8. #include <AK/String.h>
  9. #include <AK/Vector.h>
  10. #include <LibWeb/Forward.h>
  11. #include <LibWeb/WebDriver/InputSource.h>
  12. namespace Web::WebDriver {
  13. // https://w3c.github.io/webdriver/#dfn-input-state
  14. struct InputState {
  15. InputState();
  16. ~InputState();
  17. // https://w3c.github.io/webdriver/#dfn-input-state-map
  18. HashMap<String, InputSource> input_state_map;
  19. // https://w3c.github.io/webdriver/#dfn-input-cancel-list
  20. Vector<ActionObject> input_cancel_list;
  21. // https://w3c.github.io/webdriver/#dfn-actions-queue
  22. Vector<String> actions_queue;
  23. };
  24. InputState& get_input_state(HTML::BrowsingContext&);
  25. void reset_input_state(HTML::BrowsingContext&);
  26. }