1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
4
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
6
* Tomahawk is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* Tomahawk is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef DYNAMIC_VIEW_H
21
#define DYNAMIC_VIEW_H
23
#include "playlist/PlaylistView.h"
25
#include <QPropertyAnimation>
37
class DynamicView : public PlaylistView
41
explicit DynamicView( QWidget* parent = 0 );
42
virtual ~DynamicView();
44
virtual void setDynamicModel( DynamicModel* model );
46
void setOnDemand( bool onDemand );
47
void setReadOnly( bool readOnly );
49
void setDynamicWorking( bool working );
51
virtual void paintEvent( QPaintEvent* event );
54
void showMessageTimeout( const QString& title, const QString& body );
55
void showMessage( const QString& message );
57
// collapse and animate the transition
58
// there MUST be a row *after* startRow + num. that is, you can't collapse
59
// entries unless there is at least one entry after the last collapsed row
60
// optionally you can specify how many rows are past the block of collapsed rows
61
void collapseEntries( int startRow, int num, int numToKeep = 1 );
64
void onTrackCountChanged( unsigned int );
65
void checkForOverflow();
69
QPixmap backgroundBetween( QRect rect, int rowStart );
71
DynamicModel* m_model;
77
bool m_checkOnCollapse;
80
// for collapsing animation
81
QPoint m_fadingPointAnchor;
82
QPoint m_bottomAnchor;
83
QPoint m_bottomOfAnim;
84
QPixmap m_fadingIndexes;
85
QPixmap m_slidingIndex;
89
QTimeLine m_fadeOutAnim;
90
QTimeLine m_slideAnim;