]> git.sur5r.net Git - minitube/blob - src/downloadmanager.h
Imported Upstream version 1.2
[minitube] / src / downloadmanager.h
1 #ifndef DOWNLOADMANAGER_H
2 #define DOWNLOADMANAGER_H
3
4 #include <QtGui>
5
6 class DownloadItem;
7 class DownloadModel;
8 class Video;
9
10 class DownloadManager : public QObject {
11
12     Q_OBJECT
13
14 public:
15     static DownloadManager* instance();
16     void clear();
17     void addItem(Video *video);
18     const QList<DownloadItem*> getItems() { return items; }
19     DownloadModel* getModel() { return downloadModel; }
20     DownloadItem* itemForVideo(Video *video);
21     int activeItems();
22     QString defaultDownloadFolder();
23     QString currentDownloadFolder();
24
25 signals:
26     void finished();
27     void statusMessageChanged(QString status);
28
29 private slots:
30     void itemFinished();
31     void updateStatusMessage();
32     void gotStreamUrl(QUrl url);
33
34 private:
35     DownloadManager(QObject *parent = 0);
36
37     QList<DownloadItem*> items;
38     DownloadModel *downloadModel;
39
40 };
41
42 #endif // DOWNLOADMANAGER_H