KPIMTextEdit::AbstractMarkupBuilder

Search for usage in LXR

KPIMTextEdit::AbstractMarkupBuilder Class Referenceabstract

#include <grantlee/abstractmarkupbuilder.h>

Inheritance diagram for KPIMTextEdit::AbstractMarkupBuilder:

Public Member Functions

virtual ~AbstractMarkupBuilder ()=default
 
virtual void addNewline ()=0
 
virtual void addSingleBreakLine ()=0
 
virtual void appendLiteralText (const QString &text)=0
 
virtual void appendRawText (const QString &text)=0
 
virtual void beginAnchor (const QString &href={}, const QString &name={})=0
 
virtual void beginBackground (const QBrush &brush)=0
 
virtual void beginEmph ()=0
 
virtual void beginFontFamily (const QString &family)=0
 
virtual void beginFontPointSize (int size)=0
 
virtual void beginForeground (const QBrush &brush)=0
 
virtual void beginHeader (int level)=0
 
virtual void beginList (QTextListFormat::Style style)=0
 
virtual void beginListItem ()=0
 
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 leftToRightText=false)=0
 
virtual void beginStrikeout ()=0
 
virtual void beginStrong ()=0
 
virtual void beginSubscript ()=0
 
virtual void beginSuperscript ()=0
 
virtual void beginTable (qreal cellpadding, qreal cellspacing, const QString &width)=0
 
virtual void beginTableCell (const QString &width, int colSpan, int rowSpan)=0
 
virtual void beginTableHeaderCell (const QString &width, int colSpan, int rowSpan)=0
 
virtual void beginTableRow ()=0
 
virtual void beginUnderline ()=0
 
virtual void endAnchor ()=0
 
virtual void endBackground ()=0
 
virtual void endEmph ()=0
 
virtual void endFontFamily ()=0
 
virtual void endFontPointSize ()=0
 
virtual void endForeground ()=0
 
virtual void endHeader (int level)=0
 
virtual void endList ()=0
 
virtual void endListItem ()=0
 
virtual void endParagraph ()=0
 
virtual void endStrikeout ()=0
 
virtual void endStrong ()=0
 
virtual void endSubscript ()=0
 
virtual void endSuperscript ()=0
 
virtual void endTable ()=0
 
virtual void endTableCell ()=0
 
virtual void endTableHeaderCell ()=0
 
virtual void endTableRow ()=0
 
virtual void endUnderline ()=0
 
virtual QString getResult ()=0
 
virtual void insertHorizontalRule (int width=-1)=0
 
virtual void insertImage (const QString &url, qreal width, qreal height)=0
 

Detailed Description

Interface for creating marked-up text output.

The AbstractMarkupBuilder is used by a MarkupDirector to create marked-up output such as html or markdown.

See PlainTextMarkupBuilder and TextHTMLBuilder for example implementations.

This interface can be extended to handle custom format types in a QTextDocument.

See also
custom_qtextobject
Author
Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com

Definition at line 36 of file abstractmarkupbuilder.h.

Constructor & Destructor Documentation

◆ ~AbstractMarkupBuilder()

virtual KPIMTextEdit::AbstractMarkupBuilder::~AbstractMarkupBuilder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addNewline()

virtual void KPIMTextEdit::AbstractMarkupBuilder::addNewline ( )
pure virtual

Add a newline to the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ appendLiteralText()

virtual void KPIMTextEdit::AbstractMarkupBuilder::appendLiteralText ( const QString & text)
pure virtual

Append the plain text text to the markup.

Parameters
textThe text to append.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ appendRawText()

virtual void KPIMTextEdit::AbstractMarkupBuilder::appendRawText ( const QString & text)
pure virtual

Append the raw text text to the markup.

text is added unescaped

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginAnchor()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginAnchor ( const QString & href = {},
const QString & name = {} )
pure virtual

Begin a url anchor element in the markup.

Parameters
hrefThe href of the anchor.
nameThe name of the anchor.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginBackground()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginBackground ( const QBrush & brush)
pure virtual

Begin a decorarated background element in the markup (A text background color) using brush.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginEmph()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginEmph ( )
pure virtual

Begin an emphasised element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginFontFamily()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginFontFamily ( const QString & family)
pure virtual

Begin a new font family element in the markup.

Parameters
familyThe name of the font family to begin.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginFontPointSize()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginFontPointSize ( int size)
pure virtual

Begin a new font point size element in the markup.

Parameters
sizeThe point size to begin.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginForeground()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginForeground ( const QBrush & brush)
pure virtual

Begin a decorarated foreground element in the markup (A text color) using brush.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginHeader()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginHeader ( int level)
pure virtual

