1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
5
* Tomahawk is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* Tomahawk is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef FLEXIBLEVIEW_H
20
#define FLEXIBLEVIEW_H
23
#include "PlaylistInterface.h"
34
class DLLEXPORT FlexibleView : public QWidget, public Tomahawk::ViewPage
40
{ Flat = 0, Detailed = 1, Grid = 2 };
42
explicit FlexibleView( QWidget* parent = 0 );
45
virtual QWidget* widget() { return this; }
46
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
48
virtual QString title() const;
49
virtual QString description() const;
50
virtual QPixmap pixmap() const;
52
virtual bool showInfoBar() const { return false; }
53
virtual bool jumpToCurrentTrack();
55
TrackView* trackView() const { return m_trackView; }
56
TrackView* detailedView() const { return m_detailedView; }
57
GridView* gridView() const { return m_gridView; }
59
void setGuid( const QString& guid );
61
void setTrackView( TrackView* view );
62
void setDetailedView( TrackView* view );
63
void setGridView( GridView* view );
65
void setPlayableModel( PlayableModel* model );
66
void setPlaylistModel( PlaylistModel* model );
68
void setPixmap( const QPixmap& pixmap );
69
void setEmptyTip( const QString& tip );
72
void setCurrentMode( FlexibleViewMode mode );
73
virtual bool setFilter( const QString& pattern );
76
void modeChanged( FlexibleViewMode mode );
77
void destroyed( QWidget* widget );
80
void onModelChanged();
81
void onWidgetDestroyed( QWidget* widget );
84
FlexibleHeader* m_header;
87
TrackView* m_trackView;
88
TrackView* m_detailedView;
91
PlayableModel* m_model;
92
QStackedWidget* m_stack;
94
FlexibleViewMode m_mode;
97
Q_DECLARE_METATYPE( FlexibleView::FlexibleViewMode );
99
#endif // FLEXIBLEVIEW_H