QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskAnimationHint.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_ANIMATION_HINT_H
7#define QSK_ANIMATION_HINT_H
8
9#include "QskGlobal.h"
10
11#include <qeasingcurve.h>
12#include <qmetatype.h>
13
14class QSK_EXPORT QskAnimationHint
15{
16 public:
17 enum UpdateFlag
18 {
19 UpdateAuto = 0, // depending on the animated aspect
20
21 UpdateNode = 1 << 0,
22 UpdatePolish = 1 << 1,
23 UpdateSizeHint = 1 << 2,
24
25 UpdateAll = UpdateNode | UpdatePolish | UpdateSizeHint
26 };
27
28 Q_DECLARE_FLAGS( UpdateFlags, UpdateFlag )
29
30 inline constexpr QskAnimationHint() noexcept
31 : duration( 0 )
32 , type( QEasingCurve::Linear )
33 , updateFlags( UpdateAuto )
34 {
35 }
36
37 inline constexpr QskAnimationHint( uint duration,
38 QEasingCurve::Type type = QEasingCurve::Linear ) noexcept
39 : duration( duration )
40 , type( type )
41 , updateFlags( UpdateAuto )
42 {
43 }
44
45 inline constexpr bool isValid() const
46 {
47 return duration > 0;
48 }
49
50 uint duration;
51 QEasingCurve::Type type;
52 UpdateFlags updateFlags;
53};
54
55Q_DECLARE_METATYPE( QskAnimationHint )
56Q_DECLARE_TYPEINFO( QskAnimationHint, Q_PRIMITIVE_TYPE );
57Q_DECLARE_OPERATORS_FOR_FLAGS( QskAnimationHint::UpdateFlags )
58
59#ifndef QT_NO_DEBUG_STREAM
60
61class QDebug;
62QSK_EXPORT QDebug operator<<( QDebug, const QskAnimationHint& );
63
64#endif
65
66#endif