• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.4 API Reference
  • KDE Home
  • Contact Us
 

kpimtextedit/richtextbuilders

Public Types | Public Member Functions | List of all members
KAbstractMarkupBuilder Class Reference

#include <kabstractmarkupbuilder.h>

Inheritance diagram for KAbstractMarkupBuilder:
Inheritance graph
[legend]

Public Types

enum  ExtraElement { UserElement = 100 }

Public Member Functions

virtual ~KAbstractMarkupBuilder ()
virtual void addNewline ()
virtual void appendLiteralText (const QString &text)=0
virtual void beginAnchor (const QString &href=QString(), const QString &name=QString())
virtual void beginBackground (const QBrush &brush)
virtual void beginEmph ()
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 beginList (QTextListFormat::Style style)
virtual void beginListItem ()
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 beginStrikeout ()
virtual void beginStrong ()
virtual void beginSubscript ()
virtual void beginSuperscript ()
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 beginUnderline ()
virtual void endAnchor ()
virtual void endBackground ()
virtual void endEmph ()
virtual void endExtraElement (int type)
virtual void endFontFamily ()
virtual void endFontPointSize ()
virtual void endForeground ()
virtual void endHeader (int level)
virtual void endList ()
virtual void endListItem ()
virtual void endParagraph ()
virtual void endStrikeout ()
virtual void endStrong ()
virtual void endSubscript ()
virtual void endSuperscript ()
virtual void endTable ()
virtual void endTableCell ()
virtual void endTableHeaderCell ()
virtual void endTableRow ()
virtual void endUnderline ()
virtual QString & getResult ()=0
virtual void insertHorizontalRule (int width=-1)
virtual void insertImage (const QString &url, qreal width, qreal height)

Detailed Description

The KAbstractMarkupBuilder class serves as a base class for creating marked up plain text output.

The KAbstractMarkupBuilder is used by the MarkupDirector to create marked up output such as html or markdown.

Subclasses can reimplement whichever methods they choose. None of the methods are pure virtual and all default to an empty function to allow a clean fall-through. The exception is appendLiteralText, which appends its argument to the text being built.

See PlainTextMarkupBuilder and HTMLBuilder for example implementations.

Note
For maintenance, if an extra tag is needed which is not provided by the virtual methods, the ExtraElement can be used.

eg,

builder->beginExtraElement(KAbstractMarkupBuilder::DivTag);
// ...
builder->endExtraElement(KAbstractMarkupBuilder::DivTag);
Todo:
Move this to kdelibs when tested.
Author
Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com
Since
4.2

Definition at line 60 of file kabstractmarkupbuilder.h.

Member Enumeration Documentation

enum KAbstractMarkupBuilder::ExtraElement

For future compatibility.

This enum can be used to insert extra tags not supported by the virtual methods.

Definition at line 66 of file kabstractmarkupbuilder.h.

Constructor & Destructor Documentation

virtual KAbstractMarkupBuilder::~KAbstractMarkupBuilder ( )
inlinevirtual

Destructor.

Definition at line 69 of file kabstractmarkupbuilder.h.

Member Function Documentation

virtual void KAbstractMarkupBuilder::addNewline ( )
inlinevirtual

Add a newline to the markup.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

Definition at line 160 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::appendLiteralText ( const QString &  text)
pure virtual

Append the plain text text to the markup.

Parameters
Thetext to append.

Implemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

virtual void KAbstractMarkupBuilder::beginAnchor ( const QString &  href = QString(),
const QString &  name = QString() 
)
inlinevirtual

Begin a url anchor element in the markup.

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

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 115 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginBackground ( const QBrush &  brush)
inlinevirtual

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

Reimplemented in KTextHTMLBuilder.

Definition at line 104 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginEmph ( )
inlinevirtual

Begin an emphasised element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 78 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginExtraElement ( int  type,
QVariantList  args 
)
inlinevirtual

Begin an extra identified element.

Override this to support more elements in the future in a BC way.

Parameters
typeThe type of element to create
argsArguments for the element.

Definition at line 290 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginFontFamily ( const QString &  family)
inlinevirtual

Begin a new font familiy element in the markup.

Parameters
familyThe name of the font family to begin.

Reimplemented in KTextHTMLBuilder.

Definition at line 126 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginFontPointSize ( int  size)
inlinevirtual

Begin a new font point size element in the markup.

Parameters
intThe point size to begin.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 135 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginForeground ( const QBrush &  brush)
inlinevirtual

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

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 96 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginHeader ( int  level)
inlinevirtual

Begin a level level header.

Parameters
levelAn integer between 1 and 6

Reimplemented in KTextHTMLBuilder, and MediaWikiMarkupBuilder.

Definition at line 271 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginList ( QTextListFormat::Style  style)
inlinevirtual

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.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

Definition at line 186 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginListItem ( )
inlinevirtual

Begin a new list item in the markup.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

