File indexing completed on 2022-12-06 18:50:18

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2011 Martin Kuettler <martin.kuettler@gmail.com>
0004     SPDX-FileCopyrightText: 2016-2021 Alexander Semke <alexander.semke@web.de>
0005 */
0006 
0007 #ifndef IMAGESETTINGSDIALOG_H
0008 #define IMAGESETTINGSDIALOG_H
0009 
0010 #include <QDialog>
0011 
0012 #include <ui_imagesettings.h>
0013 
0014 struct ImageSize
0015 {
0016     enum {Auto = 0, Pixel = 1, Percent = 2};
0017     double width;
0018     double height;
0019     int widthUnit;
0020     int heightUnit;
0021 };
0022 
0023 class ImageSettingsDialog : public QDialog
0024 {
0025   Q_OBJECT
0026   public:
0027     explicit ImageSettingsDialog(QWidget*);
0028     ~ImageSettingsDialog() override;
0029 
0030     void setData(const QString& file, const ImageSize& displaySize, const ImageSize& printSize, bool useDisplaySizeForPrinting);
0031 
0032   Q_SIGNALS:
0033     void dataChanged(const QString& file, const ImageSize& displaySize, const ImageSize& printSize, bool useDisplaySizeForPrinting);
0034 
0035   private Q_SLOTS:
0036     void sendChangesAndClose();
0037     void sendChanges();
0038 
0039     void openDialog();
0040     void updatePreview();
0041     void updateInputWidgets();
0042     void updatePrintingGroup(int b);
0043 
0044   private:
0045     QList<QString> m_unitNames;
0046     Ui_ImageSettingsBase m_ui;
0047 
0048 };
0049 
0050 #endif //IMAGESETTINGSDIALOG_H