Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QTextHtmlParser Class Reference

#include <qtexthtmlparser_p.h>

+ Inheritance diagram for QTextHtmlParser:
+ Collaboration diagram for QTextHtmlParser:

Public Types

enum  Margin { MarginTop , MarginRight , MarginBottom , MarginLeft }
 

Public Member Functions

 ~QTextHtmlParser ()
 
const QTextHtmlParserNodeat (int i) const
 
QTextHtmlParserNodeoperator[] (int i)
 
int count () const
 
int last () const
 
int depth (int i) const
 
int topMargin (int i) const
 
int bottomMargin (int i) const
 
int leftMargin (int i) const
 
int rightMargin (int i) const
 
int topPadding (int i) const
 
int bottomPadding (int i) const
 
int leftPadding (int i) const
 
int rightPadding (int i) const
 
qreal tableCellBorder (int i, int edge) const
 
QTextFrameFormat::BorderStyle tableCellBorderStyle (int i, int edge) const
 
QBrush tableCellBorderBrush (int i, int edge) const
 
void dumpHtml ()
 
void parse (const QString &text, const QTextDocument *resourceProvider)
 

Static Public Member Functions

static int lookupElement (QStringView element)
 
static Q_GUI_EXPORT QString parseEntity (QStringView entity)
 

Protected Member Functions

QTextHtmlParserNodenewNode (int parent)
 
void parse ()
 
void parseTag ()
 
void parseCloseTag ()
 
void parseExclamationTag ()
 
QString parseEntity ()
 
QString parseWord ()
 
QTextHtmlParserNoderesolveParent ()
 
void resolveNode ()
 
QStringList parseAttributes ()
 
void applyAttributes (const QStringList &attributes)
 
void eatSpace ()
 
bool hasPrefix (QChar c, int lookahead=0) const
 
int margin (int i, int mar) const
 
bool nodeIsChildOf (int i, QTextHTMLElements id) const
 

Protected Attributes

QList< QTextHtmlParserNode * > nodes
 
QString txt
 
int pos
 
int len
 
bool textEditMode
 
const QTextDocumentresourceProvider
 

Detailed Description

Definition at line 242 of file qtexthtmlparser_p.h.

Member Enumeration Documentation

◆ Margin

Enumerator
MarginTop 
MarginRight 
MarginBottom 
MarginLeft 

Definition at line 245 of file qtexthtmlparser_p.h.

Constructor & Destructor Documentation

◆ ~QTextHtmlParser()

QTextHtmlParser::~QTextHtmlParser ( )
inline

Definition at line 251 of file qtexthtmlparser_p.h.

Member Function Documentation

◆ applyAttributes()

◆ at()

◆ bottomMargin()

int QTextHtmlParser::bottomMargin ( int i) const

Definition at line 588 of file qtexthtmlparser.cpp.

References at(), QTextHtmlParserNode::margin, and MarginBottom.

+ Here is the call graph for this function:

◆ bottomPadding()

int QTextHtmlParser::bottomPadding ( int i) const
inline

Definition at line 267 of file qtexthtmlparser_p.h.

References at(), MarginBottom, and QTextHtmlParserNode::padding.

+ Here is the call graph for this function:

◆ count()

int QTextHtmlParser::count ( ) const
inline

Definition at line 258 of file qtexthtmlparser_p.h.

Referenced by dumpHtml(), and newNode().

+ Here is the caller graph for this function:

◆ depth()

int QTextHtmlParser::depth ( int i) const

Definition at line 553 of file qtexthtmlparser.cpp.

References at(), and QTextHtmlParserNode::parent.

+ Here is the call graph for this function:

◆ dumpHtml()

void QTextHtmlParser::dumpHtml ( )

Definition at line 475 of file qtexthtmlparser.cpp.

References count().

+ Here is the call graph for this function:

◆ eatSpace()

void QTextHtmlParser::eatSpace ( )
protected

Definition at line 595 of file qtexthtmlparser.cpp.

References pos.

Referenced by parseAttributes(), and parseTag().

+ Here is the caller graph for this function:

◆ hasPrefix()

bool QTextHtmlParser::hasPrefix ( QChar c,
int lookahead = 0 ) const
inlineprotected

