Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:59

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QGLYPHRUN_H
0005 #define QGLYPHRUN_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qlist.h>
0009 #include <QtCore/qpoint.h>
0010 #include <QtGui/qrawfont.h>
0011 #include <QtCore/qshareddata.h>
0012 
0013 #if !defined(QT_NO_RAWFONT)
0014 
0015 QT_BEGIN_NAMESPACE
0016 
0017 
0018 class QGlyphRunPrivate;
0019 class Q_GUI_EXPORT QGlyphRun
0020 {
0021 public:
0022     enum GlyphRunFlag {
0023         Overline        = 0x01,
0024         Underline       = 0x02,
0025         StrikeOut       = 0x04,
0026         RightToLeft     = 0x08,
0027         SplitLigature   = 0x10
0028     };
0029     Q_DECLARE_FLAGS(GlyphRunFlags, GlyphRunFlag)
0030 
0031     QGlyphRun();
0032     QGlyphRun(const QGlyphRun &other);
0033     QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGlyphRun)
0034     QGlyphRun &operator=(const QGlyphRun &other);
0035     ~QGlyphRun();
0036 
0037     void swap(QGlyphRun &other) noexcept { d.swap(other.d); }
0038 
0039     QRawFont rawFont() const;
0040     void setRawFont(const QRawFont &rawFont);
0041 
0042     void setRawData(const quint32 *glyphIndexArray,
0043                     const QPointF *glyphPositionArray,
0044                     int size);
0045 
0046     QList<quint32> glyphIndexes() const;
0047     void setGlyphIndexes(const QList<quint32> &glyphIndexes);
0048 
0049     QList<QPointF> positions() const;
0050     void setPositions(const QList<QPointF> &positions);
0051 
0052     void clear();
0053 
0054     bool operator==(const QGlyphRun &other) const;
0055     inline bool operator!=(const QGlyphRun &other) const
0056     { return !operator==(other); }
0057 
0058     void setOverline(bool overline);
0059     bool overline() const;
0060 
0061     void setUnderline(bool underline);
0062     bool underline() const;
0063 
0064     void setStrikeOut(bool strikeOut);
0065     bool strikeOut() const;
0066 
0067     void setRightToLeft(bool on);
0068     bool isRightToLeft() const;
0069 
0070     void setFlag(GlyphRunFlag flag, bool enabled = true);
0071     void setFlags(GlyphRunFlags flags);
0072     GlyphRunFlags flags() const;
0073 
0074     void setBoundingRect(const QRectF &boundingRect);
0075     QRectF boundingRect() const;
0076 
0077     QList<qsizetype> stringIndexes() const;
0078     void setStringIndexes(const QList<qsizetype> &stringIndexes);
0079 
0080     void setSourceString(const QString &sourceString);
0081     QString sourceString() const;
0082 
0083     bool isEmpty() const;
0084 
0085 private:
0086     friend class QGlyphRunPrivate;
0087     friend class QTextLine;
0088 
0089     QGlyphRun operator+(const QGlyphRun &other) const;
0090     QGlyphRun &operator+=(const QGlyphRun &other);
0091 
0092     void detach();
0093     QExplicitlySharedDataPointer<QGlyphRunPrivate> d;
0094 };
0095 
0096 Q_DECLARE_SHARED(QGlyphRun)
0097 
0098 QT_END_NAMESPACE
0099 
0100 #endif // QT_NO_RAWFONT
0101 
0102 #endif // QGLYPHRUN_H