/src/libtomahawk/utils/DropJobNotifier.h

http://github.com/tomahawk-player/tomahawk · C Header · 68 lines · 37 code · 13 blank · 18 comment · 0 complexity · b7a2df45fce7739358205ed114d7d133 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. * Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
  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 DROPJOBNOTIFIER_H
  19. #define DROPJOBNOTIFIER_H
  20. #include "DllMacro.h"
  21. #include "DropJob.h"
  22. #include "Typedefs.h"
  23. #include "Query.h"
  24. #include "jobview/JobStatusItem.h"
  25. #include <QObject>
  26. #include <QSet>
  27. #include <QStringList>
  28. #include <QPixmap>
  29. class NetworkReply;
  30. namespace Tomahawk
  31. {
  32. class DLLEXPORT DropJobNotifier : public JobStatusItem
  33. {
  34. Q_OBJECT
  35. public:
  36. DropJobNotifier( QPixmap pixmap, QString service, DropJob::DropType type, NetworkReply* job );
  37. // No QNetworkReply, needs manual finished call
  38. DropJobNotifier( QPixmap pixmap, DropJob::DropType type );
  39. virtual ~DropJobNotifier();
  40. virtual QString rightColumnText() const;
  41. virtual QString mainText() const;
  42. virtual QPixmap icon() const;
  43. virtual QString type() const { return m_type; }
  44. virtual bool collapseItem() const { return true; }
  45. public slots:
  46. void setFinished();
  47. private:
  48. void init( DropJob::DropType type );
  49. QString m_type;
  50. NetworkReply* m_job;
  51. QPixmap m_pixmap;
  52. QString m_service;
  53. };
  54. }
  55. #endif // DROPJOBNOTIFIER_H