Qt 4.8
Public Functions | List of all members
QSvgStyleSelector Class Reference
Inheritance diagram for QSvgStyleSelector:
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 nodeIds (NodePtr node) const
 
virtual bool nodeNameEquals (NodePtr node, const QString &nodeName) const
 
virtual QStringList nodeNames (NodePtr node) const
 
QString nodeToName (QSvgNode *node) const
 
QSvgStructureNodenodeToStructure (QSvgNode *n) const
 
virtual NodePtr parentNode (NodePtr node) const
 
virtual NodePtr previousSiblingNode (NodePtr node) const
 
 QSvgStyleSelector ()
 
QSvgNodesvgNode (NodePtr node) const
 
QSvgStructureNodesvgStructure (NodePtr node) const
 
virtual ~QSvgStyleSelector ()
 
- Public Functions inherited from QCss::StyleSelector
QVector< DeclarationdeclarationsForNode (NodePtr node, const char *extraPseudo=0)
 
QVector< StyleRulestyleRulesForNode (NodePtr node)
 
 StyleSelector ()
 
virtual ~StyleSelector ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 425 of file qsvghandler.cpp.

Constructors and Destructors

◆ QSvgStyleSelector()

QSvgStyleSelector::QSvgStyleSelector ( )
inline

Definition at line 428 of file qsvghandler.cpp.

429  {
431  }
Qt::CaseSensitivity nameCaseSensitivity
Definition: qcssparser_p.h:677

◆ ~QSvgStyleSelector()

virtual QSvgStyleSelector::~QSvgStyleSelector ( )
inlinevirtual

Definition at line 432 of file qsvghandler.cpp.

433  {
434  }

Functions

◆ attribute()

virtual QString QSvgStyleSelector::attribute ( NodePtr  node,
const QString name 
) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 472 of file qsvghandler.cpp.

473  {
474  QSvgNode *n = svgNode(node);
475  if ((!n->nodeId().isEmpty() && (name == QLatin1String("id") ||
476  name == QLatin1String("xml:id"))))
477  return n->nodeId();
478  if (!n->xmlClass().isEmpty() && name == QLatin1String("class"))
479  return n->xmlClass();
480  return QString();
481  }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QSvgNode * svgNode(NodePtr node) const
QString xmlClass() const
Definition: qsvgnode_p.h:198
QString nodeId() const
Definition: qsvgnode_p.h:193

◆ duplicateNode()

virtual NodePtr QSvgStyleSelector::duplicateNode ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 542 of file qsvghandler.cpp.

543  {
544  NodePtr n;
545  n.ptr = node.ptr;
546  n.id = node.id;
547  return n;
548  }

◆ freeNode()

virtual void QSvgStyleSelector::freeNode ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 549 of file qsvghandler.cpp.

550  {
551  Q_UNUSED(node);
552  }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ hasAttributes()

virtual bool QSvgStyleSelector::hasAttributes ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 482 of file qsvghandler.cpp.

483  {
484  QSvgNode *n = svgNode(node);
485  return (n &&
486  (!n->nodeId().isEmpty() || !n->xmlClass().isEmpty()));
487  }
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QSvgNode * svgNode(NodePtr node) const
QString xmlClass() const
Definition: qsvgnode_p.h:198
QString nodeId() const
Definition: qsvgnode_p.h:193

◆ isNullNode()

virtual bool QSvgStyleSelector::isNullNode ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 507 of file qsvghandler.cpp.

508  {
509  return !node.ptr;
510  }

◆ nodeIds()

virtual QStringList QSvgStyleSelector::nodeIds ( NodePtr  node) const
inlinevirtual

Reimplemented from QCss::StyleSelector.

Definition at line 489 of file qsvghandler.cpp.

490  {
491  QSvgNode *n = svgNode(node);
492  QString nid;
493  if (n)
494  nid = n->nodeId();
495  QStringList lst; lst.append(nid);
496  return lst;
497  }
The QString class provides a Unicode character string.
Definition: qstring.h:83
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QSvgNode * svgNode(NodePtr node) const
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QString nodeId() const
Definition: qsvgnode_p.h:193

