Fix test fails related to QTBUG-22237
[profile/ivi/qtdeclarative.git] / src / declarative / items / qsgtranslate_p.h
1 // Commit: ac5c099cc3c5b8c7eec7a49fdeb8a21037230350
2 /****************************************************************************
3 **
4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
5 ** All rights reserved.
6 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 **
8 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 **
10 ** $QT_BEGIN_LICENSE:LGPL$
11 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this
15 ** file. Please review the following information to ensure the GNU Lesser
16 ** General Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** GNU General Public License Usage
24 ** Alternatively, this file may be used under the terms of the GNU General
25 ** Public License version 3.0 as published by the Free Software Foundation
26 ** and appearing in the file LICENSE.GPL included in the packaging of this
27 ** file. Please review the following information to ensure the GNU General
28 ** Public License version 3.0 requirements will be met:
29 ** http://www.gnu.org/copyleft/gpl.html.
30 **
31 ** Other Usage
32 ** Alternatively, this file may be used in accordance with the terms and
33 ** conditions contained in a signed written agreement between you and Nokia.
34 **
35 **
36 **
37 **
38 **
39 ** $QT_END_LICENSE$
40 **
41 ****************************************************************************/
42
43 #ifndef QSGTRANSLATE_P_H
44 #define QSGTRANSLATE_P_H
45
46 #include "qsgitem.h"
47
48 #include <QtGui/qmatrix4x4.h>
49
50 QT_BEGIN_HEADER
51
52 QT_BEGIN_NAMESPACE
53
54 QT_MODULE(Declarative)
55
56 class QSGTranslatePrivate;
57 class Q_AUTOTEST_EXPORT QSGTranslate : public QSGTransform
58 {
59     Q_OBJECT
60
61     Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
62     Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
63
64 public:
65     QSGTranslate(QObject *parent = 0);
66     ~QSGTranslate();
67
68     qreal x() const;
69     void setX(qreal);
70
71     qreal y() const;
72     void setY(qreal);
73
74     void applyTo(QMatrix4x4 *matrix) const;
75
76 Q_SIGNALS:
77     void xChanged();
78     void yChanged();
79
80 private:
81     Q_DECLARE_PRIVATE(QSGTranslate)
82     Q_DISABLE_COPY(QSGTranslate)
83 };
84
85 class QSGScalePrivate;
86 class Q_AUTOTEST_EXPORT QSGScale : public QSGTransform
87 {
88     Q_OBJECT
89
90     Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
91     Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged)
92     Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged)
93     Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged)
94 public:
95     QSGScale(QObject *parent = 0);
96     ~QSGScale();
97
98     QVector3D origin() const;
99     void setOrigin(const QVector3D &point);
100
101     qreal xScale() const;
102     void setXScale(qreal);
103
104     qreal yScale() const;
105     void setYScale(qreal);
106
107     qreal zScale() const;
108     void setZScale(qreal);
109
110     void applyTo(QMatrix4x4 *matrix) const;
111
112 Q_SIGNALS:
113     void originChanged();
114     void xScaleChanged();
115     void yScaleChanged();
116     void zScaleChanged();
117     void scaleChanged();
118
119 private:
120     Q_DECLARE_PRIVATE(QSGScale)
121 };
122
123 class QSGRotationPrivate;
124 class Q_AUTOTEST_EXPORT QSGRotation : public QSGTransform
125 {
126     Q_OBJECT
127
128     Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
129     Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
130     Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
131 public:
132     QSGRotation(QObject *parent = 0);
133     ~QSGRotation();
134
135     QVector3D origin() const;
136     void setOrigin(const QVector3D &point);
137
138     qreal angle() const;
139     void setAngle(qreal);
140
141     QVector3D axis() const;
142     void setAxis(const QVector3D &axis);
143     void setAxis(Qt::Axis axis);
144
145     void applyTo(QMatrix4x4 *matrix) const;
146
147 Q_SIGNALS:
148     void originChanged();
149     void angleChanged();
150     void axisChanged();
151
152 private:
153     Q_DECLARE_PRIVATE(QSGRotation)
154 };
155
156 QT_END_NAMESPACE
157
158 QML_DECLARE_TYPE(QSGTranslate)
159
160 QT_END_HEADER
161
162 #endif