Definition at line 196 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginParagraph ( Qt::Alignment  a = Qt::AlignLeft,
qreal  top = 0.0,
qreal  bottom = 0.0,
qreal  left = 0.0,
qreal  right = 0.0 
)
inlinevirtual

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.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 148 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginStrikeout ( )
inlinevirtual

Begin a struck out element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 90 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginStrong ( )
inlinevirtual

Begin a bold element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 72 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginSubscript ( )
inlinevirtual

Begin a subscript element.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and BBCodeBuilder.

Definition at line 208 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginSuperscript ( )
inlinevirtual

Begin a superscript element.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and BBCodeBuilder.

Definition at line 202 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginTable ( qreal  cellpadding,
qreal  cellspacing,
const QString &  width 
)
inlinevirtual

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.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 220 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginTableCell ( const QString &  width,
int  colSpan,
int  rowSpan 
)
inlinevirtual

Begin a new table cell.

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

Reimplemented in KTextHTMLBuilder.

Definition at line 249 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginTableHeaderCell ( const QString &  width,
int  colSpan,
int  rowSpan 
)
inlinevirtual

Begin a new table header cell.

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

Reimplemented in KTextHTMLBuilder.

Definition at line 237 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginTableRow ( )
inlinevirtual

Begins a new table row.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 229 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::beginUnderline ( )
inlinevirtual

Begin an underlined element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 84 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endAnchor ( )
inlinevirtual

Close the anchor element.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 121 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endBackground ( )
inlinevirtual

Close the decorarated background element in the markup.

Reimplemented in KTextHTMLBuilder.

Definition at line 109 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endEmph ( )
inlinevirtual

Close the emphasised element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 81 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endExtraElement ( int  type)
inlinevirtual

End extra tag.

Parameters
typeThe type of the tag to end.

Definition at line 299 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endFontFamily ( )
inlinevirtual

End font family element.

Reimplemented in KTextHTMLBuilder.

Definition at line 130 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endFontPointSize ( )
inlinevirtual

End font point size element.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 139 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endForeground ( )
inlinevirtual

Close the decorarated foreground element in the markup.

Reimplemented in KTextHTMLBuilder, and BBCodeBuilder.

Definition at line 101 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endHeader ( int  level)
inlinevirtual

End a level level header.

Parameters
levelAn integer between 1 and 6

Reimplemented in KTextHTMLBuilder, and MediaWikiMarkupBuilder.

Definition at line 279 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endList ( )
inlinevirtual

Close the list.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

Definition at line 193 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endListItem ( )
inlinevirtual

End the list item.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and MediaWikiMarkupBuilder.

Definition at line 199 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endParagraph ( )
inlinevirtual

Close the paragraph in the markup.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

Definition at line 158 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endStrikeout ( )
inlinevirtual

Close the struck out element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 93 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endStrong ( )
inlinevirtual

Close the bold element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 75 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endSubscript ( )
inlinevirtual

End subscript element.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and BBCodeBuilder.

Definition at line 211 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endSuperscript ( )
inlinevirtual

End superscript element.

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and BBCodeBuilder.

Definition at line 205 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endTable ( )
inlinevirtual

End a table element.

Reimplemented in KTextHTMLBuilder.

Definition at line 256 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endTableCell ( )
inlinevirtual

End a table cell.

Reimplemented in KTextHTMLBuilder.

Definition at line 265 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endTableHeaderCell ( )
inlinevirtual

End a table header cell.

Reimplemented in KTextHTMLBuilder.

Definition at line 262 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endTableRow ( )
inlinevirtual

End a table row.

Reimplemented in KTextHTMLBuilder.

Definition at line 259 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::endUnderline ( )
inlinevirtual

Close the underlined element in the markup.

Reimplemented in KPlainTextMarkupBuilder, KTextHTMLBuilder, MediaWikiMarkupBuilder, and BBCodeBuilder.

Definition at line 87 of file kabstractmarkupbuilder.h.

virtual QString& KAbstractMarkupBuilder::getResult ( )
pure 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 KTextHTMLBuilder, KPlainTextMarkupBuilder, BBCodeBuilder, and MediaWikiMarkupBuilder.

virtual void KAbstractMarkupBuilder::insertHorizontalRule ( int  width = -1)
inlinevirtual

Insert a horizontal rule into the markup.

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

Reimplemented in KTextHTMLBuilder, and KPlainTextMarkupBuilder.

Definition at line 165 of file kabstractmarkupbuilder.h.

virtual void KAbstractMarkupBuilder::insertImage ( const QString &  url,
qreal  width,
qreal  height 
)
inlinevirtual

Insert a new image element into the markup.

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

Reimplemented in KTextHTMLBuilder, KPlainTextMarkupBuilder, and BBCodeBuilder.

Definition at line 175 of file kabstractmarkupbuilder.h.


The documentation for this class was generated from the following file:
  • kabstractmarkupbuilder.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue Dec 4 2012 14:35:27 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kpimtextedit/richtextbuilders

Skip menu "kpimtextedit/richtextbuilders"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.9.4 API Reference

Skip menu "kdepimlibs-4.9.4 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal