KPIMTextEdit::MarkupDirector
#include <grantlee/markupdirector.h>
Protected Types | |
enum | OpenElementValues { None = 0x0 , SuperScript = 0x01 , SubScript = 0x02 , Anchor = 0x04 , SpanForeground = 0x08 , SpanBackground = 0x10 , SpanFontFamily = 0x20 , SpanFontPointSize = 0x40 , Strong = 0x80 , Emph = 0x100 , Underline = 0x200 , StrikeOut = 0x400 } |
Protected Member Functions | |
virtual QSet< int > | getElementsToClose (const QTextBlock::iterator &it) const |
virtual QList< int > | getElementsToOpen (const QTextBlock::iterator &it) |
virtual void | processClosingElements (const QTextBlock::iterator &it) |
void | processDocumentContents (QTextFrame::iterator begin, const QTextFrame::iterator &end) |
virtual void | processOpeningElements (const QTextBlock::iterator &it) |
QPair< QTextFrame::iterator, QTextBlock > | skipBlockGroup (QTextFrame::iterator it, const QTextBlock &_block, QTextBlockGroup *blockGroup) |
QList< int > | sortOpeningOrder (QSet< int > openingTags, QTextBlock::iterator it) const |
Protected Attributes | |
MarkupDirectorPrivate *const | d_ptr |
KPIMTextEdit::AbstractMarkupBuilder *const | m_builder |
Detailed Description
Instructs a builder object to create markup output.
The MarkupDirector is used with an implementation of AbstractMarkupBuilder to create a marked up document output.
Usage can be quite simple.
Or with a different builder:
The MarkupDirector also provides API for processing just part of a QTextDocument, such as a QTextFrame or a QTextBlock. The appropriate method may then be called with an invalid iterator as appropriate.
The behaviour of the MarkupDirector can be customized by subclassing. Support for custom types can also be added by implementing the processCustomFragment method.
- See also
- custom_qtextobject
Definition at line 75 of file markupdirector.h.
Member Enumeration Documentation
◆ OpenElementValues
|
protected |
Flags for the tags that may be open.
Definition at line 235 of file markupdirector.h.
Constructor & Destructor Documentation
◆ MarkupDirector()
|
explicit |
Constructor.
Definition at line 30 of file markupdirector.cpp.
◆ ~MarkupDirector()
|
virtual |
Destructor.
Definition at line 36 of file markupdirector.cpp.
Member Function Documentation
◆ getElementsToClose()
|
protectedvirtual |
Returns the tags that should be closed at the position of it
.
Definition at line 665 of file markupdirector.cpp.
◆ getElementsToOpen()
|
protectedvirtual |
Returns the tags that should be opened at the position of it
.
Definition at line 751 of file markupdirector.cpp.
◆ processBlock()
|
virtual |
Directs the builder to create output for the single block
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
This method does not process the contents of the block
, but uses the processBlockContents method to do so.
Definition at line 266 of file markupdirector.cpp.
◆ processBlockContents()
|
virtual |
Directs the builder to create output for the contents of the single block
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
Definition at line 43 of file markupdirector.cpp.
◆ processBlockGroup()
|
virtual |
Directs the builder to create output for the single textBlockGroup
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
The block block
is the first block in the textBlockGroup
.
Definition at line 465 of file markupdirector.cpp.
◆ processCharTextObject()
|
virtual |
Directs the builder to create output for the contents of the single textObject
.
The textObject
is represented in the QTextDocument with the QTextFragment fragment
.
If calling this method directly, an invalid QTextBlock::iterator may be used.
Definition at line 479 of file markupdirector.cpp.
◆ processClosingElements()
|
protectedvirtual |
Directs the builder to close the appropriate tags at the position of it
.
Definition at line 503 of file markupdirector.cpp.
◆ processCustomFragment()
|
virtual |
Hook for instructing the builder to create output for the fragemnt
with a custom type.
doc
is the document the fragment is in.
Definition at line 404 of file markupdirector.cpp.
◆ processDocument()
|
virtual |
Constructs the output by directing the builder to create the markup.
Definition at line 474 of file markupdirector.cpp.
◆ processDocumentContents()
|
protected |
Processes the document between begin
and end
.
Definition at line 236 of file markupdirector.cpp.
◆ processFragment()
|
virtual |
Directs the builder to create output for the contents of the single fragment
.
If calling this method directly, an invalid QTextBlock::iterator may be used. doc
is the document the fragment is in.
Definition at line 112 of file markupdirector.cpp.
◆ processFrame()
|
virtual |
Directs the builder to create output for the single frame
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
Definition at line 255 of file markupdirector.cpp.
◆ processImage()
|
virtual |
Directs the builder to create output for the image represented by the imageFormat
.
If calling this method directly, an invalid QTextBlock::iterator may be used. doc
is the document the fragment is in.
Definition at line 492 of file markupdirector.cpp.
◆ processList()
|
virtual |
Directs the builder to create output for the single textList
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
The block block
is the first block in the textList
.
Definition at line 376 of file markupdirector.cpp.
◆ processObject()
|
virtual |
Directs the builder to create output for the single textObject
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
The block block
is the container of the textObject
.
Definition at line 410 of file markupdirector.cpp.
◆ processOpeningElements()
|
protectedvirtual |
Directs the builder to open the appropriate tags at the position of it
.
Definition at line 584 of file markupdirector.cpp.
◆ processTable()
|
virtual |
Directs the builder to create output for the contents of the single table
.
If calling this method directly, an invalid QTextFrame::iterator may be used.
Definition at line 284 of file markupdirector.cpp.
◆ processTableCell()
|
virtual |
Directs the builder to create output for the contents of the single tableCell
.
The tableCell is in the table
.
Definition at line 370 of file markupdirector.cpp.
◆ skipBlockGroup()
|
protected |
Iterates the iterator it
to the first block after blockGroup
.
_block
is any block in the blockGroup
.
The return pair is the iterator pointing after the end of blockGroup
and the first block after blockGroup
.
Definition at line 422 of file markupdirector.cpp.
◆ sortOpeningOrder()
|
protected |
Returns a list of tags contained in openingTags
sorted so they can be opened in order and will be closed in the correct order.
openingTags
should be a set of tags opened at the fragment pointed to by it
.
Definition at line 845 of file markupdirector.cpp.
Member Data Documentation
◆ d_ptr
|
protected |
Definition at line 252 of file markupdirector.h.
◆ m_builder
|
protected |
The builder this MarkupDirector is operating on.
This is available when subclassing to customize behaviour.
Definition at line 259 of file markupdirector.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:45 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.