2
* \file downloaddialog.h
3
* Dialog displayed during a download.
9
* Copyright (C) 2008-2009 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#ifndef DOWNLOADDIALOG_H
28
#define DOWNLOADDIALOG_H
30
#include <qprogressdialog.h>
36
* Dialog displayed during a download.
38
class DownloadDialog : public QProgressDialog {
45
* @param parent parent widget
46
* @param caption dialog title
48
DownloadDialog(QWidget* parent, const QString& caption);
53
virtual ~DownloadDialog();
56
* Send a download request.
58
* @param hostName server
59
* @param path path on server
61
void startDownload(const QString& hostName, const QString& path);
67
void cancelDownload();
71
* Handle response when request is finished.
72
* downloadFinished() is emitted.
74
* @param data received data
76
void requestFinished(const QByteArray& data);
79
* Display progress status.
81
* @param msg status message
82
* @param receivedBytes bytes received
83
* @param totalBytes total bytes
85
void updateProgressStatus(const QString& msg, int receivedBytes, int totalBytes);
89
* Emitted when download finished.
90
* Parameter: bytes containing download, content type, URL
92
void downloadFinished(const QByteArray&, const QString&, const QString&);
99
#endif // DOWNLOADDIALOG_H