qskinny/src/controls/QskAnimationHint.h

55 lines
1.4 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_ANIMATION_HINT_H
#define QSK_ANIMATION_HINT_H
#include "QskGlobal.h"
2018-07-19 14:10:48 +02:00
#include <qeasingcurve.h>
#include <qmetatype.h>
2017-07-21 18:21:34 +02:00
class QSK_EXPORT QskAnimationHint
{
2018-08-03 08:15:28 +02:00
public:
enum UpdateFlag
{
UpdateAuto = 0, // depending on the animated aspect
UpdateNode = 1 << 0,
UpdatePolish = 1 << 1,
UpdateSizeHint = 1 << 2,
UpdateAll = UpdateNode | UpdatePolish | UpdateSizeHint
};
Q_DECLARE_FLAGS( UpdateFlags, UpdateFlag )
2018-08-03 08:15:28 +02:00
inline constexpr QskAnimationHint() noexcept
: duration( 0 )
, type( QEasingCurve::Linear )
, updateFlags( UpdateAuto )
2017-07-21 18:21:34 +02:00
{
}
inline constexpr QskAnimationHint( uint duration,
2018-08-03 08:15:28 +02:00
QEasingCurve::Type type = QEasingCurve::Linear ) noexcept
: duration( duration )
, type( type )
, updateFlags( UpdateAuto )
2017-07-21 18:21:34 +02:00
{
}
uint duration;
QEasingCurve::Type type;
UpdateFlags updateFlags;
2017-07-21 18:21:34 +02:00
};
Q_DECLARE_METATYPE( QskAnimationHint )
Q_DECLARE_TYPEINFO( QskAnimationHint, Q_PRIMITIVE_TYPE );
Q_DECLARE_OPERATORS_FOR_FLAGS( QskAnimationHint::UpdateFlags )
2017-07-21 18:21:34 +02:00
#endif