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

« back to all changes in this revision

Viewing changes to src/libtomahawk/playlist/TreeProxyModelPlaylistInterface.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-2012, 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 TREEPROXYMODELPLAYLISTINTERFACE_H
 
21
#define TREEPROXYMODELPLAYLISTINTERFACE_H
 
22
 
 
23
#include "PlaylistInterface.h"
 
24
#include "TreeModel.h"
 
25
 
 
26
#include "DllMacro.h"
 
27
 
 
28
class DatabaseCommand_AllArtists;
 
29
class TreeProxyModel;
 
30
 
 
31
namespace Tomahawk
 
32
{
 
33
 
 
34
class DLLEXPORT TreeProxyModelPlaylistInterface : public Tomahawk::PlaylistInterface
 
35
{
 
36
Q_OBJECT
 
37
 
 
38
public:
 
39
    explicit TreeProxyModelPlaylistInterface( TreeProxyModel* proxyModel );
 
40
    virtual ~TreeProxyModelPlaylistInterface();
 
41
 
 
42
    virtual QList< Tomahawk::query_ptr > tracks() const;
 
43
    virtual int trackCount() const;
 
44
 
 
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;
 
49
 
 
50
    virtual void setCurrentIndex( qint64 index );
 
51
    virtual Tomahawk::result_ptr currentItem() const;
 
52
    virtual qint64 siblingIndex( int itemsAway, qint64 rootIndex = -1 ) const;
 
53
 
 
54
    virtual QString filter() const;
 
55
 
 
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; }
 
59
 
 
60
signals:
 
61
    void filterChanged( const QString& filter );
 
62
    void filteringStarted();
 
63
    void filteringFinished();
 
64
 
 
65
public slots:
 
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 ); }
 
68
 
 
69
private:
 
70
    QWeakPointer< TreeProxyModel > m_proxyModel;
 
71
 
 
72
    PlaylistModes::RepeatMode m_repeatMode;
 
73
    bool m_shuffled;
 
74
};
 
75
 
 
76
} //ns
 
77
 
 
78
#endif // TREEPROXYMODELPLAYLISTINTERFACE_H