forked from LadybirdBrowser/ancient-history
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebView.h
49 lines (37 loc) · 1.19 KB
/
WebView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (c) 2022, Andreas Kling <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#define AK_DONT_REPLACE_STD
#include <AK/OwnPtr.h>
#include <AK/String.h>
#include <LibGfx/Forward.h>
#include <QAbstractScrollArea>
class HeadlessBrowserPageClient;
class WebView final : public QAbstractScrollArea {
Q_OBJECT
public:
WebView();
virtual ~WebView() override;
void load(String const& url);
void reload();
virtual void paintEvent(QPaintEvent*) override;
virtual void resizeEvent(QResizeEvent*) override;
virtual void mouseMoveEvent(QMouseEvent*) override;
virtual void mousePressEvent(QMouseEvent*) override;
virtual void mouseReleaseEvent(QMouseEvent*) override;
void debug_request(String const& request, String const& argument);
signals:
void linkHovered(QString, int timeout = 0);
void linkUnhovered();
void loadStarted(const URL&);
void title_changed(QString);
void favicon_changed(QIcon);
private:
Gfx::IntPoint to_content(Gfx::IntPoint) const;
OwnPtr<HeadlessBrowserPageClient> m_page_client;
qreal m_inverse_pixel_scaling_ratio { 1.0 };
bool m_should_show_line_box_borders { false };
};