| 1 | // Copyright (C) 2016 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QQUICKTRANSLATE_P_H | 
| 5 | #define QQUICKTRANSLATE_P_H | 
| 6 |  | 
| 7 | // | 
| 8 | //  W A R N I N G | 
| 9 | //  ------------- | 
| 10 | // | 
| 11 | // This file is not part of the Qt API.  It exists purely as an | 
| 12 | // implementation detail.  This header file may change from version to | 
| 13 | // version without notice, or even be removed. | 
| 14 | // | 
| 15 | // We mean it. | 
| 16 | // | 
| 17 |  | 
| 18 | #include <private/qtquickglobal_p.h> | 
| 19 |  | 
| 20 | #include <QtQuick/qquickitem.h> | 
| 21 |  | 
| 22 | #include <QtGui/qmatrix4x4.h> | 
| 23 |  | 
| 24 | QT_BEGIN_NAMESPACE | 
| 25 |  | 
| 26 | class QQuickTranslatePrivate; | 
| 27 | class Q_QUICK_EXPORT QQuickTranslate : public QQuickTransform | 
| 28 | { | 
| 29 |     Q_OBJECT | 
| 30 |  | 
| 31 |     Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) | 
| 32 |     Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) | 
| 33 |     QML_NAMED_ELEMENT(Translate) | 
| 34 |     QML_ADDED_IN_VERSION(2, 0) | 
| 35 |  | 
| 36 | public: | 
| 37 |     QQuickTranslate(QObject *parent = nullptr); | 
| 38 |  | 
| 39 |     qreal x() const; | 
| 40 |     void setX(qreal); | 
| 41 |  | 
| 42 |     qreal y() const; | 
| 43 |     void setY(qreal); | 
| 44 |  | 
| 45 |     void applyTo(QMatrix4x4 *matrix) const override; | 
| 46 |  | 
| 47 | Q_SIGNALS: | 
| 48 |     void xChanged(); | 
| 49 |     void yChanged(); | 
| 50 |  | 
| 51 | private: | 
| 52 |     Q_DECLARE_PRIVATE(QQuickTranslate) | 
| 53 | }; | 
| 54 |  | 
| 55 | class QQuickScalePrivate; | 
| 56 | class Q_QUICK_EXPORT QQuickScale : public QQuickTransform | 
| 57 | { | 
| 58 |     Q_OBJECT | 
| 59 |  | 
| 60 |     Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged) | 
| 61 |     Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged) | 
| 62 |     Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged) | 
| 63 |     Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged) | 
| 64 |     QML_NAMED_ELEMENT(Scale) | 
| 65 |     QML_ADDED_IN_VERSION(2, 0) | 
| 66 | public: | 
| 67 |     QQuickScale(QObject *parent = nullptr); | 
| 68 |  | 
| 69 |     QVector3D origin() const; | 
| 70 |     void setOrigin(const QVector3D &point); | 
| 71 |  | 
| 72 |     qreal xScale() const; | 
| 73 |     void setXScale(qreal); | 
| 74 |  | 
| 75 |     qreal yScale() const; | 
| 76 |     void setYScale(qreal); | 
| 77 |  | 
| 78 |     qreal zScale() const; | 
| 79 |     void setZScale(qreal); | 
| 80 |  | 
| 81 |     void applyTo(QMatrix4x4 *matrix) const override; | 
| 82 |  | 
| 83 | Q_SIGNALS: | 
| 84 |     void originChanged(); | 
| 85 |     void xScaleChanged(); | 
| 86 |     void yScaleChanged(); | 
| 87 |     void zScaleChanged(); | 
| 88 |     void scaleChanged(); | 
| 89 |  | 
| 90 | private: | 
| 91 |     Q_DECLARE_PRIVATE(QQuickScale) | 
| 92 | }; | 
| 93 |  | 
| 94 | class QQuickRotationPrivate; | 
| 95 | class Q_QUICK_EXPORT QQuickRotation : public QQuickTransform | 
| 96 | { | 
| 97 |     Q_OBJECT | 
| 98 |  | 
| 99 |     Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged) | 
| 100 |     Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged) | 
| 101 |     Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged) | 
| 102 |     QML_NAMED_ELEMENT(Rotation) | 
| 103 |     QML_ADDED_IN_VERSION(2, 0) | 
| 104 | public: | 
| 105 |     QQuickRotation(QObject *parent = nullptr); | 
| 106 |  | 
| 107 |     QVector3D origin() const; | 
| 108 |     void setOrigin(const QVector3D &point); | 
| 109 |  | 
| 110 |     qreal angle() const; | 
| 111 |     void setAngle(qreal); | 
| 112 |  | 
| 113 |     QVector3D axis() const; | 
| 114 |     void setAxis(const QVector3D &axis); | 
| 115 |     void setAxis(Qt::Axis axis); | 
| 116 |  | 
| 117 |     void applyTo(QMatrix4x4 *matrix) const override; | 
| 118 |  | 
| 119 | Q_SIGNALS: | 
| 120 |     void originChanged(); | 
| 121 |     void angleChanged(); | 
| 122 |     void axisChanged(); | 
| 123 |  | 
| 124 | private: | 
| 125 |     Q_DECLARE_PRIVATE(QQuickRotation) | 
| 126 | }; | 
| 127 |  | 
| 128 | class QQuickMatrix4x4Private; | 
| 129 | class Q_QUICK_EXPORT QQuickMatrix4x4 : public QQuickTransform | 
| 130 | { | 
| 131 |     Q_OBJECT | 
| 132 |  | 
| 133 |     Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged) | 
| 134 |     QML_NAMED_ELEMENT(Matrix4x4) | 
| 135 |     QML_ADDED_IN_VERSION(2, 3) | 
| 136 | public: | 
| 137 |     QQuickMatrix4x4(QObject *parent = nullptr); | 
| 138 |  | 
| 139 |     QMatrix4x4 matrix() const; | 
| 140 |     void setMatrix(const QMatrix4x4& matrix); | 
| 141 |  | 
| 142 |     void applyTo(QMatrix4x4 *matrix) const override; | 
| 143 |  | 
| 144 | Q_SIGNALS: | 
| 145 |     void matrixChanged(); | 
| 146 |  | 
| 147 | private: | 
| 148 |     Q_DECLARE_PRIVATE(QQuickMatrix4x4) | 
| 149 | }; | 
| 150 |  | 
| 151 |  | 
| 152 | QT_END_NAMESPACE | 
| 153 |  | 
| 154 | #endif | 
| 155 |  |