Qt 4.8
Public Functions | Properties | List of all members
QTextHtmlStyleSelector Class Reference
Inheritance diagram for QTextHtmlStyleSelector:
QCss::StyleSelector

Public Functions

virtual QString attribute (NodePtr node, const QString &name) const
 
virtual NodePtr duplicateNode (NodePtr node) const
 
virtual void freeNode (NodePtr node) const
 
virtual bool hasAttributes (NodePtr node) const
 
virtual bool isNullNode (NodePtr node) const
 
virtual QStringList nodeNames (NodePtr node) const
 
virtual NodePtr parentNode (NodePtr node) const
 
virtual NodePtr previousSiblingNode (NodePtr node) const
 
 QTextHtmlStyleSelector (const QTextHtmlParser *parser)
 
- Public Functions inherited from QCss::StyleSelector
QVector< DeclarationdeclarationsForNode (NodePtr node, const char *extraPseudo=0)
 
virtual QStringList nodeIds (NodePtr node) const
 
virtual bool nodeNameEquals (NodePtr node, const QString &nodeName) const
 
QVector< StyleRulestyleRulesForNode (NodePtr node)
 
 StyleSelector ()
 
virtual ~StyleSelector ()
 

Properties

const QTextHtmlParserparser
 

Additional Inherited Members

- Public Variables inherited from QCss::StyleSelector
QString medium
 
Qt::CaseSensitivity nameCaseSensitivity
 
QVector< StyleSheetstyleSheets
 

Detailed Description

Definition at line 1729 of file qtexthtmlparser.cpp.

Constructors and Destructors

◆ QTextHtmlStyleSelector()

QTextHtmlStyleSelector::QTextHtmlStyleSelector ( const QTextHtmlParser parser)
inline

Definition at line 1732 of file qtexthtmlparser.cpp.

const QTextHtmlParser * parser
Qt::CaseSensitivity nameCaseSensitivity
Definition: qcssparser_p.h:677

Functions

◆ attribute()

QString QTextHtmlStyleSelector::attribute ( NodePtr  node,
const QString name 
) const
virtual

Implements QCss::StyleSelector.

Definition at line 1766 of file qtexthtmlparser.cpp.

1767 {
1768  const QStringList &attributes = parser->at(node.id).attributes;
1769  const int idx = findAttribute(attributes, name);
1770  if (idx == -1)
1771  return QString();
1772  return attributes.at(idx + 1);
1773 }
static int findAttribute(const QStringList &attributes, const QString &name)
const QTextHtmlParserNode & at(int i) const
The QString class provides a Unicode character string.
Definition: qstring.h:83
const QTextHtmlParser * parser
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ duplicateNode()

QCss::StyleSelector::NodePtr QTextHtmlStyleSelector::duplicateNode ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1796 of file qtexthtmlparser.cpp.

1797 {
1798  return node;
1799 }

◆ freeNode()

void QTextHtmlStyleSelector::freeNode ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1817 of file qtexthtmlparser.cpp.

1818 {
1819 }

◆ hasAttributes()

bool QTextHtmlStyleSelector::hasAttributes ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1775 of file qtexthtmlparser.cpp.

1776 {
1777  const QStringList &attributes = parser->at(node.id).attributes;
1778  return !attributes.isEmpty();
1779 }
const QTextHtmlParserNode & at(int i) const
const QTextHtmlParser * parser
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ isNullNode()

bool QTextHtmlStyleSelector::isNullNode ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1781 of file qtexthtmlparser.cpp.

1782 {
1783  return node.id == 0;
1784 }

◆ nodeNames()

QStringList QTextHtmlStyleSelector::nodeNames ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1748 of file qtexthtmlparser.cpp.

1749 {
1750  return QStringList(parser->at(node.id).tag.toLower());
1751 }
const QTextHtmlParserNode & at(int i) const
const QTextHtmlParser * parser
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389

◆ parentNode()

QCss::StyleSelector::NodePtr QTextHtmlStyleSelector::parentNode ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1786 of file qtexthtmlparser.cpp.

1787 {
1788  NodePtr parent;
1789  parent.id = 0;
1790  if (node.id) {
1791  parent.id = parser->at(node.id).parent;
1792  }
1793  return parent;
1794 }
const QTextHtmlParserNode & at(int i) const
const QTextHtmlParser * parser

◆ previousSiblingNode()

QCss::StyleSelector::NodePtr QTextHtmlStyleSelector::previousSiblingNode ( NodePtr  node) const
virtual

Implements QCss::StyleSelector.

Definition at line 1801 of file qtexthtmlparser.cpp.

1802 {
1803  NodePtr sibling;
1804  sibling.id = 0;
1805  if (!node.id)
1806  return sibling;
1807  int parent = parser->at(node.id).parent;
1808  if (!parent)
1809  return sibling;
1810  const int childIdx = parser->at(parent).children.indexOf(node.id);
1811  if (childIdx <= 0)
1812  return sibling;
1813  sibling.id = parser->at(parent).children.at(childIdx - 1);
1814  return sibling;
1815 }
QVector< int > children
const QTextHtmlParserNode & at(int i) const
const QTextHtmlParser * parser
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the vector, searching forward from ind...
Definition: qvector.h:698
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350

Properties

◆ parser

const QTextHtmlParser* QTextHtmlStyleSelector::parser
private

Definition at line 1745 of file qtexthtmlparser.cpp.


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