Internals.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Bindings/PlatformObject.h>
  8. #include <LibWeb/Internals/InternalAnimationTimeline.h>
  9. #include <LibWeb/UIEvents/MouseButton.h>
  10. namespace Web::Internals {
  11. class Internals final : public Bindings::PlatformObject {
  12. WEB_PLATFORM_OBJECT(Internals, Bindings::PlatformObject);
  13. JS_DECLARE_ALLOCATOR(Internals);
  14. public:
  15. virtual ~Internals() override;
  16. void signal_text_test_is_done();
  17. void gc();
  18. JS::Object* hit_test(double x, double y);
  19. void send_text(HTML::HTMLElement&, String const&);
  20. void commit_text();
  21. void click(double x, double y);
  22. void middle_click(double x, double y);
  23. void move_pointer_to(double x, double y);
  24. void wheel(double x, double y, double delta_x, double delta_y);
  25. WebIDL::ExceptionOr<bool> dispatch_user_activated_event(DOM::EventTarget&, DOM::Event& event);
  26. JS::NonnullGCPtr<InternalAnimationTimeline> create_internal_animation_timeline();
  27. void simulate_drag_start(double x, double y, String const& name, String const& contents);
  28. void simulate_drag_move(double x, double y);
  29. void simulate_drop(double x, double y);
  30. private:
  31. explicit Internals(JS::Realm&);
  32. virtual void initialize(JS::Realm&) override;
  33. void click(double x, double y, UIEvents::MouseButton);
  34. };
  35. }