#pragma once #include #include #include #include #include #include #include "blocks/TextBlock.h" class GfxRenderer; class ParsedText { std::list words; std::list wordStyles; TextBlock::BLOCK_STYLE style; bool extraParagraphSpacing; public: explicit ParsedText(const TextBlock::BLOCK_STYLE style, const bool extraParagraphSpacing) : style(style), extraParagraphSpacing(extraParagraphSpacing) {} ~ParsedText() = default; void addWord(std::string word, EpdFontStyle fontStyle); void setStyle(const TextBlock::BLOCK_STYLE style) { this->style = style; } TextBlock::BLOCK_STYLE getStyle() const { return style; } bool isEmpty() const { return words.empty(); } void layoutAndExtractLines(const GfxRenderer& renderer, int fontId, int horizontalMargin, const std::function)>& processLine); };