KPIMTextEdit::PlainTextMarkupBuilder Class

class KPIMTextEdit::PlainTextMarkupBuilder

The PlainTextMarkupBuilder class provides a plain text markup builder for Grantlee templates. More...

Header: #include <KPIMTextEdit/PlainTextMarkupBuilder>
CMake: find_package(KPim6TextEdit REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::TextEdit)
Inherits: KPIMTextEdit::AbstractMarkupBuilder

Public Functions

PlainTextMarkupBuilder()
virtual ~PlainTextMarkupBuilder() override
int addReference(const QString &reference)
bool isQuoteBlock(qreal top, qreal bottom, qreal left, qreal right) const
void setQuotePrefix(const QString &prefix)

Reimplemented Public Functions

virtual void addNewline() override
virtual void addSingleBreakLine() override
virtual void appendLiteralText(const QString &text) override
virtual void appendRawText(const QString &text) override
virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()) override
virtual void beginBackground(const QBrush &brush) override
virtual void beginEmph() override
virtual void beginFontFamily(const QString &family) override
virtual void beginFontPointSize(int size) override
virtual void beginForeground(const QBrush &brush) override
virtual void beginHeader(int level) override
virtual void beginList(QTextListFormat::Style style, int start) override
virtual void beginListItem(QTextBlockFormat::MarkerType type) override
virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0, bool rightToLeftText = false) override
virtual void beginStrikeout() override
virtual void beginStrong() override
virtual void beginSubscript() override
virtual void beginSuperscript() override
virtual void beginTable(const QTextTableFormat &format) override
virtual void beginTableCell(const QTextTableCellFormat &format, const QTextLength &width) override
virtual void beginTableHeaderCell(const QTextTableCellFormat &format, const QTextLength &width) override
virtual void beginTableRow() override
virtual void beginUnderline() override
virtual void endAnchor() override
virtual void endBackground() override
virtual void endEmph() override
virtual void endFontFamily() override
virtual void endFontPointSize() override
virtual void endForeground() override
virtual void endHeader(int level) override
virtual void endList() override
virtual void endListItem() override
virtual void endParagraph() override
virtual void endStrikeout() override
virtual void endStrong() override
virtual void endSubscript() override
virtual void endSuperscript() override
virtual void endTable() override
virtual void endTableCell() override
virtual void endTableHeaderCell() override
virtual void endTableRow() override
virtual void endUnderline() override
virtual QString getResult() override
virtual void insertHorizontalRule(const QTextLength &width = {}) override
virtual void insertImage(const QString &src, qreal width, qreal height) override

Detailed Description

Member Function Documentation

PlainTextMarkupBuilder::PlainTextMarkupBuilder()

Constructs a new PlainTextMarkupBuilder.

[override virtual noexcept] PlainTextMarkupBuilder::~PlainTextMarkupBuilder()

Destroys the PlainTextMarkupBuilder.

[override virtual] void PlainTextMarkupBuilder::addNewline()

Reimplements: AbstractMarkupBuilder::addNewline().

Adds a newline to the text output.

int PlainTextMarkupBuilder::addReference(const QString &reference)

Adds reference to the internal list of references and returns its index.

[override virtual] void PlainTextMarkupBuilder::addSingleBreakLine()

Reimplements: AbstractMarkupBuilder::addSingleBreakLine().

Adds a single break line to the output.

[override virtual] void PlainTextMarkupBuilder::appendLiteralText(const QString &text)

Reimplements: AbstractMarkupBuilder::appendLiteralText(const QString &text).

Appends the literal text to the output.

[override virtual] void PlainTextMarkupBuilder::appendRawText(const QString &text)

Reimplements: AbstractMarkupBuilder::appendRawText(const QString &text).

Appends the raw text to the output without escaping.

[override virtual] void PlainTextMarkupBuilder::beginAnchor(const QString &href = QString(), const QString &name = QString())

Reimplements: AbstractMarkupBuilder::beginAnchor(const QString &href, const QString &name).

Begins an anchor (link) element with the given href and name.

