Changeset View
Changeset View
Standalone View
Standalone View
dialogs/kpDocumentSaveOptionsDialog.h
- This file was moved from widgets/kpDocumentSaveOptionsWidget.h.
Context not available. | |||||
26 | */ | 26 | */ | ||
---|---|---|---|---|---|
27 | 27 | | |||
28 | 28 | | |||
29 | #ifndef kpDocumentSaveOptionsWidget_H | 29 | #ifndef kpDocumentSaveOptionsDialog_H | ||
30 | #define kpDocumentSaveOptionsWidget_H | 30 | #define kpDocumentSaveOptionsDialog_H | ||
31 | 31 | | |||
32 | #include "generic/widgets/kpSubWindow.h" | ||||
32 | 33 | | |||
33 | #include <qrect.h> | 34 | #include <QDialog> | ||
34 | #include <qsize.h> | 35 | #include <QRect> | ||
35 | #include <qwidget.h> | 36 | #include <QSize> | ||
37 | #include <QWidget> | ||||
36 | 38 | | |||
37 | #include "imagelib/kpDocumentMetaInfo.h" | 39 | #include "imagelib/kpDocumentMetaInfo.h" | ||
38 | #include "document/kpDocumentSaveOptions.h" | 40 | #include "document/kpDocumentSaveOptions.h" | ||
39 | 41 | | |||
40 | 42 | class QCloseEvent; | |||
41 | class QComboBox; | 43 | class QComboBox; | ||
42 | class QImage; | 44 | class QImage; | ||
43 | class QLabel; | 45 | class QLabel; | ||
44 | class QTimer; | 46 | class QMoveEvent; | ||
45 | class QSpinBox; | | |||
46 | class QPushButton; | 47 | class QPushButton; | ||
48 | class QResizeEvent; | ||||
49 | class QSpinBox; | ||||
50 | class QTimer; | ||||
47 | 51 | | |||
48 | class kpDocumentSaveOptionsPreviewDialog; | 52 | class kpDocumentSaveOptionsPreviewWidget; | ||
49 | 53 | class kpResizeSignallingLabel; | |||
50 | 54 | | |||
51 | class kpDocumentSaveOptionsWidget : public QWidget | 55 | class kpDocumentSaveOptionsDialog : public QDialog | ||
52 | { | 56 | { | ||
53 | Q_OBJECT | 57 | Q_OBJECT | ||
54 | 58 | | |||
55 | public: | 59 | public: | ||
56 | kpDocumentSaveOptionsWidget (const QImage &docPixmap, | 60 | kpDocumentSaveOptionsDialog (const QImage &docPixmap, | ||
57 | const kpDocumentSaveOptions &saveOptions, | 61 | const kpDocumentSaveOptions &saveOptions, | ||
58 | const kpDocumentMetaInfo &metaInfo, | 62 | const kpDocumentMetaInfo &metaInfo, | ||
59 | QWidget *parent); | 63 | QWidget *parent); | ||
60 | kpDocumentSaveOptionsWidget (QWidget *parent); | 64 | kpDocumentSaveOptionsDialog (QWidget *parent); | ||
65 | QSize preferredMinimumSize () const; | ||||
61 | private: | 66 | private: | ||
62 | void init (); | 67 | void init (); | ||
63 | public: | 68 | public: | ||
64 | ~kpDocumentSaveOptionsWidget () override; | 69 | ~kpDocumentSaveOptionsDialog () override; | ||
65 | | ||||
66 | 70 | | |||
67 | // <visualParent> is usually the filedialog | 71 | // <visualParent> is usually the filedialog | ||
68 | void setVisualParent (QWidget *visualParent); | 72 | void setVisualParent (QWidget *visualParent); | ||
Context not available. | |||||
71 | protected: | 75 | protected: | ||
72 | bool mimeTypeHasConfigurableColorDepth () const; | 76 | bool mimeTypeHasConfigurableColorDepth () const; | ||
73 | bool mimeTypeHasConfigurableQuality () const; | 77 | bool mimeTypeHasConfigurableQuality () const; | ||
78 | static const QSize s_pixmapLabelMinimumSize; | ||||
79 | | ||||
80 | signals: | ||||
81 | void resized (); | ||||
74 | 82 | | |||
75 | public: | 83 | public: | ||
76 | QString mimeType () const; | 84 | QString mimeType () const; | ||
Context not available. | |||||
119 | 127 | | |||
120 | 128 | | |||
121 | protected slots: | 129 | protected slots: | ||
122 | void showPreview (bool yes = true); | 130 | void setFilePixmapAndSize (const QImage &filePixmap, qint64 fileSize); | ||
123 | void hidePreview (); | 131 | void updatePixmapPreview (); | ||
124 | void updatePreviewDelayed (); | 132 | void updatePreviewDelayed (); | ||
125 | void updatePreview (); | 133 | void updatePreview (); | ||
126 | void updatePreviewDialogLastRelativeGeometry (); | | |||
127 | 134 | | |||
128 | 135 | | |||
129 | protected: | 136 | protected: | ||
Context not available. | |||||
132 | Mode m_mode; | 139 | Mode m_mode; | ||
133 | 140 | | |||
134 | QImage *m_documentPixmap; | 141 | QImage *m_documentPixmap; | ||
142 | QImage *m_filePixmap; | ||||
143 | qint64 m_fileSize; | ||||
144 | | ||||
145 | void resizeEvent (QResizeEvent *e) override; | ||||
135 | 146 | | |||
136 | kpDocumentSaveOptions m_baseDocumentSaveOptions; | 147 | kpDocumentSaveOptions m_baseDocumentSaveOptions; | ||
137 | kpDocumentMetaInfo m_documentMetaInfo; | 148 | kpDocumentMetaInfo m_documentMetaInfo; | ||
Context not available. | |||||
144 | QLabel *m_qualityLabel; | 155 | QLabel *m_qualityLabel; | ||
145 | QSpinBox *m_qualityInput; | 156 | QSpinBox *m_qualityInput; | ||
146 | 157 | | |||
147 | QPushButton *m_previewButton; | | |||
148 | kpDocumentSaveOptionsPreviewDialog *m_previewDialog; | | |||
149 | QRect m_previewDialogLastRelativeGeometry; | | |||
150 | QTimer *m_updatePreviewTimer; | 158 | QTimer *m_updatePreviewTimer; | ||
151 | int m_updatePreviewDelay; | 159 | int m_updatePreviewDelay; | ||
152 | QTimer *m_updatePreviewDialogLastRelativeGeometryTimer; | 160 | kpResizeSignallingLabel *m_filePixmapLabel; | ||
161 | QLabel *m_fileSizeLabel; | ||||
153 | }; | 162 | }; | ||
154 | 163 | | |||
155 | 164 | | |||
156 | #endif // kpDocumentSaveOptionsWidget_H | 165 | #endif // kpDocumentSaveOptionsDialog_H | ||
Context not available. |