Qt 4.8
qcssparser_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QCSSPARSER_P_H
43 #define QCSSPARSER_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of the QLibrary class. This header file may change from
51 // version to version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include <QtCore/QStringList>
57 #include <QtCore/QVector>
58 #include <QtCore/QVariant>
59 #include <QtCore/QPair>
60 #include <QtCore/QSize>
61 #include <QtCore/QMultiHash>
62 #include <QtGui/QFont>
63 #include <QtGui/QPalette>
64 #include <QtGui/QIcon>
65 #include <QtCore/QSharedData>
66 
67 
68 #ifndef QT_NO_CSSPARSER
69 
70 // VxWorks defines NONE as (-1) "for times when NULL won't do"
71 #if defined(Q_OS_VXWORKS) && defined(NONE)
72 # undef NONE
73 #endif
74 #if defined(Q_OS_INTEGRITY)
75 # undef Value
76 #endif
77 
79 
80 namespace QCss
81 {
82 
83 enum Property {
188 };
189 
242 
243  /* keep these in same order as QPalette::ColorRole */
263 
269 
271 };
272 
288 };
289 
290 enum Edge {
296 };
297 
298 enum Corner {
303 };
304 
305 enum TileMode {
311 };
312 
313 enum Repeat {
320 };
321 
322 enum Origin {
329 };
330 
338 };
339 
345 };
346 
352 };
353 
355 {
356  enum Type {
368  TermOperatorComma
369  };
370  inline Value() : type(Unknown) { }
373  QString toString() const;
374 };
375 
376 struct ColorData {
378  ColorData(const QColor &col) : color(col), role(QPalette::NoRole), type(Color) {}
379  ColorData(QPalette::ColorRole r) : role(r), type(Role) {}
382  enum { Invalid, Color, Role} type;
383 };
384 
385 struct BrushData {
387  BrushData(const QBrush &br) : brush(br), role(QPalette::NoRole), type(Brush) {}
388  BrushData(QPalette::ColorRole r) : role(r), type(Role) {}
391  enum { Invalid, Brush, Role, DependsOnThePalette } type;
392 };
393 
398  Qt::Alignment alignment;
399 };
400 
401 struct LengthData {
403  enum { None, Px, Ex, Em } unit;
404 };
405 
406 struct BorderData {
410 };
411 
412 
413 // 1. StyleRule - x:hover, y:clicked > z:checked { prop1: value1; prop2: value2; }
414 // 2. QVector<Selector> - x:hover, y:clicked z:checked
415 // 3. QVector<BasicSelector> - y:clicked z:checked
416 // 4. QVector<Declaration> - { prop1: value1; prop2: value2; }
417 // 5. Declaration - prop1: value1;
418 
420 {
421  struct DeclarationData : public QSharedData
422  {
423  inline DeclarationData() : propertyId(UnknownProperty), important(false) {}
428  bool important;
429  };
431  inline Declaration() : d(new DeclarationData()) {}
432  inline bool isEmpty() const { return d->property.isEmpty() && d->propertyId == UnknownProperty; }
433 
434  // helper functions
435  QColor colorValue(const QPalette & = QPalette()) const;
436  void colorValues(QColor *c, const QPalette & = QPalette()) const;
437  QBrush brushValue(const QPalette & = QPalette()) const;
438  void brushValues(QBrush *c, const QPalette & = QPalette()) const;
439 
440  BorderStyle styleValue() const;
441  void styleValues(BorderStyle *s) const;
442 
443  Origin originValue() const;
444  Repeat repeatValue() const;
445  Qt::Alignment alignmentValue() const;
446  PositionMode positionValue() const;
447  Attachment attachmentValue() const;
448  int styleFeaturesValue() const;
449 
450  bool intValue(int *i, const char *unit = 0) const;
451  bool realValue(qreal *r, const char *unit = 0) const;
452 
453  QSize sizeValue() const;
454  QRect rectValue() const;
455  QString uriValue() const;
456  QIcon iconValue() const;
457 
458  void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const;
459 };
460 
461 const quint64 PseudoClass_Unknown = Q_UINT64_C(0x0000000000000000);
462 const quint64 PseudoClass_Enabled = Q_UINT64_C(0x0000000000000001);
463 const quint64 PseudoClass_Disabled = Q_UINT64_C(0x0000000000000002);
464 const quint64 PseudoClass_Pressed = Q_UINT64_C(0x0000000000000004);
465 const quint64 PseudoClass_Focus = Q_UINT64_C(0x0000000000000008);
466 const quint64 PseudoClass_Hover = Q_UINT64_C(0x0000000000000010);
467 const quint64 PseudoClass_Checked = Q_UINT64_C(0x0000000000000020);
468 const quint64 PseudoClass_Unchecked = Q_UINT64_C(0x0000000000000040);
469 const quint64 PseudoClass_Indeterminate = Q_UINT64_C(0x0000000000000080);
470 const quint64 PseudoClass_Unspecified = Q_UINT64_C(0x0000000000000100);
471 const quint64 PseudoClass_Selected = Q_UINT64_C(0x0000000000000200);
472 const quint64 PseudoClass_Horizontal = Q_UINT64_C(0x0000000000000400);
473 const quint64 PseudoClass_Vertical = Q_UINT64_C(0x0000000000000800);
474 const quint64 PseudoClass_Window = Q_UINT64_C(0x0000000000001000);
475 const quint64 PseudoClass_Children = Q_UINT64_C(0x0000000000002000);
476 const quint64 PseudoClass_Sibling = Q_UINT64_C(0x0000000000004000);
477 const quint64 PseudoClass_Default = Q_UINT64_C(0x0000000000008000);
478 const quint64 PseudoClass_First = Q_UINT64_C(0x0000000000010000);
479 const quint64 PseudoClass_Last = Q_UINT64_C(0x0000000000020000);
480 const quint64 PseudoClass_Middle = Q_UINT64_C(0x0000000000040000);
481 const quint64 PseudoClass_OnlyOne = Q_UINT64_C(0x0000000000080000);
482 const quint64 PseudoClass_PreviousSelected = Q_UINT64_C(0x0000000000100000);
483 const quint64 PseudoClass_NextSelected = Q_UINT64_C(0x0000000000200000);
484 const quint64 PseudoClass_Flat = Q_UINT64_C(0x0000000000400000);
485 const quint64 PseudoClass_Left = Q_UINT64_C(0x0000000000800000);
486 const quint64 PseudoClass_Right = Q_UINT64_C(0x0000000001000000);
487 const quint64 PseudoClass_Top = Q_UINT64_C(0x0000000002000000);
488 const quint64 PseudoClass_Bottom = Q_UINT64_C(0x0000000004000000);
489 const quint64 PseudoClass_Exclusive = Q_UINT64_C(0x0000000008000000);
490 const quint64 PseudoClass_NonExclusive = Q_UINT64_C(0x0000000010000000);
491 const quint64 PseudoClass_Frameless = Q_UINT64_C(0x0000000020000000);
492 const quint64 PseudoClass_ReadOnly = Q_UINT64_C(0x0000000040000000);
493 const quint64 PseudoClass_Active = Q_UINT64_C(0x0000000080000000);
494 const quint64 PseudoClass_Closable = Q_UINT64_C(0x0000000100000000);
495 const quint64 PseudoClass_Movable = Q_UINT64_C(0x0000000200000000);
496 const quint64 PseudoClass_Floatable = Q_UINT64_C(0x0000000400000000);
497 const quint64 PseudoClass_Minimized = Q_UINT64_C(0x0000000800000000);
498 const quint64 PseudoClass_Maximized = Q_UINT64_C(0x0000001000000000);
499 const quint64 PseudoClass_On = Q_UINT64_C(0x0000002000000000);
500 const quint64 PseudoClass_Off = Q_UINT64_C(0x0000004000000000);
501 const quint64 PseudoClass_Editable = Q_UINT64_C(0x0000008000000000);
502 const quint64 PseudoClass_Item = Q_UINT64_C(0x0000010000000000);
503 const quint64 PseudoClass_Closed = Q_UINT64_C(0x0000020000000000);
504 const quint64 PseudoClass_Open = Q_UINT64_C(0x0000040000000000);
505 const quint64 PseudoClass_EditFocus = Q_UINT64_C(0x0000080000000000);
506 const quint64 PseudoClass_Alternate = Q_UINT64_C(0x0000100000000000);
507 // The Any specifier is never generated, but can be used as a wildcard in searches.
508 const quint64 PseudoClass_Any = Q_UINT64_C(0x0000ffffffffffff);
509 const int NumPseudos = 46;
510 
511 struct Pseudo
512 {
513  Pseudo() : type(0), negated(false) { }
516  QString function;
517  bool negated;
518 };
519 
521 {
526  MatchBeginsWith
527  };
528  inline AttributeSelector() : valueMatchCriterium(NoMatch) {}
529 
533 };
534 
536 {
537  inline BasicSelector() : relationToNext(NoRelation) {}
538 
539  enum Relation {
543  MatchNextSelectorIfPreceeds
544  };
545 
547 
551 
553 };
554 
556 {
558  int specificity() const;
559  quint64 pseudoClass(quint64 *negated = 0) const;
560  QString pseudoElement() const;
561 };
562 
563 struct StyleRule;
564 struct MediaRule;
565 struct PageRule;
566 struct ImportRule;
567 
569 {
571 
572  bool extractFont(QFont *font, int *fontSizeAdjustment);
573  bool extractBackground(QBrush *, QString *, Repeat *, Qt::Alignment *, QCss::Origin *, QCss::Attachment *,
574  QCss::Origin *);
575  bool extractGeometry(int *w, int *h, int *minw, int *minh, int *maxw, int *maxh);
576  bool extractPosition(int *l, int *t, int *r, int *b, QCss::Origin *, Qt::Alignment *,
577  QCss::PositionMode *, Qt::Alignment *);
578  bool extractBox(int *margins, int *paddings, int *spacing = 0);
579  bool extractBorder(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii);
580  bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
581  bool extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg);
582  int extractStyleFeatures();
583  bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size);
584 
585  int lengthValue(const Declaration &decl);
586 
587 private:
588  void extractFont();
589  void borderValue(const Declaration &decl, int *width, QCss::BorderStyle *style, QBrush *color);
590  LengthData lengthValue(const Value& v);
591  void lengthValues(const Declaration &decl, int *m);
592  QSize sizeValue(const Declaration &decl);
593  void sizeValues(const Declaration &decl, QSize *radii);
594 
600 };
601 
602 struct StyleRule
603 {
604  StyleRule() : order(0) { }
607  int order;
608 };
609 
610 struct MediaRule
611 {
614 };
615 
616 struct PageRule
617 {
620 };
621 
623 {
626 };
627 
634 };
635 
637 {
638  StyleSheet() : origin(StyleSheetOrigin_Unspecified), depth(0) { }
639  QVector<StyleRule> styleRules; //only contains rules that are not indexed
644  int depth; // applicable only for inline style sheets
647  void buildIndexes(Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
648 };
649 
651 {
652 public:
653  StyleSelector() : nameCaseSensitivity(Qt::CaseSensitive) {}
654  virtual ~StyleSelector();
655 
656  union NodePtr {
657  void *ptr;
658  int id;
659  };
660 
661  QVector<StyleRule> styleRulesForNode(NodePtr node);
662  QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = 0);
663 
664  virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const;
665  virtual QString attribute(NodePtr node, const QString &name) const = 0;
666  virtual bool hasAttributes(NodePtr node) const = 0;
667  virtual QStringList nodeIds(NodePtr node) const;
668  virtual QStringList nodeNames(NodePtr node) const = 0;
669  virtual bool isNullNode(NodePtr node) const = 0;
670  virtual NodePtr parentNode(NodePtr node) const = 0;
671  virtual NodePtr previousSiblingNode(NodePtr node) const = 0;
672  virtual NodePtr duplicateNode(NodePtr node) const = 0;
673  virtual void freeNode(NodePtr node) const = 0;
674 
678 private:
679  void matchRule(NodePtr node, const StyleRule &rules, StyleSheetOrigin origin,
680  int depth, QMap<uint, StyleRule> *weightedRules);
681  bool selectorMatches(const Selector &rule, NodePtr node);
682  bool basicSelectorMatches(const BasicSelector &rule, NodePtr node);
683 };
684 
685 enum TokenType {
687 
688  S,
689 
694 
699 
702 
704 
706 
708 
710 
712 
715 
717 
731 };
732 
734 {
735  inline Symbol() : token(NONE), start(0), len(-1) {}
738  int start, len;
739  QString lexem() const;
740 };
741 
743 {
744 public:
745  static QString preprocess(const QString &input, bool *hasEscapeSequences = 0);
746  static void scan(const QString &preprocessedInput, QVector<Symbol> *symbols);
747 };
748 
750 {
751 public:
752  Parser();
753  Parser(const QString &css, bool file = false);
754 
755  void init(const QString &css, bool file = false);
756  bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
757  Symbol errorSymbol();
758 
759  bool parseImport(ImportRule *importRule);
760  bool parseMedia(MediaRule *mediaRule);
761  bool parseMedium(QStringList *media);
762  bool parsePage(PageRule *pageRule);
763  bool parsePseudoPage(QString *selector);
764  bool parseNextOperator(Value *value);
765  bool parseCombinator(BasicSelector::Relation *relation);
766  bool parseProperty(Declaration *decl);
767  bool parseRuleset(StyleRule *styleRule);
768  bool parseSelector(Selector *sel);
769  bool parseSimpleSelector(BasicSelector *basicSel);
770  bool parseClass(QString *name);
771  bool parseElementName(QString *name);
772  bool parseAttrib(AttributeSelector *attr);
773  bool parsePseudo(Pseudo *pseudo);
774  bool parseNextDeclaration(Declaration *declaration);
775  bool parsePrio(Declaration *declaration);
776  bool parseExpr(QVector<Value> *values);
777  bool parseTerm(Value *value);
778  bool parseFunction(QString *name, QString *args);
779  bool parseHexColor(QColor *col);
780  bool testAndParseUri(QString *uri);
781 
782  inline bool testRuleset() { return testSelector(); }
783  inline bool testSelector() { return testSimpleSelector(); }
784  inline bool parseNextSelector(Selector *sel) { if (!testSelector()) return recordError(); return parseSelector(sel); }
785  bool testSimpleSelector();
786  inline bool parseNextSimpleSelector(BasicSelector *basicSel) { if (!testSimpleSelector()) return recordError(); return parseSimpleSelector(basicSel); }
787  inline bool testElementName() { return test(IDENT) || test(STAR); }
788  inline bool testClass() { return test(DOT); }
789  inline bool testAttrib() { return test(LBRACKET); }
790  inline bool testPseudo() { return test(COLON); }
791  inline bool testMedium() { return test(IDENT); }
792  inline bool parseNextMedium(QStringList *media) { if (!testMedium()) return recordError(); return parseMedium(media); }
793  inline bool testPseudoPage() { return test(COLON); }
794  inline bool testImport() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("import")); }
795  inline bool testMedia() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("media")); }
796  inline bool testPage() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("page")); }
797  inline bool testCombinator() { return test(PLUS) || test(GREATER) || test(S); }
798  inline bool testProperty() { return test(IDENT); }
799  bool testTerm();
800  inline bool testExpr() { return testTerm(); }
801  inline bool parseNextExpr(QVector<Value> *values) { if (!testExpr()) return recordError(); return parseExpr(values); }
802  bool testPrio();
803  inline bool testHexColor() { return test(HASH); }
804  inline bool testFunction() { return test(FUNCTION); }
805  inline bool parseNextFunction(QString *name, QString *args) { if (!testFunction()) return recordError(); return parseFunction(name, args); }
806 
807  inline bool lookupElementName() const { return lookup() == IDENT || lookup() == STAR; }
808 
809  inline void skipSpace() { while (test(S)) {}; }
810 
811  inline bool hasNext() const { return index < symbols.count(); }
812  inline TokenType next() { return symbols.at(index++).token; }
813  bool next(TokenType t);
814  bool test(TokenType t);
815  inline void prev() { index--; }
816  inline const Symbol &symbol() const { return symbols.at(index - 1); }
817  inline QString lexem() const { return symbol().lexem(); }
818  QString unquotedLexem() const;
819  QString lexemUntil(TokenType t);
820  bool until(TokenType target, TokenType target2 = NONE);
821  inline TokenType lookup() const {
822  return (index - 1) < symbols.count() ? symbols.at(index - 1).token : NONE;
823  }
824 
825  bool testTokenAndEndsWith(TokenType t, const QLatin1String &str);
826 
827  inline bool recordError() { errorIndex = index; return false; }
828 
830  int index;
834 };
835 
836 } // namespace QCss
837 
839 
843 
844 
845 #endif // QT_NO_CSSPARSER
846 
847 #endif
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
const quint64 PseudoClass_Off
Definition: qcssparser_p.h:500
The QMultiHash class is a convenience QHash subclass that provides multi-valued hashes.
Definition: qcontainerfwd.h:58
QPalette::ColorRole role
Definition: qcssparser_p.h:381
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
const quint64 PseudoClass_Open
Definition: qcssparser_p.h:504
const quint64 PseudoClass_Closed
Definition: qcssparser_p.h:503
const quint64 PseudoClass_Last
Definition: qcssparser_p.h:479
const quint64 PseudoClass_Enabled
Definition: qcssparser_p.h:462
QString text
Definition: qcssparser_p.h:737
int type
Definition: qmetatype.cpp:239
QPalette::ColorRole role
Definition: qcssparser_p.h:390
double qreal
Definition: qglobal.h:1193
unsigned char c[8]
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QVector< Declaration > declarations
Definition: qcssparser_p.h:595
bool testMedium()
Definition: qcssparser_p.h:791
const quint64 PseudoClass_Any
Definition: qcssparser_p.h:508
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
Definition: qpalette.h:93
const quint64 PseudoClass_Exclusive
Definition: qcssparser_p.h:489
bool parseNextSelector(Selector *sel)
Definition: qcssparser_p.h:784
bool testImport()
Definition: qcssparser_p.h:794
QString selector
Definition: qcssparser_p.h:618
const quint64 PseudoClass_Focus
Definition: qcssparser_p.h:465
ColorData(const QColor &col)
Definition: qcssparser_p.h:378
const quint64 PseudoClass_Hover
Definition: qcssparser_p.h:466
QVector< BasicSelector > basicSelectors
Definition: qcssparser_p.h:557
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
const quint64 PseudoClass_Vertical
Definition: qcssparser_p.h:473
bool hasNext() const
Definition: qcssparser_p.h:811
const quint64 PseudoClass_Active
Definition: qcssparser_p.h:493
const quint64 PseudoClass_Middle
Definition: qcssparser_p.h:480
const quint64 PseudoClass_Minimized
Definition: qcssparser_p.h:497
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
LengthData width
Definition: qcssparser_p.h:407
bool recordError()
Definition: qcssparser_p.h:827
PositionMode
Definition: qcssparser_p.h:331
bool testElementName()
Definition: qcssparser_p.h:787
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString name
Definition: qcssparser_p.h:515
void skipSpace()
Definition: qcssparser_p.h:809
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
StyleSheetOrigin origin
Definition: qcssparser_p.h:643
const int NumPseudos
Definition: qcssparser_p.h:509
const quint64 PseudoClass_Pressed
Definition: qcssparser_p.h:464
const quint64 PseudoClass_ReadOnly
Definition: qcssparser_p.h:492
QVariant variant
Definition: qcssparser_p.h:372
QVector< Symbol > symbols
Definition: qcssparser_p.h:829
bool parseNextFunction(QString *name, QString *args)
Definition: qcssparser_p.h:805
const quint64 PseudoClass_Checked
Definition: qcssparser_p.h:467
bool testProperty()
Definition: qcssparser_p.h:798
const quint64 PseudoClass_Unchecked
Definition: qcssparser_p.h:468
QExplicitlySharedDataPointer< DeclarationData > d
Definition: qcssparser_p.h:430
const Symbol & symbol() const
Definition: qcssparser_p.h:816
TokenType next()
Definition: qcssparser_p.h:812
static QString toString(Register *reg, int type, bool *ok=0)
const quint64 PseudoClass_Horizontal
Definition: qcssparser_p.h:472
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QMultiHash< QString, StyleRule > idIndex
Definition: qcssparser_p.h:646
const quint64 PseudoClass_Unknown
Definition: qcssparser_p.h:461
QVector< Pseudo > pseudos
Definition: qcssparser_p.h:549
unsigned __int64 quint64
Definition: qglobal.h:943
const quint64 PseudoClass_Window
Definition: qcssparser_p.h:474
const quint64 PseudoClass_Left
Definition: qcssparser_p.h:485
QVector< Selector > selectors
Definition: qcssparser_p.h:605
const quint64 PseudoClass_Sibling
Definition: qcssparser_p.h:476
static bool init
const char * name
bool isEmpty() const
Definition: qcssparser_p.h:432
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
StyleSheetOrigin
Definition: qcssparser_p.h:628
bool testHexColor()
Definition: qcssparser_p.h:803
const quint64 PseudoClass_Movable
Definition: qcssparser_p.h:495
bool testClass()
Definition: qcssparser_p.h:788
TokenType token
Definition: qcssparser_p.h:736
BorderStyle style
Definition: qcssparser_p.h:408
const quint64 PseudoClass_NonExclusive
Definition: qcssparser_p.h:490
QVector< StyleRule > styleRules
Definition: qcssparser_p.h:639
static QVector< Declaration > declarations(const QVector< StyleRule > &styleRules, const QString &part, quint64 pseudoClass=PseudoClass_Unspecified)
const quint64 PseudoClass_Right
Definition: qcssparser_p.h:486
const quint64 PseudoClass_Bottom
Definition: qcssparser_p.h:488
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
quint64 type
Definition: qcssparser_p.h:514
const quint64 PseudoClass_Selected
Definition: qcssparser_p.h:471
bool parseNextMedium(QStringList *media)
Definition: qcssparser_p.h:792
QVector< MediaRule > mediaRules
Definition: qcssparser_p.h:640
QVector< StyleSheet > styleSheets
Definition: qcssparser_p.h:675
const quint64 PseudoClass_Flat
Definition: qcssparser_p.h:484
ColorData(QPalette::ColorRole r)
Definition: qcssparser_p.h:379
QVector< Declaration > declarations
Definition: qcssparser_p.h:606
const quint64 PseudoClass_Alternate
Definition: qcssparser_p.h:506
const quint64 PseudoClass_Frameless
Definition: qcssparser_p.h:491
quint16 values[128]
bool lookupElementName() const
Definition: qcssparser_p.h:807
bool testPage()
Definition: qcssparser_p.h:796
BrushData(QPalette::ColorRole r)
Definition: qcssparser_p.h:388
#define Q_DECLARE_METATYPE(TYPE)
This macro makes the type Type known to QMetaType as long as it provides a public default constructor...
Definition: qmetatype.h:265
const quint64 PseudoClass_Editable
Definition: qcssparser_p.h:501
#define None
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
bool testRuleset()
Definition: qcssparser_p.h:782
CaseSensitivity
Definition: qnamespace.h:1451
bool testFunction()
Definition: qcssparser_p.h:804
Qt::CaseSensitivity nameCaseSensitivity
Definition: qcssparser_p.h:677
bool testExpr()
Definition: qcssparser_p.h:800
const quint64 PseudoClass_OnlyOne
Definition: qcssparser_p.h:481
bool testMedia()
Definition: qcssparser_p.h:795
const quint64 PseudoClass_EditFocus
Definition: qcssparser_p.h:505
The QSharedData class is a base class for shared data objects.
Definition: qshareddata.h:56
const quint64 PseudoClass_PreviousSelected
Definition: qcssparser_p.h:482
QStringList media
Definition: qcssparser_p.h:612
bool testAttrib()
Definition: qcssparser_p.h:789
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
const quint64 PseudoClass_Unspecified
Definition: qcssparser_p.h:470
const quint64 PseudoClass_Children
Definition: qcssparser_p.h:475
const quint64 PseudoClass_Maximized
Definition: qcssparser_p.h:498
bool testPseudoPage()
Definition: qcssparser_p.h:793
bool parseNextSimpleSelector(BasicSelector *basicSel)
Definition: qcssparser_p.h:786
QMultiHash< QString, StyleRule > nameIndex
Definition: qcssparser_p.h:645
QString sourcePath
Definition: qcssparser_p.h:833
ValueMatchType valueMatchCriterium
Definition: qcssparser_p.h:532
bool testSelector()
Definition: qcssparser_p.h:783
const quint64 PseudoClass_Indeterminate
Definition: qcssparser_p.h:469
TokenType lookup() const
Definition: qcssparser_p.h:821
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Definition: qnamespace.h:54
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
QFactoryLoader * l
quint16 index
static quint64 pseudoClass(QStyle::State state)
bool testCombinator()
Definition: qcssparser_p.h:797
const quint64 PseudoClass_First
Definition: qcssparser_p.h:478
bool testPseudo()
Definition: qcssparser_p.h:790
QList< QAElement > lookup(const QList< QAInterface > &interfaces)
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Qt::Alignment alignment
Definition: qcssparser_p.h:398
QString lexem() const
Definition: qcssparser_p.h:817
const quint64 PseudoClass_Top
Definition: qcssparser_p.h:487
const quint64 PseudoClass_Default
Definition: qcssparser_p.h:477
StyleFeature
Definition: qcssparser_p.h:347
QVector< PageRule > pageRules
Definition: qcssparser_p.h:641
const quint64 PseudoClass_Closable
Definition: qcssparser_p.h:494
#define Q_UINT64_C(c)
Definition: qglobal.h:941
QVector< StyleRule > styleRules
Definition: qcssparser_p.h:613
const quint64 PseudoClass_Disabled
Definition: qcssparser_p.h:463
QVector< AttributeSelector > attributeSelectors
Definition: qcssparser_p.h:550
QVector< Declaration > declarations
Definition: qcssparser_p.h:619
bool hasEscapeSequences
Definition: qcssparser_p.h:832
const quint64 PseudoClass_Floatable
Definition: qcssparser_p.h:496
bool parseNextExpr(QVector< Value > *values)
Definition: qcssparser_p.h:801
The QMap class is a template class that provides a skip-list-based dictionary.
Definition: qdatastream.h:67
QVector< ImportRule > importRules
Definition: qcssparser_p.h:642
QStringList media
Definition: qcssparser_p.h:625
BrushData(const QBrush &br)
Definition: qcssparser_p.h:387
const quint64 PseudoClass_On
Definition: qcssparser_p.h:499
const quint64 PseudoClass_NextSelected
Definition: qcssparser_p.h:483
const quint64 PseudoClass_Item
Definition: qcssparser_p.h:502
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61
The QIcon class provides scalable icons in different modes and states.
Definition: qicon.h:60