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
24QT_BEGIN_NAMESPACE
25
26class QQuickTranslatePrivate;
27class Q_QUICK_PRIVATE_EXPORT QQuickTranslate : public QQuickTransform
28{
29 Q_OBJECT
30
31 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL)
32 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL)
33 QML_NAMED_ELEMENT(Translate)
34 QML_ADDED_IN_VERSION(2, 0)
35
36public:
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
47Q_SIGNALS:
48 void xChanged();
49 void yChanged();
50
51private:
52 Q_DECLARE_PRIVATE(QQuickTranslate)
53};
54
55class QQuickScalePrivate;
56class Q_QUICK_PRIVATE_EXPORT QQuickScale : public QQuickTransform
57{
58 Q_OBJECT
59
60 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged FINAL)
61 Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged FINAL)
62 Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged FINAL)
63 Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged FINAL)
64 QML_NAMED_ELEMENT(Scale)
65 QML_ADDED_IN_VERSION(2, 0)
66public:
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
83Q_SIGNALS:
84 void originChanged();
85 void xScaleChanged();
86 void yScaleChanged();
87 void zScaleChanged();
88 void scaleChanged();
89
90private:
91 Q_DECLARE_PRIVATE(QQuickScale)
92};
93
94class QQuickRotationPrivate;
95class Q_QUICK_PRIVATE_EXPORT QQuickRotation : public QQuickTransform
96{
97 Q_OBJECT
98
99 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged FINAL)
100 Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged FINAL)
101 Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged FINAL)
102 QML_NAMED_ELEMENT(Rotation)
103 QML_ADDED_IN_VERSION(2, 0)
104public:
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
119Q_SIGNALS:
120 void originChanged();
121 void angleChanged();
122 void axisChanged();
123
124private:
125 Q_DECLARE_PRIVATE(QQuickRotation)
126};
127
128class QQuickMatrix4x4Private;
129class Q_QUICK_PRIVATE_EXPORT QQuickMatrix4x4 : public QQuickTransform
130{
131 Q_OBJECT
132
133 Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged FINAL)
134 QML_NAMED_ELEMENT(Matrix4x4)
135 QML_ADDED_IN_VERSION(2, 3)
136public:
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
144Q_SIGNALS:
145 void matrixChanged();
146
147private:
148 Q_DECLARE_PRIVATE(QQuickMatrix4x4)
149};
150
151
152QT_END_NAMESPACE
153
154QML_DECLARE_TYPE(QQuickTranslate)
155
156#endif
157

source code of qtdeclarative/src/quick/items/qquicktranslate_p.h