1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.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/>.
24
#include "PlaylistInterface.h"
27
#include "utils/TomahawkUtils.h"
28
#include "playlist/PlaylistUpdaterInterface.h"
30
#include <QtGui/QPixmap>
36
class DLLEXPORT ViewPage
39
enum DescriptionType {
48
virtual QWidget* widget() = 0;
49
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
51
virtual QString title() const = 0;
53
virtual DescriptionType descriptionType() { return TextType; }
54
virtual QString description() const = 0;
55
virtual Tomahawk::artist_ptr descriptionArtist() const { return Tomahawk::artist_ptr(); }
56
virtual Tomahawk::album_ptr descriptionAlbum() const { return Tomahawk::album_ptr(); }
58
virtual QString longDescription() const { return QString(); }
59
virtual QPixmap pixmap() const { return QPixmap( RESPATH "icons/tomahawk-icon-128x128.png" ); }
61
virtual bool showInfoBar() const { return true; }
62
virtual bool showFilter() const { return false; }
63
virtual bool queueVisible() const { return true; }
65
virtual QString filter() const { return m_filter; }
66
virtual bool setFilter( const QString& filter );
68
virtual bool jumpToCurrentTrack() = 0;
70
virtual bool isTemporaryPage() const { return false; }
71
virtual bool isBeingPlayed() const { return false; }
73
virtual QList<PlaylistUpdaterInterface*> updaters() const { return QList<PlaylistUpdaterInterface*>(); }
75
/** subclasses implementing ViewPage can emit the following signals:
76
* nameChanged( const QString& )
77
* descriptionChanged( const QString& )
78
* descriptionChanged( const Tomahawk::artist_ptr& artist )
79
* descriptionChanged( const Tomahawk::album_ptr& album )
80
* longDescriptionChanged( const QString& )
81
* pixmapChanged( const QPixmap& )
82
* destroyed( QWidget* widget );
84
* See DynamicWidget for an example