PageRenderTime 147ms CodeModel.GetById 63ms app.highlight 15ms RepoModel.GetById 63ms app.codeStats 0ms

/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
19#ifndef PIPELINESTATUSITEM_H
20#define PIPELINESTATUSITEM_H
21
22#include "jobview/JobStatusItem.h"
23#include "Query.h"
24
25#include <QPixmap>
26#include <QPointer>
27
28class PipelineStatusItem : public JobStatusItem
29{
30    Q_OBJECT
31public:
32    explicit PipelineStatusItem( const Tomahawk::query_ptr& q );
33    virtual ~PipelineStatusItem();
34
35    virtual QString rightColumnText() const;
36    virtual QString mainText() const;
37    virtual QPixmap icon() const;
38
39    virtual QString type() const { return "pipeline"; }
40
41    virtual bool collapseItem() const { return false; } // We can't collapse, since we use this meta-item instead of one per resolve
42
43private slots:
44    void resolving( const Tomahawk::query_ptr& query );
45    void idle();
46
47private:
48    QString m_latestQuery;
49};
50
51class PipelineStatusManager : public QObject
52{
53    Q_OBJECT
54public:
55    explicit PipelineStatusManager( QObject* parent = 0 );
56    virtual ~PipelineStatusManager() {}
57
58private slots:
59    void resolving( const Tomahawk::query_ptr& p );
60
61private:
62    QPointer<PipelineStatusItem> m_curItem;
63};
64
65
66#endif // PIPELINESTATUSITEM_H