/src/libtomahawk/jobview/TransferStatusItem.h

http://github.com/tomahawk-player/tomahawk · C Header · 66 lines · 36 code · 13 blank · 17 comment · 0 complexity · 376cd88b44037bf31d5c87e13c3b8153 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 TRANSFERSTATUSITEM_H
  19. #define TRANSFERSTATUSITEM_H
  20. #include "JobStatusItem.h"
  21. #include <QPixmap>
  22. #include <QPointer>
  23. class StreamConnection;
  24. class TransferStatusManager : public QObject
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit TransferStatusManager( QObject* parent = 0 );
  29. virtual ~TransferStatusManager() {}
  30. QPixmap rxPixmap() const;
  31. QPixmap txPixmap() const;
  32. private slots:
  33. void streamRegistered( StreamConnection* sc );
  34. };
  35. class TransferStatusItem : public JobStatusItem
  36. {
  37. Q_OBJECT
  38. public:
  39. explicit TransferStatusItem( TransferStatusManager* p, StreamConnection* );
  40. virtual ~TransferStatusItem();
  41. virtual QString rightColumnText() const;
  42. virtual QString mainText() const;
  43. virtual QPixmap icon() const;
  44. virtual QString type() const { return m_type; }
  45. private slots:
  46. void streamFinished( StreamConnection* sc );
  47. void onTransferUpdate();
  48. private:
  49. TransferStatusManager* m_parent;
  50. QString m_type, m_main, m_right;
  51. QPointer< StreamConnection > m_stream;
  52. };
  53. #endif // TRANSFERSTATUSITEM_H