Grantlee 5.3.0

Public Member Functions | List of all members
Grantlee::MediaWikiMarkupBuilder Class Reference

Creates MediaWiki markup from a QTextDocument. More...

`#include <mediawikimarkupbuilder.h>`

Inheritance diagram for Grantlee::MediaWikiMarkupBuilder:
[legend]

## Public Member Functions
void | addNewline () override
void | appendLiteralText (const QString &text) override
void | beginAnchor (const QString &href={}, const QString &name={}) override
void | beginEmph () override
void | beginHeader (int level) override
void | beginList (QTextListFormat::Style type) override
void | beginListItem () override
void | beginStrikeout () override
void | beginStrong () override
void | beginUnderline () override
void | endAnchor () override
void | endEmph () override
void | endHeader (int level) override
void | endList () override
void | endListItem () override
void | endParagraph () override
void | endStrikeout () override
void | endStrong () override
void | endUnderline () override
const QString | escape (const QString &s)
QString | getResult () override
Public Member Functions inherited from Grantlee::AbstractMarkupBuilder
virtual | ~AbstractMarkupBuilder ()
virtual void | addNewline ()=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)=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

Definition at line 32 of file mediawikimarkupbuilder.h.

## Member Function Documentation

## ◆ addNewline()

void Grantlee::MediaWikiMarkupBuilder::addNewline | ( |  | ) |
| override virtual

Add a newline to the markup.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ appendLiteralText()

void Grantlee::MediaWikiMarkupBuilder::appendLiteralText | ( | const QString & | text | ) |
| override virtual

Append the plain text `text` to the markup

Parameters

  text | The text to append.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginAnchor()

void Grantlee::MediaWikiMarkupBuilder::beginAnchor | ( | const QString & | href = `{}`,
|  | const QString & | name = `{}`
| ) |  |
| override virtual

Begin a url anchor element in the markup

Parameters

  href | The href of the anchor.
  name | The name of the anchor.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginEmph()

void Grantlee::MediaWikiMarkupBuilder::beginEmph | ( |  | ) |
| override virtual

Begin an emphasised element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginHeader()

void Grantlee::MediaWikiMarkupBuilder::beginHeader | ( | int | level | ) |
| override virtual

Begin a level `level` header

Parameters

  level | An integer between 1 and 6

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginList()

void Grantlee::MediaWikiMarkupBuilder::beginList | ( | QTextListFormat::Style | style | ) |
| override virtual

Begin a new list element in the markup. A list element contains list items, and may contain other lists.

Parameters

  style | The style of list to create.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginListItem()

void Grantlee::MediaWikiMarkupBuilder::beginListItem | ( |  | ) |
| override virtual

Begin a new list item in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginStrikeout()

void Grantlee::MediaWikiMarkupBuilder::beginStrikeout | ( |  | ) |
| override virtual

Begin a struck out element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginStrong()

void Grantlee::MediaWikiMarkupBuilder::beginStrong | ( |  | ) |
| override virtual

Begin a bold element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ beginUnderline()

void Grantlee::MediaWikiMarkupBuilder::beginUnderline | ( |  | ) |
| override virtual

Begin an underlined element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endAnchor()

void Grantlee::MediaWikiMarkupBuilder::endAnchor | ( |  | ) |
| override virtual

Close the anchor element

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endEmph()

void Grantlee::MediaWikiMarkupBuilder::endEmph | ( |  | ) |
| override virtual

Close the emphasised element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endHeader()

void Grantlee::MediaWikiMarkupBuilder::endHeader | ( | int | level | ) |
| override virtual

End a level `level` header

Parameters

  level | An integer between 1 and 6

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endList()

void Grantlee::MediaWikiMarkupBuilder::endList | ( |  | ) |
| override virtual

Close the list.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endListItem()

void Grantlee::MediaWikiMarkupBuilder::endListItem | ( |  | ) |
| override virtual

End the list item

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endParagraph()

void Grantlee::MediaWikiMarkupBuilder::endParagraph | ( |  | ) |
| override virtual

Close the paragraph in the markup.

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endStrikeout()

void Grantlee::MediaWikiMarkupBuilder::endStrikeout | ( |  | ) |
| override virtual

Close the struck out element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endStrong()

void Grantlee::MediaWikiMarkupBuilder::endStrong | ( |  | ) |
| override virtual

Close the bold element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ endUnderline()

void Grantlee::MediaWikiMarkupBuilder::endUnderline | ( |  | ) |
| override virtual

Close the underlined element in the markup

Implements Grantlee::AbstractMarkupBuilder.

## ◆ escape()

const QString Grantlee::MediaWikiMarkupBuilder::escape | ( | const QString & | s | ) |

Escapes `text` appropriately for MediaWiki.

## ◆ getResult()

QString Grantlee::MediaWikiMarkupBuilder::getResult | ( |  | ) |
| override 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.

Implements Grantlee::AbstractMarkupBuilder.