◆ nodeNameEquals()

virtual bool QSvgStyleSelector::nodeNameEquals ( NodePtr  node,
const QString nodeName 
) const
inlinevirtual

Reimplemented from QCss::StyleSelector.

Definition at line 464 of file qsvghandler.cpp.

465  {
466  QSvgNode *n = svgNode(node);
467  if (!n)
468  return false;
469  QString name = nodeToName(n);
470  return QString::compare(name, nodeName, Qt::CaseInsensitive) == 0;
471  }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QSvgNode * svgNode(NodePtr node) const
const char * name
int compare(const QString &s) const
Definition: qstring.cpp:5037
QString nodeToName(QSvgNode *node) const

◆ nodeNames()

virtual QStringList QSvgStyleSelector::nodeNames ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 499 of file qsvghandler.cpp.

500  {
501  QSvgNode *n = svgNode(node);
502  if (n)
503  return QStringList(nodeToName(n));
504  return QStringList();
505  }
QSvgNode * svgNode(NodePtr node) const
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QString nodeToName(QSvgNode *node) const

◆ nodeToName()

QString QSvgStyleSelector::nodeToName ( QSvgNode node) const
inline

Definition at line 436 of file qsvghandler.cpp.

437  {
439  }
virtual Type type() const =0
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static const char * QSvgStyleSelector_nodeString[]

◆ nodeToStructure()

QSvgStructureNode* QSvgStyleSelector::nodeToStructure ( QSvgNode n) const
inline

Definition at line 445 of file qsvghandler.cpp.

446  {
447  if (n &&
448  (n->type() == QSvgNode::DOC ||
449  n->type() == QSvgNode::G ||
450  n->type() == QSvgNode::DEFS ||
451  n->type() == QSvgNode::SWITCH)) {
452  return (QSvgStructureNode*)n;
453  }
454  return 0;
455  }
virtual Type type() const =0

◆ parentNode()

virtual NodePtr QSvgStyleSelector::parentNode ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 512 of file qsvghandler.cpp.

513  {
514  QSvgNode *n = svgNode(node);
515  NodePtr newNode;
516  newNode.ptr = 0;
517  newNode.id = 0;
518  if (n) {
519  QSvgNode *svgParent = n->parent();
520  if (svgParent) {
521  newNode.ptr = svgParent;
522  }
523  }
524  return newNode;
525  }
QSvgNode * parent() const
Definition: qsvgnode_p.h:183
QSvgNode * svgNode(NodePtr node) const

◆ previousSiblingNode()

virtual NodePtr QSvgStyleSelector::previousSiblingNode ( NodePtr  node) const
inlinevirtual

Implements QCss::StyleSelector.

Definition at line 526 of file qsvghandler.cpp.

527  {
528  NodePtr newNode;
529  newNode.ptr = 0;
530  newNode.id = 0;
531 
532  QSvgNode *n = svgNode(node);
533  if (!n)
534  return newNode;
535  QSvgStructureNode *svgParent = nodeToStructure(n->parent());
536 
537  if (svgParent) {
538  newNode.ptr = svgParent->previousSiblingNode(n);
539  }
540  return newNode;
541  }
QSvgNode * parent() const
Definition: qsvgnode_p.h:183
QSvgNode * svgNode(NodePtr node) const
QSvgStructureNode * nodeToStructure(QSvgNode *n) const
QSvgNode * previousSiblingNode(QSvgNode *n) const

◆ svgNode()

QSvgNode* QSvgStyleSelector::svgNode ( NodePtr  node) const
inline

Definition at line 441 of file qsvghandler.cpp.

442  {
443  return (QSvgNode*)node.ptr;
444  }

◆ svgStructure()

QSvgStructureNode* QSvgStyleSelector::svgStructure ( NodePtr  node) const
inline

Definition at line 457 of file qsvghandler.cpp.

458  {
459  QSvgNode *n = svgNode(node);
461  return st;
462  }
QSvgNode * svgNode(NodePtr node) const
QSvgStructureNode * nodeToStructure(QSvgNode *n) const
#define st(var, type, card)

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