PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
19#ifndef TRANSFERSTATUSITEM_H
20#define TRANSFERSTATUSITEM_H
21
22#include "JobStatusItem.h"
23
24#include <QPixmap>
25#include <QPointer>
26
27
28class StreamConnection;
29
30class TransferStatusManager : public QObject
31{
32    Q_OBJECT
33public:
34    explicit TransferStatusManager( QObject* parent = 0 );
35    virtual ~TransferStatusManager() {}
36
37    QPixmap rxPixmap() const;
38    QPixmap txPixmap() const;
39
40private slots:
41    void streamRegistered( StreamConnection* sc );
42};
43
44class TransferStatusItem : public JobStatusItem
45{
46    Q_OBJECT
47public:
48    explicit TransferStatusItem( TransferStatusManager* p, StreamConnection* );
49    virtual ~TransferStatusItem();
50
51    virtual QString rightColumnText() const;
52    virtual QString mainText() const;
53    virtual QPixmap icon() const;
54    virtual QString type() const { return m_type; }
55
56private slots:
57    void streamFinished( StreamConnection* sc );
58    void onTransferUpdate();
59
60private:
61    TransferStatusManager* m_parent;
62    QString m_type, m_main, m_right;
63    QPointer< StreamConnection > m_stream;
64};
65
66#endif // TRANSFERSTATUSITEM_H