aboutsummaryrefslogtreecommitdiff
path: root/src/renderers/htmlrenderer.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2021-03-07 11:58:37 +0100
committerFelix Queißner <felix@ib-queissner.de>2021-03-08 02:23:16 +0100
commit64e271dce2e5aca07abdca8e335b3f7cb9ba1114 (patch)
treee3aed2f5057f4db7eccc9505125c3a539ad543c1 /src/renderers/htmlrenderer.hpp
parent2e4bd9e8a1f0ee14fb58c91ae2d94bcb96c6cbce (diff)
downloadkristall-64e271dce2e5aca07abdca8e335b3f7cb9ba1114.tar.gz
Starts to implement new HTML renderer based on gumbo. Everything is a bit borked and only trivial documents work correctly.
Diffstat (limited to 'src/renderers/htmlrenderer.hpp')
-rw-r--r--src/renderers/htmlrenderer.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/renderers/htmlrenderer.hpp b/src/renderers/htmlrenderer.hpp
new file mode 100644
index 0000000..d835236
--- /dev/null
+++ b/src/renderers/htmlrenderer.hpp
@@ -0,0 +1,31 @@
+#ifndef HTMLRENDERER_HPP
+#define HTMLRENDERER_HPP
+
+#include <memory>
+#include <QTextDocument>
+#include <QColor>
+#include <QSettings>
+
+#include "documentoutlinemodel.hpp"
+
+#include "documentstyle.hpp"
+
+struct HtmlRenderer
+{
+ HtmlRenderer() = delete;
+
+ //! Renders the given byte sequence into a GeminiDocument.
+ //! @param input The utf8 encoded input string
+ //! @param root_url The url that is used to resolve relative links
+ //! @param style The style which is used to render the document
+ //! @param outline The extracted outline from the document
+ static std::unique_ptr<QTextDocument> render(
+ QByteArray const & input,
+ QUrl const & root_url,
+ DocumentStyle const & style,
+ DocumentOutlineModel & outline,
+ QString & page_title
+ );
+};
+
+#endif // HTMLRENDERER_HPP