/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h

http://github.com/tomahawk-player/tomahawk · C Header · 91 lines · 51 code · 23 blank · 17 comment · 0 complexity · d110ba620b74ad13001dbcf01c20c9e2 MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.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 ADIUMPLUGIN_H
  19. #define ADIUMPLUGIN_H
  20. #include "infosystem/infosystem.h"
  21. #include <QNetworkAccessManager>
  22. #include <QObject>
  23. #include <QVariant>
  24. #include <QWeakPointer>
  25. class QTimer;
  26. namespace Tomahawk {
  27. namespace InfoSystem {
  28. class AdiumPlugin : public InfoPlugin
  29. {
  30. Q_OBJECT
  31. public:
  32. AdiumPlugin();
  33. virtual ~AdiumPlugin();
  34. protected slots:
  35. virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
  36. {
  37. Q_UNUSED( requestData );
  38. }
  39. void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
  40. public slots:
  41. virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
  42. {
  43. Q_UNUSED( criteria );
  44. Q_UNUSED( requestData );
  45. }
  46. private slots:
  47. void shortLinkReady( QUrl longUrl, QUrl shortUrl );
  48. void clearStatus();
  49. void settingsChanged();
  50. private:
  51. void audioStarted( const QVariant &input );
  52. void audioFinished( const QVariant &input );
  53. void audioStopped();
  54. void audioPaused();
  55. void audioResumed( const QVariant &input );
  56. QUrl openLinkFromHash( const InfoStringHash& hash ) const;
  57. bool m_active;
  58. QString m_beforeStatus;
  59. QString m_afterStatus;
  60. QString m_currentTitle;
  61. QString m_currentArtist;
  62. QUrl m_currentLongUrl;
  63. QTimer* m_pauseTimer;
  64. QWeakPointer<QNetworkAccessManager> m_nam;
  65. };
  66. }
  67. }
  68. #endif // ADIUMPLUGIN_H