PageRenderTime 88ms CodeModel.GetById 41ms app.highlight 4ms RepoModel.GetById 26ms app.codeStats 0ms

/src/libtomahawk/widgets/newplaylistwidget.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 82 lines | 44 code | 20 blank | 18 comment | 0 complexity | 6c2d3a92fd5067fdeb5cc8bb274382da 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-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 NEWPLAYLISTWIDGET_H
21#define NEWPLAYLISTWIDGET_H
22
23#include <QtGui/QWidget>
24#include <QtCore/QTimer>
25
26#include "PlaylistInterface.h"
27#include "ViewPage.h"
28
29#include "DllMacro.h"
30
31class QPushButton;
32class PlaylistModel;
33
34namespace Ui
35{
36    class NewPlaylistWidget;
37}
38
39class DLLEXPORT NewPlaylistWidget : public QWidget, public Tomahawk::ViewPage
40{
41Q_OBJECT
42
43public:
44    NewPlaylistWidget( QWidget* parent = 0 );
45    ~NewPlaylistWidget();
46
47    virtual QWidget* widget() { return this; }
48    virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
49
50    virtual QString title() const { return tr( "Create a new playlist" ); }
51    virtual QString description() const { return QString(); }
52
53    virtual bool jumpToCurrentTrack() { return false; }
54
55protected:
56    void changeEvent( QEvent* e );
57
58signals:
59    void destroyed( QWidget* widget );
60
61private slots:
62    void onTitleChanged( const QString& title );
63    void onTagChanged();
64
65    void updateSuggestions();
66    void suggestionsFound();
67
68    void savePlaylist();
69    void cancel();
70
71private:
72    Ui::NewPlaylistWidget *ui;
73
74    PlaylistModel* m_suggestionsModel;
75    QList< Tomahawk::query_ptr > m_queries;
76
77    QTimer m_filterTimer;
78    QString m_tag;
79    QPushButton* m_saveButton;
80};
81
82#endif // NEWPLAYLISTWIDGET_H