Changeset View
Changeset View
Standalone View
Standalone View
filters/karbon/image/ImageExportOptionsWidget.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #ifndef IMAGEEXPORTOPTIONSWIDGET_H | 20 | #ifndef IMAGEEXPORTOPTIONSWIDGET_H | ||
21 | #define IMAGEEXPORTOPTIONSWIDGET_H | 21 | #define IMAGEEXPORTOPTIONSWIDGET_H | ||
22 | 22 | | |||
23 | #include "ui_ImageExportOptionsWidget.h" | 23 | #include "ui_ImageExportOptionsWidget.h" | ||
24 | 24 | | |||
25 | #include <QWidget> | 25 | #include <QWidget> | ||
26 | 26 | | |||
27 | class KarbonDocument; | ||||
28 | class KoPAPageBase; | ||||
29 | | ||||
27 | class ImageExportOptionsWidget : public QWidget | 30 | class ImageExportOptionsWidget : public QWidget | ||
28 | { | 31 | { | ||
29 | Q_OBJECT | 32 | Q_OBJECT | ||
30 | 33 | | |||
31 | public: | 34 | public: | ||
32 | explicit ImageExportOptionsWidget(const QSizeF &pointSize, QWidget *parent = 0); | 35 | explicit ImageExportOptionsWidget(KarbonDocument *doc, QWidget *parent = 0); | ||
33 | 36 | | |||
34 | /// Sets the initial unit to use | 37 | /// Sets the initial unit to use | ||
35 | void setUnit(const KoUnit &unit); | 38 | void setUnit(const KoUnit &unit); | ||
36 | 39 | | |||
37 | /// Returns the chosen export size in pixel | 40 | /// Returns the chosen export size in pixel | ||
38 | QSize pixelSize() const; | 41 | QSize pixelSize() const; | ||
39 | 42 | | |||
40 | /// Returns the chosen export size in point | 43 | /// Returns the chosen export size in point | ||
41 | QSizeF pointSize() const; | 44 | QSizeF pointSize() const; | ||
42 | 45 | | |||
43 | /// Sets the background color | 46 | /// Sets the background color | ||
44 | void setBackgroundColor(const QColor &color); | 47 | void setBackgroundColor(const QColor &color); | ||
45 | 48 | | |||
46 | /// Returns the chosen background color | 49 | /// Returns the chosen background color | ||
47 | QColor backgroundColor() const; | 50 | QColor backgroundColor() const; | ||
48 | 51 | | |||
49 | /// Enables/disables setting the background opacity | 52 | /// Enables/disables setting the background opacity | ||
50 | void enableBackgroundOpacity(bool enable); | 53 | void enableBackgroundOpacity(bool enable); | ||
51 | 54 | | |||
55 | KoPAPageBase *page() const; | ||||
56 | | ||||
52 | private Q_SLOTS: | 57 | private Q_SLOTS: | ||
53 | void unitWidthChanged(qreal); | 58 | void unitWidthChanged(qreal); | ||
54 | void unitHeightChanged(qreal); | 59 | void unitHeightChanged(qreal); | ||
55 | void pxWidthChanged(int); | 60 | void pxWidthChanged(int); | ||
56 | void pxHeightChanged(int); | 61 | void pxHeightChanged(int); | ||
57 | void dpiChanged(int); | 62 | void dpiChanged(int); | ||
58 | void unitChanged(int); | 63 | void unitChanged(int); | ||
59 | void aspectChanged(bool); | 64 | void aspectChanged(bool); | ||
65 | void setPage(int idx); | ||||
60 | private: | 66 | private: | ||
61 | void updateFromPointSize(const QSizeF &pointSize); | 67 | void updateFromPointSize(const QSizeF &pointSize); | ||
62 | void updateFromPixelSize(const QSize &pixelSize); | 68 | void updateFromPixelSize(const QSize &pixelSize); | ||
63 | 69 | | |||
64 | void blockChildSignals(bool block); | 70 | void blockChildSignals(bool block); | ||
65 | 71 | | |||
66 | Ui_ImageExportOptionsWidget widget; | 72 | Ui_ImageExportOptionsWidget widget; | ||
67 | QSizeF m_pointSize; | 73 | QSizeF m_pointSize; | ||
74 | | ||||
75 | KarbonDocument *m_doc; | ||||
68 | }; | 76 | }; | ||
69 | 77 | | |||
70 | #endif // IMAGEEXPORTOPTIONSWIDGET_H | 78 | #endif // IMAGEEXPORTOPTIONSWIDGET_H |