2023-07-21 11:59:49 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2024-03-27 15:30:54 +00:00
|
|
|
#include <LibWeb/Internals/InternalAnimationTimeline.h>
|
2024-06-21 22:35:12 +01:00
|
|
|
#include <LibWeb/UIEvents/MouseButton.h>
|
2023-07-21 11:59:49 +02:00
|
|
|
|
|
|
|
|
namespace Web::Internals {
|
|
|
|
|
|
|
|
|
|
class Internals final : public Bindings::PlatformObject {
|
|
|
|
|
WEB_PLATFORM_OBJECT(Internals, Bindings::PlatformObject);
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DECLARE_ALLOCATOR(Internals);
|
2023-07-21 11:59:49 +02:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual ~Internals() override;
|
|
|
|
|
|
2023-09-14 19:17:32 +02:00
|
|
|
void signal_text_test_is_done();
|
|
|
|
|
|
2023-07-21 11:59:49 +02:00
|
|
|
void gc();
|
2023-08-08 22:44:52 +02:00
|
|
|
JS::Object* hit_test(double x, double y);
|
2023-07-21 11:59:49 +02:00
|
|
|
|
2023-11-30 12:54:30 -05:00
|
|
|
void send_text(HTML::HTMLElement&, String const&);
|
2024-08-19 22:49:52 -04:00
|
|
|
void send_key(HTML::HTMLElement&, String const&);
|
2023-11-30 12:54:30 -05:00
|
|
|
void commit_text();
|
|
|
|
|
|
2023-12-03 09:54:26 -05:00
|
|
|
void click(double x, double y);
|
2024-06-21 22:35:12 +01:00
|
|
|
void middle_click(double x, double y);
|
2024-03-24 22:07:02 +01:00
|
|
|
void move_pointer_to(double x, double y);
|
2024-02-09 18:14:53 +01:00
|
|
|
void wheel(double x, double y, double delta_x, double delta_y);
|
2023-12-03 09:54:26 -05:00
|
|
|
|
2024-02-24 16:28:53 -05:00
|
|
|
WebIDL::ExceptionOr<bool> dispatch_user_activated_event(DOM::EventTarget&, DOM::Event& event);
|
2023-11-10 16:19:37 -05:00
|
|
|
|
2024-09-14 21:16:46 -06:00
|
|
|
void spoof_current_url(String const& url);
|
|
|
|
|
|
2024-03-27 15:30:54 +00:00
|
|
|
JS::NonnullGCPtr<InternalAnimationTimeline> create_internal_animation_timeline();
|
|
|
|
|
|
2024-08-17 13:29:55 -04:00
|
|
|
void simulate_drag_start(double x, double y, String const& name, String const& contents);
|
|
|
|
|
void simulate_drag_move(double x, double y);
|
|
|
|
|
void simulate_drop(double x, double y);
|
|
|
|
|
|
2023-07-21 11:59:49 +02:00
|
|
|
private:
|
|
|
|
|
explicit Internals(JS::Realm&);
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2024-06-21 22:35:12 +01:00
|
|
|
|
|
|
|
|
void click(double x, double y, UIEvents::MouseButton);
|
2024-09-04 19:22:48 -06:00
|
|
|
|
|
|
|
|
HTML::Window& internals_window() const;
|
|
|
|
|
Page& internals_page() const;
|
2023-07-21 11:59:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|