[override virtual] void PlainTextMarkupBuilder::beginBackground(const QBrush &brush)

Reimplements: AbstractMarkupBuilder::beginBackground(const QBrush &brush).

Begins a background color element with the given brush.

[override virtual] void PlainTextMarkupBuilder::beginEmph()

Reimplements: AbstractMarkupBuilder::beginEmph().

Begins an emphasized text element.

[override virtual] void PlainTextMarkupBuilder::beginFontFamily(const QString &family)

Reimplements: AbstractMarkupBuilder::beginFontFamily(const QString &family).

Begins a font family element with the given family.

[override virtual] void PlainTextMarkupBuilder::beginFontPointSize(int size)

Reimplements: AbstractMarkupBuilder::beginFontPointSize(int size).

Begins a font point size element with the given size.

[override virtual] void PlainTextMarkupBuilder::beginForeground(const QBrush &brush)

Reimplements: AbstractMarkupBuilder::beginForeground(const QBrush &brush).

Begins a foreground color element with the given brush.

[override virtual] void PlainTextMarkupBuilder::beginHeader(int level)

Reimplements: AbstractMarkupBuilder::beginHeader(int level).

Begins a header element with the given level.

[override virtual] void PlainTextMarkupBuilder::beginList(QTextListFormat::Style style, int start)

Reimplements: AbstractMarkupBuilder::beginList(QTextListFormat::Style style, int start).

Begins a list with the given style, numbered from start.

[override virtual] void PlainTextMarkupBuilder::beginListItem(QTextBlockFormat::MarkerType type)

Reimplements: AbstractMarkupBuilder::beginListItem(QTextBlockFormat::MarkerType type).

Begins a list item of type type.

[override virtual] void PlainTextMarkupBuilder::beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0, bool rightToLeftText = false)

Reimplements: AbstractMarkupBuilder::beginParagraph(Qt::Alignment a, qreal top, qreal bottom, qreal left, qreal right, bool rightToLeftText).

Begins a paragraph with the alignment a, the margins top, bottom, left and right, and the text direction rightToLeftText.

[override virtual] void PlainTextMarkupBuilder::beginStrikeout()

Reimplements: AbstractMarkupBuilder::beginStrikeout().

Begins a strikeout text element.

[override virtual] void PlainTextMarkupBuilder::beginStrong()

Reimplements: AbstractMarkupBuilder::beginStrong().

Begins a bold (strong) text element.

[override virtual] void PlainTextMarkupBuilder::beginSubscript()

Reimplements: AbstractMarkupBuilder::beginSubscript().

Begins a subscript text element.

[override virtual] void PlainTextMarkupBuilder::beginSuperscript()

Reimplements: AbstractMarkupBuilder::beginSuperscript().

Begins a superscript text element.

[override virtual] void PlainTextMarkupBuilder::beginTable(const QTextTableFormat &format)

Reimplements: AbstractMarkupBuilder::beginTable(const QTextTableFormat &format).

Begins a table with the given format.

[override virtual] void PlainTextMarkupBuilder::beginTableCell(const QTextTableCellFormat &format, const QTextLength &width)

Reimplements: AbstractMarkupBuilder::beginTableCell(const QTextTableCellFormat &format, const QTextLength &width).

Begins a table cell with the given format and column width.

[override virtual] void PlainTextMarkupBuilder::beginTableHeaderCell(const QTextTableCellFormat &format, const QTextLength &width)

Reimplements: AbstractMarkupBuilder::beginTableHeaderCell(const QTextTableCellFormat &format, const QTextLength &width).

Begins a table header cell with the given format and column width.

[override virtual] void PlainTextMarkupBuilder::beginTableRow()

Reimplements: AbstractMarkupBuilder::beginTableRow().

Begins a table row.

[override virtual] void PlainTextMarkupBuilder::beginUnderline()

Reimplements: AbstractMarkupBuilder::beginUnderline().

Begins an underlined text element.

[override virtual] void PlainTextMarkupBuilder::endAnchor()

