From b9493ba783e833769e04b8276a42be8c18c98339 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Wed, 25 Sep 2019 12:44:22 +0300 Subject: LibHTML: Introduce the HtmlView widget This is a GWidget that can display contents of an HTML document. It replaces the Frame class. --- Libraries/LibHTML/HtmlView.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Libraries/LibHTML/HtmlView.h (limited to 'Libraries/LibHTML/HtmlView.h') diff --git a/Libraries/LibHTML/HtmlView.h b/Libraries/LibHTML/HtmlView.h new file mode 100644 index 0000000000..8d04f738fe --- /dev/null +++ b/Libraries/LibHTML/HtmlView.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include + +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*); + +protected: + HtmlView(GWidget* parent = nullptr); + + virtual void resize_event(GResizeEvent&) override; + virtual void paint_event(GPaintEvent&) override; + +private: + void layout_and_sync_size(); + + RefPtr m_document; + RefPtr m_layout_root; +}; -- cgit v1.2.3