2
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
3
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
5
* This program 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 2 of the License, or
8
* (at your option) any later version.
10
* This program 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 along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
#include "SourceTreeItem.h"
25
class TemporaryPageItem;
26
class GenericPageItem;
34
class SourceItem : public SourceTreeItem
38
SourceItem( SourcesModel* model, SourceTreeItem* parent, const Tomahawk::source_ptr& source );
40
virtual QString text() const;
41
virtual QString tooltip() const;
42
virtual QIcon icon() const;
43
virtual QPixmap pixmap( const QSize& size = QSize( 0, 0 ) ) const;
44
virtual int peerSortValue() const;
45
virtual int IDValue() const;
47
virtual bool localLatchedOn() const;
48
virtual Tomahawk::PlaylistModes::LatchMode localLatchMode() const;
50
Tomahawk::source_ptr source() const;
52
CategoryItem* stationsCategory() const;
53
CategoryItem* playlistsCategory() const;
54
void setStationsCategory( CategoryItem* item );
55
void setPlaylistsCategory( CategoryItem* item );
58
virtual void activate();
61
void onPlaylistsAdded( const QList<Tomahawk::playlist_ptr>& playlists );
62
void onPlaylistDeleted( const Tomahawk::playlist_ptr& playlists );
63
void onAutoPlaylistsAdded( const QList<Tomahawk::dynplaylist_ptr>& playlists );
64
void onAutoPlaylistDeleted( const Tomahawk::dynplaylist_ptr& playlists );
65
void onStationsAdded( const QList<Tomahawk::dynplaylist_ptr>& stations );
66
void onStationDeleted( const Tomahawk::dynplaylist_ptr& stations );
68
void latchedOn( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
69
void latchedOff( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
70
void latchModeChanged( Tomahawk::PlaylistModes::LatchMode mode );
72
void requestExpanding();
74
Tomahawk::ViewPage* sourceInfoClicked();
75
Tomahawk::ViewPage* getSourceInfoPage() const;
77
Tomahawk::ViewPage* collectionClicked();
78
Tomahawk::ViewPage* getCollectionPage() const;
80
Tomahawk::ViewPage* coolPlaylistsClicked();
81
Tomahawk::ViewPage* getCoolPlaylistsPage() const;
83
Tomahawk::ViewPage* latestAdditionsClicked();
84
Tomahawk::ViewPage* getLatestAdditionsPage() const;
86
Tomahawk::ViewPage* recentPlaysClicked();
87
Tomahawk::ViewPage* getRecentPlaysPage() const;
90
void playlistsAddedInternal( SourceTreeItem* parent, const QList< Tomahawk::dynplaylist_ptr >& playlists );
91
template< typename T >
92
void playlistDeletedInternal( SourceTreeItem* parent, const T& playlists );
94
Tomahawk::source_ptr m_source;
95
CategoryItem* m_playlists;
96
CategoryItem* m_stations;
99
Tomahawk::source_ptr m_latchedOnTo;
101
GenericPageItem* m_collectionItem;
102
GenericPageItem* m_sourceInfoItem;
103
GenericPageItem* m_coolPlaylistsItem;
104
GenericPageItem* m_latestAdditionsItem;
105
GenericPageItem* m_recentPlaysItem;
107
Tomahawk::ViewPage* m_collectionPage;
108
Tomahawk::ViewPage* m_sourceInfoPage;
109
Tomahawk::ViewPage* m_coolPlaylistsPage;
110
Tomahawk::ViewPage* m_latestAdditionsPage;
111
Tomahawk::ViewPage* m_recentPlaysPage;
112
Tomahawk::ViewPage* m_whatsHotPage;