Unity 8
easingcurve.h
1 /*
2  * Copyright 2014 Canonical Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17 */
18 
19 #ifndef EASINGCURVE_H
20 #define EASINGCURVE_H
21 
22 #include <QObject>
23 #include <QEasingCurve>
24 
36 class EasingCurve: public QObject
37 {
38  Q_OBJECT
39  Q_ENUMS(QEasingCurve::Type)
40  Q_PROPERTY(QEasingCurve::Type type READ type WRITE setType NOTIFY typeChanged)
41  Q_PROPERTY(qreal period READ period WRITE setPeriod NOTIFY periodChanged)
42  Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
43  Q_PROPERTY(qreal value READ value NOTIFY progressChanged)
44 
45 public:
46  EasingCurve(QObject *parent = 0);
47 
48  QEasingCurve::Type type() const;
49  void setType(const QEasingCurve::Type &type);
50 
51  qreal period() const;
52  void setPeriod(qreal period);
53 
54  qreal progress() const;
55  void setProgress(qreal progress);
56 
57  qreal value() const;
58 
59 Q_SIGNALS:
60  void typeChanged();
61  void periodChanged();
62  void progressChanged();
63 
64 private:
65  QEasingCurve m_easingCurve;
66  qreal m_progress;
67  qreal m_value;
68 };
69 
70 #endif
The EasingCurve class.
Definition: easingcurve.h:36