~ubuntu-branches/ubuntu/trusty/tomahawk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/infoplugins/generic/hypem/HypemPlugin.h

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2013-03-07 21:50:13 UTC
  • Revision ID: package-import@ubuntu.com-20130307215013-6gdjkdds7i9uenvs
Tags: upstream-0.6.0+dfsg
Import upstream version 0.6.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 
2
 *
 
3
 *   Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
 
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 HYPEMPLUGIN_H
 
21
#define HYPEMPLUGIN_H
 
22
 
 
23
#include "infoplugins/InfoPluginDllMacro.h"
 
24
#include "infosystem/InfoSystem.h"
 
25
#include "infosystem/InfoSystemWorker.h"
 
26
#include <QNetworkReply>
 
27
#include <QObject>
 
28
 
 
29
class QNetworkReply;
 
30
 
 
31
namespace Tomahawk
 
32
{
 
33
 
 
34
namespace InfoSystem
 
35
{
 
36
 
 
37
class INFOPLUGINDLLEXPORT HypemPlugin : public InfoPlugin
 
38
{
 
39
    Q_OBJECT
 
40
    Q_INTERFACES( Tomahawk::InfoSystem::InfoPlugin )
 
41
 
 
42
public:
 
43
    HypemPlugin();
 
44
    virtual ~HypemPlugin();
 
45
 
 
46
    enum ChartType {
 
47
        None =      0x00,
 
48
        Track =     0x01,
 
49
        Album =     0x02,
 
50
        Artist =    0x04
 
51
 
 
52
    };
 
53
    void setChartType( ChartType type ) { m_chartType = type; }
 
54
    ChartType chartType() const { return m_chartType; }
 
55
 
 
56
public slots:
 
57
    void chartReturned();
 
58
    void chartTypes();
 
59
 
 
60
protected slots:
 
61
    virtual void init();
 
62
    virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
 
63
    virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
 
64
    virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
 
65
    {
 
66
        Q_UNUSED( pushData );
 
67
    }
 
68
 
 
69
 
 
70
private:
 
71
    void fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData );
 
72
    void fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requestData );
 
73
    void dataError( Tomahawk::InfoSystem::InfoRequestData requestData );
 
74
 
 
75
    QVariantList m_chartResources;
 
76
    QList<InfoStringHash> m_charts;
 
77
 
 
78
 
 
79
    ChartType m_chartType;
 
80
    QVariantMap m_allChartsMap;
 
81
    QVariantList m_types;
 
82
    QVariantList m_popularTypes;
 
83
    QVariantList m_trackTypes;
 
84
    QVariantList m_byTagTypes;
 
85
 
 
86
 
 
87
    uint m_chartsFetchJobs;
 
88
    QList< InfoRequestData > m_cachedRequests;
 
89
 
 
90
    QHash< QString, QString > m_cachedCountries;
 
91
};
 
92
 
 
93
}
 
94
 
 
95
}
 
96
 
 
97
#endif // HYPEMPLUGIN_H