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

http://github.com/tomahawk-player/tomahawk · C Header · 95 lines · 56 code · 22 blank · 17 comment · 0 complexity · a9bcf030c5f6c32e387179bea18fb2d5 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. #ifndef hypemPlugin_H
  19. #define hypemPlugin_H
  20. #include "infosystem/infosystem.h"
  21. #include "infosystem/infosystemworker.h"
  22. #include <QNetworkReply>
  23. #include <QObject>
  24. class QNetworkReply;
  25. namespace Tomahawk
  26. {
  27. namespace InfoSystem
  28. {
  29. class hypemPlugin : public InfoPlugin
  30. {
  31. Q_OBJECT
  32. public:
  33. hypemPlugin();
  34. virtual ~hypemPlugin();
  35. enum ChartType {
  36. None = 0x00,
  37. Track = 0x01,
  38. Album = 0x02,
  39. Artist = 0x04
  40. };
  41. void setChartType( ChartType type ) { m_chartType = type; }
  42. ChartType chartType() const { return m_chartType; }
  43. public slots:
  44. void chartReturned();
  45. void chartTypes();
  46. protected slots:
  47. virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
  48. virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
  49. virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input )
  50. {
  51. Q_UNUSED( caller )
  52. Q_UNUSED( type)
  53. Q_UNUSED( input )
  54. }
  55. private:
  56. void fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData );
  57. void fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requestData );
  58. void dataError( Tomahawk::InfoSystem::InfoRequestData requestData );
  59. QVariantList m_chartResources;
  60. QList<InfoStringHash> m_charts;
  61. ChartType m_chartType;
  62. QVariantMap m_allChartsMap;
  63. QVariantList m_types;
  64. QVariantList m_popularTypes;
  65. QVariantList m_trackTypes;
  66. QVariantList m_byTagTypes;
  67. uint m_chartsFetchJobs;
  68. QList< InfoRequestData > m_cachedRequests;
  69. QHash< QString, QString > m_cachedCountries;
  70. };
  71. }
  72. }
  73. #endif // hypemPlugin_H