File indexing completed on 2026-10-04 12:08:49

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef IMAGEEXPORTOPTIONSWIDGET_H
0008 #define IMAGEEXPORTOPTIONSWIDGET_H
0009 
0010 #include "ui_ImageExportOptionsWidget.h"
0011 
0012 #include <QWidget>
0013 
0014 class KarbonDocument;
0015 class KoPAPageBase;
0016 
0017 class ImageExportOptionsWidget : public QWidget
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit ImageExportOptionsWidget(KarbonDocument *doc, QWidget *parent = 0);
0023 
0024     /// Sets the initial unit to use
0025     void setUnit(const KoUnit &unit);
0026 
0027     /// Returns the chosen export size in pixel
0028     QSize pixelSize() const;
0029 
0030     /// Returns the chosen export size in point
0031     QSizeF pointSize() const;
0032 
0033     /// Sets the background color
0034     void setBackgroundColor(const QColor &color);
0035 
0036     /// Returns the chosen background color
0037     QColor backgroundColor() const;
0038 
0039     /// Enables/disables setting the background opacity
0040     void enableBackgroundOpacity(bool enable);
0041 
0042     KoPAPageBase *page() const;
0043 
0044 private Q_SLOTS:
0045     void unitWidthChanged(qreal);
0046     void unitHeightChanged(qreal);
0047     void pxWidthChanged(int);
0048     void pxHeightChanged(int);
0049     void dpiChanged(int);
0050     void unitChanged(int);
0051     void aspectChanged(bool);
0052     void setPage(int idx);
0053 private:
0054     void updateFromPointSize(const QSizeF &pointSize);
0055     void updateFromPixelSize(const QSize &pixelSize);
0056 
0057     void blockChildSignals(bool block);
0058 
0059     Ui_ImageExportOptionsWidget widget;
0060     QSizeF m_pointSize;
0061 
0062     KarbonDocument *m_doc;
0063 };
0064 
0065 #endif // IMAGEEXPORTOPTIONSWIDGET_H