Begin a level level header.

Parameters
levelAn integer between 1 and 6

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginList()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginList ( QTextListFormat::Style style)
pure virtual

Begin a new list element in the markup.

A list element contains list items, and may contain other lists.

Parameters
styleThe style of list to create.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginListItem()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginListItem ( )
pure virtual

Begin a new list item in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginParagraph()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginParagraph ( Qt::Alignment a = Qt::AlignLeft,
qreal top = 0.0,
qreal bottom = 0.0,
qreal left = 0.0,
qreal right = 0.0,
bool leftToRightText = false )
pure virtual

Begin a new paragraph in the markup.

Parameters
aThe alignment of the new paragraph.
topThe top margin of the new paragraph.
bottomThe bottom margin of the new paragraph.
leftThe left margin of the new paragraph.
rightThe right margin of the new paragraph.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginStrikeout()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginStrikeout ( )
pure virtual

Begin a struck out element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginStrong()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginStrong ( )
pure virtual

Begin a bold element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginSubscript()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginSubscript ( )
pure virtual

Begin a subscript element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginSuperscript()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginSuperscript ( )
pure virtual

Begin a superscript element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginTable()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginTable ( qreal cellpadding,
qreal cellspacing,
const QString & width )
pure virtual

Begin a table element.

Parameters
cellpaddingThe padding attribute for the table.
cellspacingThe spacing attribute for the table.
widthThe width of the table. May be either an integer, or a percentage value.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginTableCell()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginTableCell ( const QString & width,
int colSpan,
int rowSpan )
pure virtual

Begin a new table cell.

Parameters
widthThe width of the cell.
colSpanThe column span of the cell.
rowSpanThe row span of the cell.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginTableHeaderCell()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginTableHeaderCell ( const QString & width,
int colSpan,
int rowSpan )
pure virtual

Begin a new table header cell.

Parameters
widthThe width of the cell.
colSpanThe column span of the cell.
rowSpanThe row span of the cell.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginTableRow()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginTableRow ( )
pure virtual

Begin a new table row.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ beginUnderline()

virtual void KPIMTextEdit::AbstractMarkupBuilder::beginUnderline ( )
pure virtual

Begin an underlined element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endAnchor()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endAnchor ( )
pure virtual

Close the anchor element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endBackground()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endBackground ( )
pure virtual

Close the decorarated background element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endEmph()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endEmph ( )
pure virtual

Close the emphasised element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endFontFamily()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endFontFamily ( )
pure virtual

End font family element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endFontPointSize()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endFontPointSize ( )
pure virtual

End font point size element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endForeground()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endForeground ( )
pure virtual

Close the decorarated foreground element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endHeader()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endHeader ( int level)
pure virtual

End a level level header.

Parameters
levelAn integer between 1 and 6

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endList()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endList ( )
pure virtual

Close the list.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endListItem()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endListItem ( )
pure virtual

End the list item.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endParagraph()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endParagraph ( )
pure virtual

Close the paragraph in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endStrikeout()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endStrikeout ( )
pure virtual

Close the struck out element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endStrong()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endStrong ( )
pure virtual

Close the bold element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endSubscript()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endSubscript ( )
pure virtual

End subscript element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endSuperscript()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endSuperscript ( )
pure virtual

End superscript element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endTable()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endTable ( )
pure virtual

End a table element.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endTableCell()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endTableCell ( )
pure virtual

End a table cell.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endTableHeaderCell()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endTableHeaderCell ( )
pure virtual

End a table header cell.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endTableRow()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endTableRow ( )
pure virtual

End a table row.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ endUnderline()

virtual void KPIMTextEdit::AbstractMarkupBuilder::endUnderline ( )
pure virtual

Close the underlined element in the markup.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ getResult()

virtual QString KPIMTextEdit::AbstractMarkupBuilder::getResult ( )
nodiscardpure virtual

Return the fully marked up result of the building process.

This may contain metadata etc, such as a head element in html.

Returns
The fully marked up text.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ insertHorizontalRule()

virtual void KPIMTextEdit::AbstractMarkupBuilder::insertHorizontalRule ( int width = -1)
pure virtual

Insert a horizontal rule into the markup.

Parameters
widthThe width of the rule. Default is full width.

Implemented in KPIMTextEdit::TextHTMLBuilder.

◆ insertImage()

virtual void KPIMTextEdit::AbstractMarkupBuilder::insertImage ( const QString & url,
qreal width,
qreal height )
pure virtual

Insert a new image element into the markup.

Parameters
urlThe url of the image
widthThe width of the image
heightThe height of the image.

Implemented in KPIMTextEdit::TextHTMLBuilder.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.