qskinny/src/layouts/QskStackBoxAnimator.h

80 lines
1.8 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_STACK_BOX_ANIMATOR_H
#define QSK_STACK_BOX_ANIMATOR_H
#include "QskGlobal.h"
#include "QskNamespace.h"
#include "QskAnimator.h"
2018-07-19 14:10:48 +02:00
#include <qobject.h>
2017-07-21 18:21:34 +02:00
class QskStackBox;
class QskLayoutItem;
class QSK_EXPORT QskStackBoxAnimator : public QObject, public QskAnimator
{
Q_OBJECT
public:
QskStackBoxAnimator( QskStackBox* parent );
2018-07-31 17:32:25 +02:00
~QskStackBoxAnimator() override;
2017-07-21 18:21:34 +02:00
void setStartIndex( int index );
void setEndIndex( int index );
int startIndex() const;
int endIndex() const;
protected:
QskStackBox* stackBox() const;
QskLayoutItem* layoutItemAt( int index ) const;
void resizeItemAt( int index );
private:
int m_startIndex;
int m_endIndex;
};
class QSK_EXPORT QskStackBoxAnimator1 : public QskStackBoxAnimator
{
Q_OBJECT
public:
QskStackBoxAnimator1( QskStackBox* parent );
2018-07-31 17:32:25 +02:00
~QskStackBoxAnimator1() override;
2017-07-21 18:21:34 +02:00
void setOrientation( Qt::Orientation );
Qt::Orientation orientation() const;
protected:
2018-07-31 17:32:25 +02:00
void setup() override;
void advance( qreal value ) override;
void done() override;
2017-07-21 18:21:34 +02:00
private:
qreal m_itemOffset[2];
Qt::Orientation m_orientation : 2;
Qsk::Direction m_direction : 4;
bool m_hasClip : 1;
};
class QSK_EXPORT QskStackBoxAnimator3 : public QskStackBoxAnimator
{
Q_OBJECT
public:
QskStackBoxAnimator3( QskStackBox* parent );
2018-07-31 17:32:25 +02:00
~QskStackBoxAnimator3() override;
2017-07-21 18:21:34 +02:00
protected:
2018-07-31 17:32:25 +02:00
void setup() override;
void advance( qreal value ) override;
void done() override;
2017-07-21 18:21:34 +02:00
};
#endif