Definition at line 302 of file qtexthtmlparser_p.h.

◆ last()

int QTextHtmlParser::last ( ) const
inline

Definition at line 259 of file qtexthtmlparser_p.h.

Referenced by parseCloseTag(), and parseTag().

+ Here is the caller graph for this function:

◆ leftMargin()

int QTextHtmlParser::leftMargin ( int i) const
inline

Definition at line 263 of file qtexthtmlparser_p.h.

References margin(), and MarginLeft.

+ Here is the call graph for this function:

◆ leftPadding()

int QTextHtmlParser::leftPadding ( int i) const
inline

Definition at line 268 of file qtexthtmlparser_p.h.

References at(), MarginLeft, and QTextHtmlParserNode::padding.

+ Here is the call graph for this function:

◆ lookupElement()

int QTextHtmlParser::lookupElement ( QStringView element)
static

Definition at line 436 of file qtexthtmlparser.cpp.

References QTextHtmlElement::id.

◆ margin()

int QTextHtmlParser::margin ( int i,
int mar ) const
protected

Definition at line 563 of file qtexthtmlparser.cpp.

References at(), Html_table, QTextHtmlParserNode::id, QTextHtmlParserNode::isBlock(), QTextHtmlParserNode::isTableCell(), QTextHtmlParserNode::margin, MarginLeft, MarginRight, and QTextHtmlParserNode::parent.

Referenced by leftMargin(), and rightMargin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newNode()

QTextHtmlParserNode * QTextHtmlParser::newNode ( int parent)
protected

Definition at line 484 of file qtexthtmlparser.cpp.

References at(), count(), QTextHtmlElement::DisplayInline, Html_unknown, QTextHtmlParserNode::id, and QTextHtmlParserNode::parent.

Referenced by parseCloseTag(), and parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeIsChildOf()

bool QTextHtmlParser::nodeIsChildOf ( int i,
QTextHTMLElements id ) const
protected

Definition at line 2267 of file qtexthtmlparser.cpp.

References at(), QTextHtmlParserNode::id, and QTextHtmlParserNode::parent.

+ Here is the call graph for this function:

◆ operator[]()

QTextHtmlParserNode & QTextHtmlParser::operator[] ( int i)
inline

Definition at line 257 of file qtexthtmlparser_p.h.

◆ parse() [1/2]

void QTextHtmlParser::parse ( )
protected

Definition at line 601 of file qtexthtmlparser.cpp.

References len, parseTag(), and pos.

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse() [2/2]

void QTextHtmlParser::parse ( const QString & text,
const QTextDocument * resourceProvider )

Definition at line 539 of file qtexthtmlparser.cpp.

References parse(), pos, and textEditMode.

+ Here is the call graph for this function:

◆ parseAttributes()

QStringList QTextHtmlParser::parseAttributes ( )
protected

Definition at line 1654 of file qtexthtmlparser.cpp.

References eatSpace(), len, and pos.

+ Here is the call graph for this function:

◆ parseCloseTag()

void QTextHtmlParser::parseCloseTag ( )
protected

Definition at line 707 of file qtexthtmlparser.cpp.

References at(), QTextHtmlParserNode::isBlock(), last(), len, QTextHtmlParserNode::mayNotHaveChildren(), newNode(), QTextHtmlParserNode::parent, pos, resolveNode(), QTextHtmlParserNode::WhiteSpacePre, QTextHtmlParserNode::WhiteSpacePreLine, QTextHtmlParserNode::WhiteSpacePreWrap, and QTextHtmlParserNode::wsm.

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseEntity() [1/2]

QString QTextHtmlParser::parseEntity ( )
protected

Definition at line 796 of file qtexthtmlparser.cpp.

References len, and pos.

◆ parseEntity() [2/2]

QString QTextHtmlParser::parseEntity ( QStringView entity)
static

Definition at line 768 of file qtexthtmlparser.cpp.

References windowsLatin1ExtendedCharacters.

◆ parseExclamationTag()

void QTextHtmlParser::parseExclamationTag ( )
protected

Definition at line 750 of file qtexthtmlparser.cpp.

References len, and pos.

Referenced by parseTag().

+ Here is the caller graph for this function:

