diff options
Diffstat (limited to 'src/downloadwidget.h')
-rw-r--r-- | src/downloadwidget.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/downloadwidget.h b/src/downloadwidget.h index 074a979..4417cb4 100644 --- a/src/downloadwidget.h +++ b/src/downloadwidget.h @@ -54,36 +54,40 @@ #include "ui_downloadwidget.h"
#include "widgets/elidedlabel/elidedlabel.h"
-
+#include <QElapsedTimer>
#include <QFrame>
#include <QTime>
-#include <QElapsedTimer>
QT_BEGIN_NAMESPACE
class QWebEngineDownloadItem;
QT_END_NAMESPACE
// Displays one ongoing or finished download (QWebEngineDownloadItem).
-class DownloadWidget final : public QFrame, public Ui::DownloadWidget
-{
- Q_OBJECT
+class DownloadWidget final : public QFrame, public Ui::DownloadWidget {
+ Q_OBJECT
public:
- // Precondition: The QWebEngineDownloadItem has been accepted.
- explicit DownloadWidget(QWebEngineDownloadItem *download, QWidget *parent = nullptr);
+ // Precondition: The QWebEngineDownloadItem has been accepted.
+ explicit DownloadWidget(QWebEngineDownloadItem *download,
+ QWidget *parent = nullptr);
+public slots:
+ // Return true if downloadItem state is InProgress
+ bool isDownloading();
+ // Remove downloadItem, updating the download manager
+ void remove();
signals:
- // This signal is emitted when the user indicates that they want to remove
- // this download from the downloads list.
- void removeClicked(DownloadWidget *self);
+ // This signal is emitted when the user indicates that they want to remove
+ // this download from the downloads list.
+ void removeClicked(DownloadWidget *self);
private slots:
- void updateWidget();
+ void updateWidget();
private:
- QString withUnit(qreal bytes);
+ QString withUnit(qreal bytes);
- QWebEngineDownloadItem *m_download;
- QElapsedTimer m_timeAdded;
+ QWebEngineDownloadItem *m_download;
+ QElapsedTimer m_timeAdded;
};
#endif // DOWNLOADWIDGET_H
|