/src/libtomahawk/playlist/XspfUpdater.h

http://github.com/tomahawk-player/tomahawk · C Header · 79 lines · 42 code · 20 blank · 17 comment · 0 complexity · e37e1563dd56ca5a9645365bf2385356 MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
  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 XSPFUPDATER_H
  19. #define XSPFUPDATER_H
  20. #include "PlaylistUpdaterInterface.h"
  21. #include "DllMacro.h"
  22. class QTimer;
  23. class QCheckBox;
  24. namespace Tomahawk
  25. {
  26. class DLLEXPORT XspfUpdater : public PlaylistUpdaterInterface
  27. {
  28. Q_OBJECT
  29. public:
  30. XspfUpdater( const playlist_ptr& pl, int interval /* ms */, bool autoUpdate, const QString& xspfUrl );
  31. virtual ~XspfUpdater();
  32. virtual QString type() const { return "xspf"; }
  33. virtual QWidget* configurationWidget() const;
  34. bool autoUpdate() const { return m_autoUpdate; }
  35. void setInterval( int intervalMsecs ) ;
  36. int intervalMsecs() const { return m_timer->interval(); }
  37. bool canSubscribe() const { return true; }
  38. bool subscribed() const { return m_autoUpdate; }
  39. void setSubscribed( bool subscribed );
  40. public slots:
  41. void updateNow();
  42. void setAutoUpdate( bool autoUpdate );
  43. private slots:
  44. void playlistLoaded( const QList<Tomahawk::query_ptr> & );
  45. private:
  46. QTimer* m_timer;
  47. bool m_autoUpdate;
  48. QString m_url;
  49. QCheckBox* m_toggleCheckbox;
  50. };
  51. class DLLEXPORT XspfUpdaterFactory : public PlaylistUpdaterFactory
  52. {
  53. public:
  54. XspfUpdaterFactory() {}
  55. virtual QString type() const { return "xspf"; }
  56. virtual PlaylistUpdaterInterface* create( const playlist_ptr& pl, const QVariantHash& settings );
  57. };
  58. }
  59. #endif // XSPFUPDATER_H