Project Gutenberg downloads work end-to-end.
[dorian] / searchresultsdialog.h
1 #ifndef SEARCHRESULTSDIALOG_H
2 #define SEARCHRESULTSDIALOG_H
3
4 #include <QList>
5 #include <QStringList>
6
7 #include "listwindow.h"
8 #include "search.h"
9
10 class ListView;
11 class QModelIndex;
12 class ProgressDialog;
13
14 class SearchResultsDialog: public ListWindow
15 {
16     Q_OBJECT
17
18 public:
19     explicit SearchResultsDialog(const QList<Search::Result> searchResults,
20                                  QWidget *parent = 0);
21
22 protected slots:
23     void onDownload();
24     void onItemActivated(const QModelIndex &index);
25     void onBeginDownload(int size);
26     void onEndDownload(int status, const Search::Result &result,
27                        const QString &fileName);
28
29 protected:
30     QString downloadName() const;
31
32 private:
33     const QList<Search::Result> results;
34     ListView *list;
35     QStringList data;
36     ProgressDialog *progress;
37 };
38
39 #endif // SEARCHRESULTSDIALOG_H