/src/libtomahawk/jobview/PipelineStatusItem.h

http://github.com/tomahawk-player/tomahawk · C Header · 66 lines · 35 code · 14 blank · 17 comment · 0 complexity · f0c1059f7222635bcff6355ace4412b7 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 PIPELINESTATUSITEM_H
  19. #define PIPELINESTATUSITEM_H
  20. #include "jobview/JobStatusItem.h"
  21. #include "Query.h"
  22. #include <QPixmap>
  23. #include <QPointer>
  24. class PipelineStatusItem : public JobStatusItem
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit PipelineStatusItem( const Tomahawk::query_ptr& q );
  29. virtual ~PipelineStatusItem();
  30. virtual QString rightColumnText() const;
  31. virtual QString mainText() const;
  32. virtual QPixmap icon() const;
  33. virtual QString type() const { return "pipeline"; }
  34. virtual bool collapseItem() const { return false; } // We can't collapse, since we use this meta-item instead of one per resolve
  35. private slots:
  36. void resolving( const Tomahawk::query_ptr& query );
  37. void idle();
  38. private:
  39. QString m_latestQuery;
  40. };
  41. class PipelineStatusManager : public QObject
  42. {
  43. Q_OBJECT
  44. public:
  45. explicit PipelineStatusManager( QObject* parent = 0 );
  46. virtual ~PipelineStatusManager() {}
  47. private slots:
  48. void resolving( const Tomahawk::query_ptr& p );
  49. private:
  50. QPointer<PipelineStatusItem> m_curItem;
  51. };
  52. #endif // PIPELINESTATUSITEM_H