PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 1ms

/src/libtomahawk/playlist/playlistview.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 67 lines | 36 code | 13 blank | 18 comment | 0 complexity | c247c7c986f50ebc80911e62b181e5de MD5 | raw file
 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 PLAYLISTVIEW_H
21#define PLAYLISTVIEW_H
22
23#include "playlist/PlayableProxyModel.h"
24#include "playlist/PlaylistModel.h"
25#include "TrackView.h"
26#include "ViewPage.h"
27#include "DllMacro.h"
28
29class DLLEXPORT PlaylistView : public TrackView
30{
31Q_OBJECT
32
33public:
34    explicit PlaylistView( QWidget* parent = 0 );
35    virtual ~PlaylistView();
36
37    PlaylistModel* playlistModel() const { return m_model; }
38    virtual void setPlaylistModel( PlaylistModel* model );
39    virtual void setModel( QAbstractItemModel* model );
40
41    virtual QList<Tomahawk::PlaylistUpdaterInterface*> updaters() const;
42
43    virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/playlist-icon.png" ); }
44    virtual bool isTemporaryPage() const;
45
46signals:
47    void nameChanged( const QString& title );
48    void destroyed( QWidget* widget );
49    void modelChanged();
50
51protected:
52    void keyPressEvent( QKeyEvent* event );
53    bool eventFilter( QObject* obj, QEvent* event );
54
55private slots:
56    void onMenuTriggered( int action );
57
58    void onDeleted();
59    void onChanged();
60
61private:
62    PlaylistModel* m_model;
63    QString m_customTitle;
64    QString m_customDescripton;
65};
66
67#endif // PLAYLISTVIEW_H