◆ parseTag()

void QTextHtmlParser::parseTag ( )
protected

Definition at line 616 of file qtexthtmlparser.cpp.

References at(), eatSpace(), Html_unknown, QTextHtmlElement::id, QTextHtmlParserNode::id, QTextHtmlParserNode::isBlock(), last(), QTextHtmlParserNode::mayNotHaveChildren(), newNode(), QTextHtmlParserNode::parent, parseCloseTag(), parseExclamationTag(), pos, resolveNode(), resolveParent(), QTextHtmlParserNode::WhiteSpacePre, QTextHtmlParserNode::WhiteSpacePreLine, QTextHtmlParserNode::WhiteSpacePreWrap, and QTextHtmlParserNode::wsm.

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseWord()

QString QTextHtmlParser::parseWord ( )
protected

Definition at line 822 of file qtexthtmlparser.cpp.

References len, and pos.

◆ resolveNode()

void QTextHtmlParser::resolveNode ( )
protected

Definition at line 962 of file qtexthtmlparser.cpp.

References QTextHtmlParserNode::initializeProperties().

Referenced by parseCloseTag(), and parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveParent()

QTextHtmlParserNode * QTextHtmlParser::resolveParent ( )
protected

Definition at line 864 of file qtexthtmlparser.cpp.

References QTextHtmlParserNode::allowedInContext(), at(), Html_p, Html_table, Html_td, Html_tr, QTextHtmlParserNode::id, QTextHtmlParserNode::isBlock(), QTextHtmlParserNode::isNotSelfNesting(), QTextHtmlParserNode::mayNotHaveChildren(), and QTextHtmlParserNode::parent.

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightMargin()

int QTextHtmlParser::rightMargin ( int i) const
inline

Definition at line 264 of file qtexthtmlparser_p.h.

References margin(), and MarginRight.

+ Here is the call graph for this function:

◆ rightPadding()

int QTextHtmlParser::rightPadding ( int i) const
inline

Definition at line 269 of file qtexthtmlparser_p.h.

References at(), MarginRight, and QTextHtmlParserNode::padding.

+ Here is the call graph for this function:

◆ tableCellBorder()

qreal QTextHtmlParser::tableCellBorder ( int i,
int edge ) const
inline

Definition at line 271 of file qtexthtmlparser_p.h.

References at().

+ Here is the call graph for this function:

◆ tableCellBorderBrush()

QBrush QTextHtmlParser::tableCellBorderBrush ( int i,
int edge ) const
inline

Definition at line 273 of file qtexthtmlparser_p.h.

References at().

+ Here is the call graph for this function:

◆ tableCellBorderStyle()

QTextFrameFormat::BorderStyle QTextHtmlParser::tableCellBorderStyle ( int i,
int edge ) const
inline

Definition at line 272 of file qtexthtmlparser_p.h.

References at().

+ Here is the call graph for this function:

◆ topMargin()

int QTextHtmlParser::topMargin ( int i) const

Definition at line 581 of file qtexthtmlparser.cpp.

References at(), QTextHtmlParserNode::margin, and MarginTop.

+ Here is the call graph for this function:

◆ topPadding()

int QTextHtmlParser::topPadding ( int i) const
inline

Definition at line 266 of file qtexthtmlparser_p.h.

References at(), MarginTop, and QTextHtmlParserNode::padding.

+ Here is the call graph for this function:

Member Data Documentation

◆ len

int QTextHtmlParser::len
protected

◆ nodes

QList<QTextHtmlParserNode *> QTextHtmlParser::nodes
protected

Definition at line 285 of file qtexthtmlparser_p.h.

◆ pos

int QTextHtmlParser::pos
protected

◆ resourceProvider

const QTextDocument* QTextHtmlParser::resourceProvider
protected

Definition at line 329 of file qtexthtmlparser_p.h.

◆ textEditMode

bool QTextHtmlParser::textEditMode
protected

Definition at line 289 of file qtexthtmlparser_p.h.

Referenced by applyAttributes(), and parse().

◆ txt

QString QTextHtmlParser::txt
protected

Definition at line 286 of file qtexthtmlparser_p.h.


The documentation for this class was generated from the following files: