2020-07-06 21:18:16 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-06 21:18:16 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Function.h>
|
2021-10-02 21:56:05 +02:00
|
|
|
#include <AK/URL.h>
|
2020-07-06 21:18:16 +02:00
|
|
|
#include <LibGfx/Forward.h>
|
|
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
|
|
|
|
|
namespace Web {
|
|
|
|
|
|
|
|
|
|
class WebViewHooks {
|
|
|
|
|
public:
|
|
|
|
|
Function<void(const Gfx::IntPoint& screen_position)> on_context_menu_request;
|
2021-09-13 00:33:23 +03:00
|
|
|
Function<void(const AK::URL&, const String& target, unsigned modifiers)> on_link_click;
|
|
|
|
|
Function<void(const AK::URL&, const Gfx::IntPoint& screen_position)> on_link_context_menu_request;
|
|
|
|
|
Function<void(const AK::URL&, const Gfx::IntPoint& screen_position, const Gfx::ShareableBitmap&)> on_image_context_menu_request;
|
|
|
|
|
Function<void(const AK::URL&, const String& target, unsigned modifiers)> on_link_middle_click;
|
|
|
|
|
Function<void(const AK::URL&)> on_link_hover;
|
2020-07-06 21:18:16 +02:00
|
|
|
Function<void(const String&)> on_title_change;
|
2021-09-13 00:33:23 +03:00
|
|
|
Function<void(const AK::URL&)> on_load_start;
|
|
|
|
|
Function<void(const AK::URL&)> on_load_finish;
|
2020-07-06 21:18:16 +02:00
|
|
|
Function<void(const Gfx::Bitmap&)> on_favicon_change;
|
2021-09-13 00:33:23 +03:00
|
|
|
Function<void(const AK::URL&)> on_url_drop;
|
2020-07-26 19:37:56 +02:00
|
|
|
Function<void(DOM::Document*)> on_set_document;
|
2021-09-13 00:33:23 +03:00
|
|
|
Function<void(const AK::URL&, const String&)> on_get_source;
|
2021-06-07 16:35:10 +01:00
|
|
|
Function<void(const String&)> on_get_dom_tree;
|
2022-02-27 01:38:12 +01:00
|
|
|
Function<void(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing)> on_get_dom_node_properties;
|
2021-09-04 11:14:25 +01:00
|
|
|
Function<void(i32 message_id)> on_js_console_new_message;
|
|
|
|
|
Function<void(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)> on_get_js_console_messages;
|
2021-09-13 00:33:23 +03:00
|
|
|
Function<String(const AK::URL& url, Cookie::Source source)> on_get_cookie;
|
|
|
|
|
Function<void(const AK::URL& url, const Cookie::ParsedCookie& cookie, Cookie::Source source)> on_set_cookie;
|
2022-02-20 17:03:39 -05:00
|
|
|
Function<void(i32 count_waiting)> on_resource_status_change;
|
2020-07-06 21:18:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|