mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-05 00:24:06 +00:00
b5349478cf
The next commit will add `.git-blame-ignore-revs` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
36 lines
764 B
C++
36 lines
764 B
C++
#ifndef WEBMULTIMEDIADOWNLOAD_HH
|
|
#define WEBMULTIMEDIADOWNLOAD_HH
|
|
|
|
#include "dict/dictionary.hh"
|
|
#include <QtNetwork>
|
|
|
|
namespace Dictionary {
|
|
|
|
/// Downloads data from the web, wrapped as a dictionary's DataRequest. This
|
|
/// is useful for multimedia files, like sounds and pronunciations.
|
|
class WebMultimediaDownload: public DataRequest
|
|
{
|
|
Q_OBJECT
|
|
|
|
QNetworkReply * reply;
|
|
QNetworkAccessManager & mgr;
|
|
int redirectCount;
|
|
|
|
public:
|
|
|
|
WebMultimediaDownload( QUrl const &, QNetworkAccessManager & );
|
|
|
|
/// Checks if the given url is an http request for an audio file.
|
|
static bool isAudioUrl( QUrl const & );
|
|
|
|
virtual void cancel();
|
|
|
|
private slots:
|
|
|
|
void replyFinished( QNetworkReply * );
|
|
};
|
|
|
|
} // namespace Dictionary
|
|
|
|
#endif // WEBMULTIMEDIADOWNLOAD_HH
|