-
Notifications
You must be signed in to change notification settings - Fork 0
/
episode.h
42 lines (37 loc) · 936 Bytes
/
episode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef EPISODE_H
#define EPISODE_H
#include <QObject>
#include <QString>
#include <QDateTime>
#include <QByteArray>
#include <QUrl>
#include <QNetworkReply>
#include <QFile>
#include <QDir>
#include "output.h"
class Downloader;
class Episode : public QObject
{
Q_OBJECT
QUrl url;
QString podcastName;
QString episodeTitle;
QString filename;
QByteArray data;
Downloader* downloader;
public:
explicit Episode(const QString& podcastName, const QString& episodeTitle, const QUrl& url, Downloader* downloader, QObject *parent = 0);
void load();
bool save(QDir directory);
QUrl getUrl() const;
QString getEpisodeTitle() const;
void setEpisodeTitle(const QString &value);
void abort();
signals:
void complete();
void failed();
private slots:
void downloadSuccess(const QUrl& url, const QByteArray& data);
void downloadFailed(const QUrl& url, QNetworkReply::NetworkError error);
};
#endif // EPISODE_H