aboutsummaryrefslogtreecommitdiff
path: root/src/renderers/geminirenderer.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-22 21:10:04 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-22 21:10:04 +0200
commit75ec461eeaa851cb5c53f4cfffc434e3e529ed1d (patch)
tree3944737340718ca3675381aa06636045d397e780 /src/renderers/geminirenderer.hpp
parent8dbfb0890560fd1cd698d06fa05ac868c4db8576 (diff)
downloadkristall-75ec461eeaa851cb5c53f4cfffc434e3e529ed1d.tar.gz
Restructures the project source and cleans up a bit
Diffstat (limited to 'src/renderers/geminirenderer.hpp')
-rw-r--r--src/renderers/geminirenderer.hpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/renderers/geminirenderer.hpp b/src/renderers/geminirenderer.hpp
new file mode 100644
index 0000000..7173d50
--- /dev/null
+++ b/src/renderers/geminirenderer.hpp
@@ -0,0 +1,41 @@
+#ifndef GEMINIRENDERER_HPP
+#define GEMINIRENDERER_HPP
+
+#include <memory>
+#include <QTextDocument>
+#include <QColor>
+#include <QSettings>
+
+#include "documentoutlinemodel.hpp"
+
+#include "documentstyle.hpp"
+
+class GeminiDocument :
+ public QTextDocument
+{
+ Q_OBJECT
+public:
+ explicit GeminiDocument(QObject * parent = nullptr);
+ ~GeminiDocument() override;
+
+ QColor background_color;
+};
+
+struct GeminiRenderer
+{
+ GeminiRenderer() = 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<GeminiDocument> render(
+ QByteArray const & input,
+ QUrl const & root_url,
+ DocumentStyle const & style,
+ DocumentOutlineModel & outline
+ );
+};
+
+#endif // GEMINIRENDERER_HPP