PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/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
19#ifndef DROPJOBNOTIFIER_H
20#define DROPJOBNOTIFIER_H
21
22#include "DllMacro.h"
23#include "DropJob.h"
24#include "Typedefs.h"
25#include "Query.h"
26#include "jobview/JobStatusItem.h"
27
28#include <QObject>
29#include <QSet>
30#include <QStringList>
31#include <QPixmap>
32
33class NetworkReply;
34
35namespace Tomahawk
36{
37
38class DLLEXPORT DropJobNotifier : public JobStatusItem
39{
40    Q_OBJECT
41public:
42    DropJobNotifier( QPixmap pixmap, QString service, DropJob::DropType type, NetworkReply* job );
43
44    // No QNetworkReply, needs manual finished call
45    DropJobNotifier( QPixmap pixmap, DropJob::DropType type );
46    virtual ~DropJobNotifier();
47
48    virtual QString rightColumnText() const;
49    virtual QString mainText() const;
50    virtual QPixmap icon() const;
51    virtual QString type() const { return m_type; }
52    virtual bool collapseItem() const { return true; }
53
54public slots:
55    void setFinished();
56
57private:
58    void init( DropJob::DropType type );
59
60    QString m_type;
61    NetworkReply* m_job;
62    QPixmap m_pixmap;
63    QString m_service;
64};
65
66}
67
68#endif // DROPJOBNOTIFIER_H