source: smplayer/trunk/src/youtube/codedownloader.h@ 176

Last change on this file since 176 was 176, checked in by Silvan Scherrer, 9 years ago

smplayer: update trunk to version 16.4

File size: 1.9 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#ifndef CODEDOWNLOADER_H
20#define CODEDOWNLOADER_H
21
22#include <QProgressDialog>
23#include <QUrl>
24#include <QNetworkProxy>
25#include <QNetworkAccessManager>
26#include <QNetworkReply>
27
28class CodeDownloader : public QProgressDialog
29{
30 Q_OBJECT
31
32public:
33 CodeDownloader(QWidget *parent = 0);
34 ~CodeDownloader();
35
36 void saveAs(const QString & output) { output_filename = output; };
37 void setProxy(QNetworkProxy proxy);
38
39public slots:
40 void download(QUrl url);
41 void cancelDownload();
42
43signals:
44 void downloadFinished();
45 void errorOcurred(int error_number, QString error_str);
46 void fileSaved(const QString &, const QString &);
47 void saveFailed(const QString &);
48
49private slots:
50 void gotResponse(QNetworkReply* reply);
51 void updateDataReadProgress(qint64 bytes_read, qint64 total_bytes);
52 void save(QByteArray bytes);
53
54 void reportFileSaved(const QString &, const QString &);
55 void reportSaveFailed(const QString &);
56 void reportError(int error_number, QString error_str);
57
58private:
59 QNetworkAccessManager* manager;
60 QNetworkReply* reply;
61
62 QString output_filename;
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.