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-2012, 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 TREEPROXYMODELPLAYLISTINTERFACE_H
21
#define TREEPROXYMODELPLAYLISTINTERFACE_H
23
#include "PlaylistInterface.h"
24
#include "TreeModel.h"
28
class DatabaseCommand_AllArtists;
34
class DLLEXPORT TreeProxyModelPlaylistInterface : public Tomahawk::PlaylistInterface
39
explicit TreeProxyModelPlaylistInterface( TreeProxyModel* proxyModel );
40
virtual ~TreeProxyModelPlaylistInterface();
42
virtual QList< Tomahawk::query_ptr > tracks() const;
43
virtual int trackCount() const;
45
virtual Tomahawk::result_ptr resultAt( qint64 index ) const;
46
virtual Tomahawk::query_ptr queryAt( qint64 index ) const;
47
virtual qint64 indexOfResult( const Tomahawk::result_ptr& result ) const;
48
virtual qint64 indexOfQuery( const Tomahawk::query_ptr& query ) const;
50
virtual void setCurrentIndex( qint64 index );
51
virtual Tomahawk::result_ptr currentItem() const;
52
virtual qint64 siblingIndex( int itemsAway, qint64 rootIndex = -1 ) const;
54
virtual QString filter() const;
56
virtual PlaylistModes::RepeatMode repeatMode() const { return m_repeatMode; }
57
virtual bool shuffled() const { return m_shuffled; }
58
virtual PlaylistModes::ViewMode viewMode() const { return PlaylistModes::Tree; }
61
void filterChanged( const QString& filter );
62
void filteringStarted();
63
void filteringFinished();
66
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode ) { m_repeatMode = mode; emit repeatModeChanged( mode ); }
67
virtual void setShuffled( bool enabled ) { m_shuffled = enabled; emit shuffleModeChanged( enabled ); }
70
QWeakPointer< TreeProxyModel > m_proxyModel;
72
PlaylistModes::RepeatMode m_repeatMode;
78
#endif // TREEPROXYMODELPLAYLISTINTERFACE_H