00001
00002
00003
00004
00005
00006
00007 #ifndef DLG_IMPORT_CROPPING_PDF_H
00008 #define DLG_IMPORT_CROPPING_PDF_H
00009
00010 #include <QDialog>
00011 #include <QImage>
00012 #include <QObject>
00013
00014 namespace Poppler {
00015 class Document;
00016 }
00017 class PdfCropping;
00018 class QGraphicsPixmapItem;
00019 class QGridLayout;
00020 class QGraphicsScene;
00021 class QRectF;
00022 class QSpinBox;
00023 class QString;
00024 class QTimer;
00025 class ViewPreview;
00026
00028 class DlgImportCroppingPdf : public QDialog
00029 {
00030 Q_OBJECT;
00031
00032 public:
00034 DlgImportCroppingPdf (const Poppler::Document &document,
00035 int resolution);
00036 virtual ~DlgImportCroppingPdf ();
00037
00039 QImage image () const;
00040
00042 virtual void showEvent (QShowEvent *event);
00043
00044 private slots:
00045
00047 void slotCancel();
00048
00050 void slotOk ();
00051
00053 void slotPage (int);
00054
00056 void slotTimeout ();
00057
00058 private:
00059 DlgImportCroppingPdf();
00060
00061 void createPageSpinner (QGridLayout *layout,
00062 int &row);
00063 void createPdfCropping ();
00064 void createPreview (QGridLayout *layout,
00065 int &row);
00066 void createTimer ();
00067 void finishPanel (QWidget *subPanel);
00068 void initializeFrameGeometryAndPixmap ();
00069 QImage loadImage (int page1Based) const;
00070
00072 static int MINIMUM_DIALOG_WIDTH;
00073
00075 static int MINIMUM_PREVIEW_HEIGHT;
00076
00077 void saveGeometryToSettings ();
00078 void updatePreview ();
00079
00080 QSpinBox *m_spinPage;
00081 QPushButton *m_btnCancel;
00082 QPushButton *m_btnOk;
00083
00084 QTimer *m_timer;
00085 const Poppler::Document &m_document;
00086 int m_resolution;
00087 QImage m_image;
00088 QGraphicsPixmapItem *m_pixmap;
00089
00090 QGraphicsScene *m_scenePreview;
00091 ViewPreview *m_viewPreview;
00092
00093 PdfCropping *m_pdfCropping;
00094 };
00095
00096 #endif // DLG_IMPORT_CROPPING_PDF_H