PDF4QT/PdfForQtViewer/pdfrendertoimagesdialog.h

102 lines
3.1 KiB
C
Raw Normal View History

2020-02-08 18:09:46 +01:00
// Copyright (C) 2020 Jakub Melka
//
// This file is part of PdfForQt.
//
// PdfForQt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// PdfForQt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with PDFForQt. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFRENDERTOIMAGESDIALOG_H
#define PDFRENDERTOIMAGESDIALOG_H
2020-02-09 17:17:14 +01:00
#include "pdfcms.h"
2020-02-08 18:09:46 +01:00
#include "pdfrenderer.h"
#include <QDialog>
2020-02-09 17:17:14 +01:00
#include <QFutureWatcher>
2020-02-08 18:09:46 +01:00
2020-02-09 16:06:29 +01:00
class QAbstractButton;
2020-02-08 18:09:46 +01:00
namespace Ui
{
class PDFRenderToImagesDialog;
}
2020-02-09 16:06:29 +01:00
namespace pdf
{
class PDFProgress;
class PDFDrawWidgetProxy;
}
2020-02-08 18:09:46 +01:00
namespace pdfviewer
{
class PDFRenderToImagesDialog : public QDialog
{
Q_OBJECT
public:
2020-02-09 16:06:29 +01:00
explicit PDFRenderToImagesDialog(const pdf::PDFDocument* document,
pdf::PDFDrawWidgetProxy* proxy,
pdf::PDFProgress* progress,
QWidget* parent);
2020-02-08 18:09:46 +01:00
virtual ~PDFRenderToImagesDialog() override;
private slots:
void on_selectDirectoryButton_clicked();
2020-02-09 16:06:29 +01:00
void on_buttonBox_clicked(QAbstractButton* button);
2020-02-08 18:09:46 +01:00
private:
/// Loads image writer settings to the ui
void loadImageWriterSettings();
/// Load image export settigns to the ui
void loadImageExportSettings();
void onFormatChanged();
void onSubtypeChanged();
void onPagesButtonClicked(bool checked);
void onSelectedPagesChanged(const QString& text);
void onDirectoryChanged(const QString& text);
void onFileTemplateChanged(const QString& text);
void onResolutionButtonClicked(bool checked);
void onResolutionDPIChanged(int value);
void onResolutionPixelsChanged(int value);
void onCompressionChanged(int value);
void onQualityChanged(int value);
void onGammaChanged(double value);
void onOptimizedWriteChanged(bool value);
void onProgressiveScanWriteChanged(bool value);
2020-02-09 16:06:29 +01:00
void onRenderError(pdf::PDFRenderError error);
2020-02-09 17:17:14 +01:00
void onRenderingFinished();
2020-02-08 18:09:46 +01:00
Ui::PDFRenderToImagesDialog* ui;
2020-02-09 16:06:29 +01:00
const pdf::PDFDocument* m_document;
pdf::PDFDrawWidgetProxy* m_proxy;
pdf::PDFProgress* m_progress;
2020-02-08 18:09:46 +01:00
pdf::PDFImageWriterSettings m_imageWriterSettings;
pdf::PDFPageImageExportSettings m_imageExportSettings;
bool m_isLoadingData;
2020-02-09 17:17:14 +01:00
QFutureWatcher<void> m_watcher;
std::vector<pdf::PDFInteger> m_pageIndices;
pdf::PDFOptionalContentActivity* m_optionalContentActivity;
pdf::PDFCMSPointer m_cms;
pdf::PDFRasterizerPool* m_rasterizerPool;
2020-02-08 18:09:46 +01:00
};
} // namespace pdfviewer
2020-02-09 18:44:11 +01:00
Q_DECLARE_METATYPE(pdf::PDFRenderError)
2020-02-08 18:09:46 +01:00
#endif // PDFRENDERTOIMAGESDIALOG_H