Reimplements: AbstractMarkupBuilder::endAnchor().

Ends the anchor element.

[override virtual] void PlainTextMarkupBuilder::endBackground()

Reimplements: AbstractMarkupBuilder::endBackground().

Ends the background color element.

[override virtual] void PlainTextMarkupBuilder::endEmph()

Reimplements: AbstractMarkupBuilder::endEmph().

Ends the emphasized text element.

[override virtual] void PlainTextMarkupBuilder::endFontFamily()

Reimplements: AbstractMarkupBuilder::endFontFamily().

Ends the font family element.

[override virtual] void PlainTextMarkupBuilder::endFontPointSize()

Reimplements: AbstractMarkupBuilder::endFontPointSize().

Ends the font point size element.

[override virtual] void PlainTextMarkupBuilder::endForeground()

Reimplements: AbstractMarkupBuilder::endForeground().

Ends the foreground color element.

[override virtual] void PlainTextMarkupBuilder::endHeader(int level)

Reimplements: AbstractMarkupBuilder::endHeader(int level).

Ends the header element with the given level.

[override virtual] void PlainTextMarkupBuilder::endList()

Reimplements: AbstractMarkupBuilder::endList().

Ends the list element.

[override virtual] void PlainTextMarkupBuilder::endListItem()

Reimplements: AbstractMarkupBuilder::endListItem().

Ends the list item.

[override virtual] void PlainTextMarkupBuilder::endParagraph()

Reimplements: AbstractMarkupBuilder::endParagraph().

Ends the paragraph element.

[override virtual] void PlainTextMarkupBuilder::endStrikeout()

Reimplements: AbstractMarkupBuilder::endStrikeout().

Ends the strikeout text element.

[override virtual] void PlainTextMarkupBuilder::endStrong()

Reimplements: AbstractMarkupBuilder::endStrong().

Ends the bold text element.

[override virtual] void PlainTextMarkupBuilder::endSubscript()

Reimplements: AbstractMarkupBuilder::endSubscript().

Ends the subscript text element.

[override virtual] void PlainTextMarkupBuilder::endSuperscript()

Reimplements: AbstractMarkupBuilder::endSuperscript().

Ends the superscript text element.

[override virtual] void PlainTextMarkupBuilder::endTable()

Reimplements: AbstractMarkupBuilder::endTable().

Ends the table element.

[override virtual] void PlainTextMarkupBuilder::endTableCell()

Reimplements: AbstractMarkupBuilder::endTableCell().

Ends the table cell element.

[override virtual] void PlainTextMarkupBuilder::endTableHeaderCell()

Reimplements: AbstractMarkupBuilder::endTableHeaderCell().

Ends the table header cell element.

[override virtual] void PlainTextMarkupBuilder::endTableRow()

Reimplements: AbstractMarkupBuilder::endTableRow().

Ends the table row element.

[override virtual] void PlainTextMarkupBuilder::endUnderline()

Reimplements: AbstractMarkupBuilder::endUnderline().

Ends the underlined text element.

[override virtual] QString PlainTextMarkupBuilder::getResult()

Reimplements: AbstractMarkupBuilder::getResult().

Returns the finalized plain text markup, including references at the end.

[override virtual] void PlainTextMarkupBuilder::insertHorizontalRule(const QTextLength &width = {})

Reimplements: AbstractMarkupBuilder::insertHorizontalRule(const QTextLength &width).

Inserts a horizontal rule with the given width.

[override virtual] void PlainTextMarkupBuilder::insertImage(const QString &src, qreal width, qreal height)

Reimplements: AbstractMarkupBuilder::insertImage(const QString &url, qreal width, qreal height).

Inserts an image with the given src, width, and height.

bool PlainTextMarkupBuilder::isQuoteBlock(qreal top, qreal bottom, qreal left, qreal right) const

Returns true if the margins top, bottom, left and right indicate a quoted block.

void PlainTextMarkupBuilder::setQuotePrefix(const QString &prefix)

Sets the prefix to use for quoted text lines.