File indexing completed on 2024-05-12 04:58:05

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU General Public License as published by
0007 * the Free Software Foundation, either version 3 of the License, or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 * GNU General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 * ============================================================ */
0018 #ifndef DOWNLOADOPTIONSDIALOG_H
0019 #define DOWNLOADOPTIONSDIALOG_H
0020 
0021 #include <QDialog>
0022 #include <QUrl>
0023 
0024 #include "qzcommon.h"
0025 #include "downloadmanager.h"
0026 #include "downloaditem.h"
0027 
0028 namespace Ui
0029 {
0030 class DownloadOptionsDialog;
0031 }
0032 
0033 class QWebEngineDownloadRequest;
0034 
0035 class FALKON_EXPORT DownloadOptionsDialog : public QDialog
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040     explicit DownloadOptionsDialog(const QString &fileName, QWebEngineDownloadRequest *downloadItem, QWidget* parent = nullptr);
0041     ~DownloadOptionsDialog() override;
0042 
0043     void showExternalManagerOption(bool show);
0044     void showFromLine(bool show);
0045 
0046     void setLastDownloadOption(const DownloadManager::DownloadOption &option);
0047 
0048     int exec() override;
0049 
0050 private Q_SLOTS:
0051     void copyDownloadLink();
0052     void emitDialogFinished(int status);
0053 
0054 Q_SIGNALS:
0055     void dialogFinished(int);
0056 
0057 private:
0058     Ui::DownloadOptionsDialog* ui;
0059 
0060     QWebEngineDownloadRequest *m_downloadItem;
0061     bool m_signalEmited;
0062 };
0063 
0064 #endif // DOWNLOADOPTIONSDIALOG_H