1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtQuick 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 The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QQUICKTRANSLATE_P_H
41#define QQUICKTRANSLATE_P_H
42
43//
44// W A R N I N G
45// -------------
46//
47// This file is not part of the Qt API. It exists purely as an
48// implementation detail. This header file may change from version to
49// version without notice, or even be removed.
50//
51// We mean it.
52//
53
54#include "qquickitem.h"
55
56#include <QtGui/qmatrix4x4.h>
57
58QT_BEGIN_NAMESPACE
59
60class QQuickTranslatePrivate;
61class Q_AUTOTEST_EXPORT QQuickTranslate : public QQuickTransform
62{
63 Q_OBJECT
64
65 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
66 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
67 QML_NAMED_ELEMENT(Translate)
68
69public:
70 QQuickTranslate(QObject *parent = nullptr);
71 ~QQuickTranslate();
72
73 qreal x() const;
74 void setX(qreal);
75
76 qreal y() const;
77 void setY(qreal);
78
79 void applyTo(QMatrix4x4 *matrix) const override;
80
81Q_SIGNALS:
82 void xChanged();
83 void yChanged();
84
85private:
86 Q_DECLARE_PRIVATE(QQuickTranslate)
87 Q_DISABLE_COPY(QQuickTranslate)
88};
89
90class QQuickScalePrivate;
91class Q_AUTOTEST_EXPORT QQuickScale : public QQuickTransform
92{
93 Q_OBJECT
94
95 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
96 Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged)
97 Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged)
98 Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged)
99 QML_NAMED_ELEMENT(Scale)
100public:
101 QQuickScale(QObject *parent = nullptr);
102 ~QQuickScale();
103
104 QVector3D origin() const;
105 void setOrigin(const QVector3D &point);
106
107 qreal xScale() const;
108 void setXScale(qreal);
109
110 qreal yScale() const;
111 void setYScale(qreal);
112
113 qreal zScale() const;
114 void setZScale(qreal);
115
116 void applyTo(QMatrix4x4 *matrix) const override;
117
118Q_SIGNALS:
119 void originChanged();
120 void xScaleChanged();
121 void yScaleChanged();
122 void zScaleChanged();
123 void scaleChanged();
124
125private:
126 Q_DECLARE_PRIVATE(QQuickScale)
127};
128
129class QQuickRotationPrivate;
130class Q_AUTOTEST_EXPORT QQuickRotation : public QQuickTransform
131{
132 Q_OBJECT
133
134 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
135 Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
136 Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
137 QML_NAMED_ELEMENT(Rotation)
138public:
139 QQuickRotation(QObject *parent = nullptr);
140 ~QQuickRotation();
141
142 QVector3D origin() const;
143 void setOrigin(const QVector3D &point);
144
145 qreal angle() const;
146 void setAngle(qreal);
147
148 QVector3D axis() const;
149 void setAxis(const QVector3D &axis);
150 void setAxis(Qt::Axis axis);
151
152 void applyTo(QMatrix4x4 *matrix) const override;
153
154Q_SIGNALS:
155 void originChanged();
156 void angleChanged();
157 void axisChanged();
158
159private:
160 Q_DECLARE_PRIVATE(QQuickRotation)
161};
162
163class QQuickMatrix4x4Private;
164class Q_AUTOTEST_EXPORT QQuickMatrix4x4 : public QQuickTransform
165{
166 Q_OBJECT
167
168 Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged)
169 QML_NAMED_ELEMENT(Matrix4x4)
170 QML_ADDED_IN_MINOR_VERSION(3)
171public:
172 QQuickMatrix4x4(QObject *parent = nullptr);
173 ~QQuickMatrix4x4();
174
175 QMatrix4x4 matrix() const;
176 void setMatrix(const QMatrix4x4& matrix);
177
178 void applyTo(QMatrix4x4 *matrix) const override;
179
180Q_SIGNALS:
181 void matrixChanged();
182
183private:
184 Q_DECLARE_PRIVATE(QQuickMatrix4x4)
185};
186
187
188QT_END_NAMESPACE
189
190QML_DECLARE_TYPE(QQuickTranslate)
191
192#endif
193

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