~ubuntu-branches/ubuntu/trusty/tomahawk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libtomahawk/ViewPage.h

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2013-03-07 21:50:13 UTC
  • Revision ID: package-import@ubuntu.com-20130307215013-6gdjkdds7i9uenvs
Tags: upstream-0.6.0+dfsg
ImportĀ upstreamĀ versionĀ 0.6.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 
2
 *
 
3
 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 
4
 *   Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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/>.
 
18
 */
 
19
 
 
20
#ifndef VIEWPAGE_H
 
21
#define VIEWPAGE_H
 
22
 
 
23
#include "Typedefs.h"
 
24
#include "PlaylistInterface.h"
 
25
#include "Artist.h"
 
26
#include "Album.h"
 
27
#include "utils/TomahawkUtils.h"
 
28
#include "playlist/PlaylistUpdaterInterface.h"
 
29
 
 
30
#include <QtGui/QPixmap>
 
31
 
 
32
namespace Tomahawk
 
33
{
 
34
 
 
35
 
 
36
class DLLEXPORT ViewPage
 
37
{
 
38
public:
 
39
    enum DescriptionType {
 
40
        TextType = 0,
 
41
        ArtistType = 1,
 
42
        AlbumType = 2
 
43
    };
 
44
 
 
45
    ViewPage() {}
 
46
    virtual ~ViewPage();
 
47
 
 
48
    virtual QWidget* widget() = 0;
 
49
    virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
 
50
 
 
51
    virtual QString title() const = 0;
 
52
 
 
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(); }
 
57
 
 
58
    virtual QString longDescription() const { return QString(); }
 
59
    virtual QPixmap pixmap() const { return QPixmap( RESPATH "icons/tomahawk-icon-128x128.png" ); }
 
60
 
 
61
    virtual bool showInfoBar() const { return true; }
 
62
    virtual bool showFilter() const { return false; }
 
63
    virtual bool queueVisible() const { return true; }
 
64
 
 
65
    virtual QString filter() const { return m_filter; }
 
66
    virtual bool setFilter( const QString& filter );
 
67
 
 
68
    virtual bool jumpToCurrentTrack() = 0;
 
69
 
 
70
    virtual bool isTemporaryPage() const { return false; }
 
71
    virtual bool isBeingPlayed() const { return false; }
 
72
 
 
73
    virtual QList<PlaylistUpdaterInterface*> updaters() const { return QList<PlaylistUpdaterInterface*>(); }
 
74
 
 
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 );
 
83
     *
 
84
     * See DynamicWidget for an example
 
85
     */
 
86
 
 
87
private:
 
88
    QString m_filter;
 
89
};
 
90
 
 
91
}; // ns
 
92
 
 
93
#endif //VIEWPAGE_H