1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
4
* Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
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/>.
27
#include "jobview/JobStatusItem.h"
29
#include <QtCore/QStringList>
32
* Small class to parse Exfm links into query_ptrs
34
* Connect to the signals to get the results
42
class DropJobNotifier;
44
class DLLEXPORT ExfmParser : public QObject
48
friend class ExfmJobNotifier;
49
explicit ExfmParser( const QString& trackUrl, bool createNewPlaylist = false, QObject* parent = 0 );
50
explicit ExfmParser( const QStringList& trackUrls, bool createNewPlaylist = false, QObject* parent = 0 );
51
virtual ~ExfmParser();
53
// if true, emits track(), if false, emits tracks().
54
// only matters if you're using the QString constructor and explicityl dont' want
55
// the single track signal
56
void setSingleMode( bool single ) { m_single = single; }
59
void track( const Tomahawk::query_ptr& track );
60
void tracks( const QList< Tomahawk::query_ptr > tracks );
61
void playlist( const Tomahawk::query_ptr& playlist );
64
void exfmBrowseFinished();
65
void exfmLookupFinished();
66
void playlistCreated();
69
QPixmap pixmap() const;
70
void lookupUrl( const QString& url );
71
void checkBrowseFinished();
72
void parseTrack( const QVariantMap& res );
76
bool m_createNewPlaylist;
79
QList< query_ptr > m_tracks;
80
QSet< NetworkReply* > m_queries;
81
Tomahawk::playlist_ptr m_playlist;
82
DropJobNotifier* m_browseJob;
83
DropJob::DropType m_type;
84
static QPixmap* s_pixmap;