diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-05 10:16:27 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-05 10:17:33 +0200 |
commit | 78d65c1c645ca9c51003b3c395d8b5ac07b6a8cb (patch) | |
tree | 6dee83100f449bc4d38e7a0f23461e03784c6f20 /Libraries/LibHTML/HtmlView.h | |
parent | d64c054d25417db7905e5be0d7d69d146b030be3 (diff) | |
download | serenity-78d65c1c645ca9c51003b3c395d8b5ac07b6a8cb.zip |
LibHTML: Add load(URL) and reload() functions to HtmlView
You can now pass a file:/// URL to HtmlView and it will take care of
the loading logic for you. Each Document remembers the URL it was
loaded from, which allows us to also have reload().
This patch also adds a very simple function for resolving relative
URL's into absolute ones.
Diffstat (limited to 'Libraries/LibHTML/HtmlView.h')
-rw-r--r-- | Libraries/LibHTML/HtmlView.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibHTML/HtmlView.h b/Libraries/LibHTML/HtmlView.h index 61d374d01c..bccd78286a 100644 --- a/Libraries/LibHTML/HtmlView.h +++ b/Libraries/LibHTML/HtmlView.h @@ -1,5 +1,6 @@ #pragma once +#include <AK/URL.h> #include <LibGUI/GScrollableWidget.h> #include <LibHTML/DOM/Document.h> @@ -17,8 +18,14 @@ public: Frame& main_frame() { return *m_main_frame; } const Frame& main_frame() const { return *m_main_frame; } + void reload(); + void load(const URL&); + + URL url() const; + Function<void(const String&)> on_link_click; Function<void(const String&)> on_title_change; + Function<void(const URL&)> on_load_start; protected: HtmlView(GWidget* parent = nullptr); |