kpimtextedit/richtextbuilders
#include <kplaintextmarkupbuilder.h>

Public Member Functions | |
KPlainTextMarkupBuilder () | |
virtual void | addNewline () |
virtual void | appendLiteralText (const QString &text) |
virtual void | beginAnchor (const QString &href=QString(), const QString &name=QString()) |
virtual void | beginEmph () |
virtual void | beginList (QTextListFormat::Style style) |
virtual void | beginListItem () |
virtual void | beginStrikeout () |
virtual void | beginStrong () |
virtual void | beginSubscript () |
virtual void | beginSuperscript () |
virtual void | beginUnderline () |
virtual void | endAnchor () |
virtual void | endEmph () |
virtual void | endList () |
virtual void | endListItem () |
virtual void | endParagraph () |
virtual void | endStrikeout () |
virtual void | endStrong () |
virtual void | endSubscript () |
virtual void | endSuperscript () |
virtual void | endUnderline () |
virtual QString & | getResult () |
virtual void | insertHorizontalRule (int width=-1) |
virtual void | insertImage (const QString &src, qreal width, qreal height) |
![]() | |
virtual | ~KAbstractMarkupBuilder () |
virtual void | beginBackground (const QBrush &brush) |
virtual void | beginExtraElement (int type, QVariantList args) |
virtual void | beginFontFamily (const QString &family) |
virtual void | beginFontPointSize (int size) |
virtual void | beginForeground (const QBrush &brush) |
virtual void | beginHeader (int level) |
virtual void | beginParagraph (Qt::Alignment a=Qt::AlignLeft, qreal top=0.0, qreal bottom=0.0, qreal left=0.0, qreal right=0.0) |
virtual void | beginTable (qreal cellpadding, qreal cellspacing, const QString &width) |
virtual void | beginTableCell (const QString &width, int colSpan, int rowSpan) |
virtual void | beginTableHeaderCell (const QString &width, int colSpan, int rowSpan) |
virtual void | beginTableRow () |
virtual void | endBackground () |
virtual void | endExtraElement (int type) |
virtual void | endFontFamily () |
virtual void | endFontPointSize () |
virtual void | endForeground () |
virtual void | endHeader (int level) |
virtual void | endTable () |
virtual void | endTableCell () |
virtual void | endTableHeaderCell () |
virtual void | endTableRow () |
Additional Inherited Members | |
![]() | |
enum | ExtraElement { UserElement = 100 } |
Detailed Description
The KPlainTextMarkupBuilder creates a simple marked up plain text document.
This class creates a simple plain text markup.
Text that may be represented as
would be output as
The markup is intended to be simple, plain and easily human readable. No markup is created for different font-familiy, font-size, foreground or background colors.
Lists are marked up by preceding the list element with '*' for disc, 'o' for circle, 'X' for square, or a letter or number. Lists are also indented if nested. eg:
External references such as external urls and images are represented in the body text as a reference, and references are maintained at the bottom of the output.
Eg,
becomes:
- Todo:
- Move this to kdelibs when tested and in use.
- Since
- 4.2
Definition at line 89 of file kplaintextmarkupbuilder.h.
Constructor & Destructor Documentation
KPlainTextMarkupBuilder::KPlainTextMarkupBuilder | ( | ) |
Construct a new KPlainTextMarkupBuilder.
Definition at line 98 of file kplaintextmarkupbuilder.cpp.
Member Function Documentation
|
virtual |
Add a newline to the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 168 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Append the plain text text
to the markup.
- Parameters
-
The text to append.
Implements KAbstractMarkupBuilder.
Definition at line 275 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a url anchor element in the markup.
- Parameters
-
href The href of the anchor. name The name of the anchor.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 145 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin an emphasised element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 114 of file kplaintextmarkupbuilder.cpp.
|
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.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 195 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a new list item in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 210 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a struck out element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 134 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a bold element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 104 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a subscript element.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 263 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin a superscript element.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 251 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Begin an underlined element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 124 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the anchor element.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 156 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the emphasised element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 119 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the list.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 202 of file kplaintextmarkupbuilder.cpp.
|
virtual |
End the list item.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 244 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the paragraph in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 162 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the struck out element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 139 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the bold element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 109 of file kplaintextmarkupbuilder.cpp.
|
virtual |
End subscript element.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 269 of file kplaintextmarkupbuilder.cpp.
|
virtual |
End superscript element.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 257 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Close the underlined element in the markup.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 129 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Returns the finalised plain text markup, including references at the end.
Implements KAbstractMarkupBuilder.
Definition at line 281 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Insert a horizontal rule into the markup.
- Parameters
-
width The width of the rule. Default is full width.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 174 of file kplaintextmarkupbuilder.cpp.
|
virtual |
Insert a new image element into the markup.
- Parameters
-
url The url of the image width The width of the image height The height of the image.
Reimplemented from KAbstractMarkupBuilder.
Definition at line 182 of file kplaintextmarkupbuilder.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed Nov 28 2012 21:46:17 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.