blob: ffa99578c28abc351f24cacca3719f767da777cb (
plain)
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
|
#pragma once
#include <LibGUI/GScrollableWidget.h>
#include <LibHTML/DOM/Document.h>
class HtmlView : public GScrollableWidget {
C_OBJECT(HtmlView)
public:
virtual ~HtmlView() override {}
Document* document() { return m_document; }
const Document* document() const { return m_document; }
void set_document(Document*);
Function<void(const String&)> on_link_click;
Function<void(const String&)> on_title_change;
protected:
HtmlView(GWidget* parent = nullptr);
virtual void resize_event(GResizeEvent&) override;
virtual void paint_event(GPaintEvent&) override;
virtual void mousemove_event(GMouseEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
private:
void layout_and_sync_size();
RefPtr<Document> m_document;
RefPtr<LayoutNode> m_layout_root;
};
|