PageRenderTime 209ms CodeModel.GetById 90ms app.highlight 5ms RepoModel.GetById 76ms app.codeStats 0ms

/src/libtomahawk/infosystem/infoplugins/generic/spotifyPlugin.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 83 lines | 49 code | 17 blank | 17 comment | 0 complexity | 5777ff4d5a3e174d9ff839b081703b6c MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, Hugo Lindstr??m <hugolm84@gmail.com>
 4 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef SpotifyPlugin_H
20#define SpotifyPlugin_H
21
22#include "infosystem/infosystem.h"
23#include "infosystem/infosystemworker.h"
24#include <QNetworkReply>
25#include <QObject>
26
27class QNetworkReply;
28
29namespace Tomahawk
30{
31
32namespace InfoSystem
33{
34
35class SpotifyPlugin : public InfoPlugin
36{
37    Q_OBJECT
38
39public:
40    SpotifyPlugin();
41    virtual ~SpotifyPlugin();
42
43    enum ChartType {
44        None =      0x00,
45        Track =     0x01,
46        Album =     0x02,
47        Artist =    0x04
48
49    };
50 void setChartType( ChartType type ) { m_chartType = type; }
51 ChartType chartType() const { return m_chartType; }
52
53public slots:
54    void chartReturned();
55    void chartTypes();
56
57protected slots:
58    virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
59    virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
60    virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input )
61    {
62        Q_UNUSED( caller )
63        Q_UNUSED( type)
64        Q_UNUSED( input )
65    }
66
67private:
68    void fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData );
69    void fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requestData );
70    void dataError( Tomahawk::InfoSystem::InfoRequestData requestData );
71
72
73    ChartType m_chartType;
74    QVariantMap m_allChartsMap;
75    uint m_chartsFetchJobs;
76    QList< InfoRequestData > m_cachedRequests;
77};
78
79}
80
81}
82
83#endif // SpotifyPlugin_H