1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.core.easingcurve;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.global;
19 import qt.core.metatype;
20 import qt.core.objectdefs;
21 import qt.core.point;
22 import qt.core.typeinfo;
23 import qt.core.vector;
24 import qt.helpers;
25 
26 /+ QT_REQUIRE_CONFIG(easingcurve);
27 
28 #if QT_DEPRECATED_SINCE(5, 0)
29 #endif +/
30 
31 
32 
33 extern(C++, class) struct QEasingCurvePrivate;
34 /+ class QPointF; +/
35 @(QMetaType.Type.QEasingCurve) @Q_MOVABLE_TYPE extern(C++, class) struct /+ Q_CORE_EXPORT +/ QEasingCurve
36 {
37     mixin(Q_GADGET);
38 public:
39     enum Type {
40         Linear,
41         InQuad, OutQuad, InOutQuad, OutInQuad,
42         InCubic, OutCubic, InOutCubic, OutInCubic,
43         InQuart, OutQuart, InOutQuart, OutInQuart,
44         InQuint, OutQuint, InOutQuint, OutInQuint,
45         InSine, OutSine, InOutSine, OutInSine,
46         InExpo, OutExpo, InOutExpo, OutInExpo,
47         InCirc, OutCirc, InOutCirc, OutInCirc,
48         InElastic, OutElastic, InOutElastic, OutInElastic,
49         InBack, OutBack, InOutBack, OutInBack,
50         InBounce, OutBounce, InOutBounce, OutInBounce,
51         InCurve, OutCurve, SineCurve, CosineCurve,
52         BezierSpline, TCBSpline, Custom, NCurveTypes
53     }
54     /+ Q_ENUM(Type) +/
55 
56     @disable this();
57     this(Type type/+ = Type.Linear+/);
58     @disable this(this);
59     this(ref const(QEasingCurve) other);
60     ~this();
61 
62     /+ref QEasingCurve operator =(ref const(QEasingCurve) other)
63     { if ( &this != &other ) { auto copy = QEasingCurve(other); swap(copy); } return this; }+/
64     /+ QEasingCurve(QEasingCurve &&other) noexcept : d_ptr(other.d_ptr) { other.d_ptr = nullptr; } +/
65     /+ QEasingCurve &operator=(QEasingCurve &&other) noexcept
66     { qSwap(d_ptr, other.d_ptr); return *this; } +/
67 
68     /+ void swap(QEasingCurve &other) noexcept { qSwap(d_ptr, other.d_ptr); } +/
69 
70     /+bool operator ==(ref const(QEasingCurve) other) const;+/
71     /+pragma(inline, true) bool operator !=(ref const(QEasingCurve) other) const
72     { return !(this.operator==(other)); }+/
73 
74     qreal amplitude() const;
75     void setAmplitude(qreal amplitude);
76 
77     qreal period() const;
78     void setPeriod(qreal period);
79 
80     qreal overshoot() const;
81     void setOvershoot(qreal overshoot);
82 
83     void addCubicBezierSegment(ref const(QPointF)  c1, ref const(QPointF)  c2, ref const(QPointF)  endPoint);
84     void addTCBSegment(ref const(QPointF) nextPoint, qreal t, qreal c, qreal b);
85     QVector!(QPointF) toCubicSpline() const;
86 /+ #if QT_DEPRECATED_SINCE(5, 0)
87     QT_DEPRECATED QList<QPointF> cubicBezierSpline() const { return toCubicSpline().toList(); }
88 #endif +/
89 
90     Type type() const;
91     void setType(Type type);
92     alias EasingFunction = ExternCPPFunc!(qreal function(qreal progress));
93     void setCustomType(EasingFunction func);
94     EasingFunction customType() const;
95 
96     qreal valueForProgress(qreal progress) const;
97 private:
98     QEasingCurvePrivate* d_ptr;
99 /+ #ifndef QT_NO_DEBUG_STREAM
100     friend Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item);
101 #endif
102 #ifndef QT_NO_DATASTREAM +/
103     version(QT_NO_DATASTREAM){}else
104     {
105         /+ friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QEasingCurve&); +/
106         /+ friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &); +/
107     }
108 /+ #endif +/
109 }
110 /+ Q_DECLARE_SHARED(QEasingCurve)
111 
112 #ifndef QT_NO_DEBUG_STREAM
113 Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item);
114 #endif
115 
116 #ifndef QT_NO_DATASTREAM
117 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QEasingCurve&);
118 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &);
119 #endif +/
120