videodownloader/network/finder/groovesharksearcher.h

70 lines
1.5 KiB
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef GROOVESHARKALBUM_H
#define GROOVESHARKALBUM_H
2015-09-08 17:05:59 +02:00
#include "./downloadfinder.h"
2015-04-22 19:32:04 +02:00
#include <QStringList>
namespace Network {
/*!
* \brief Specifies the role of the search term.
*/
enum class GroovesharkSearchTermRole {
AlbumId, /**< album ID */
AlbumName, /**< album name */
PlaylistId, /**< playlist ID */
PlaylistName /**< playlist name */
};
2017-05-01 03:22:50 +02:00
class GroovesharkSearcher : public DownloadFinder {
2015-04-22 19:32:04 +02:00
Q_OBJECT
public:
explicit GroovesharkSearcher(const QString &searchTerm, GroovesharkSearchTermRole searchTermRole, bool verified, QObject *parent = nullptr);
const QString &searchTerm() const;
GroovesharkSearchTermRole searchTermRole() const;
bool verified() const;
protected:
Download *createRequest(QString &reasonForFail);
protected slots:
ParsingResult parseResults(const QByteArray &data, QString &reasonForFail);
private:
QString m_searchTerm;
GroovesharkSearchTermRole m_searchType;
QStringList m_ids;
int m_currentId;
bool m_verified;
};
/*!
* \brief Returns the search term.
*/
inline const QString &GroovesharkSearcher::searchTerm() const
{
return m_searchTerm;
}
/*!
* \brief Returns the role of the search term.
*/
inline GroovesharkSearchTermRole GroovesharkSearcher::searchTermRole() const
{
return m_searchType;
}
/*!
* \brief Returns an indication whether the search is limited to verified songs.
*/
inline bool GroovesharkSearcher::verified() const
{
return m_verified;
}
2019-07-20 20:20:58 +02:00
} // namespace Network
2015-04-22 19:32:04 +02:00
#endif // GROOVESHARKALBUM_H