00001
00002
00003
00004
00005
00006
00007 #ifndef PDF_CROPPING_H
00008 #define PDF_CROPPING_H
00009
00010 #include <QRect>
00011 #include <QSize>
00012
00013 class PdfFrameHandle;
00014 class QGraphicsRectItem;
00015 class QGraphicsScene;
00016 class QPointF;
00017 class ViewPreview;
00018
00024 class PdfCropping
00025 {
00026 public:
00028 PdfCropping(QGraphicsScene &scene,
00029 ViewPreview &view);
00030
00032 QRectF frameRect () const;
00033
00035 void moveBL (const QPointF &newPos,
00036 const QPointF &oldPos);
00037
00039 void moveBR (const QPointF &newPos,
00040 const QPointF &oldPos);
00041
00043 void moveTL (const QPointF &newPos,
00044 const QPointF &oldPos);
00045
00047 void moveTR (const QPointF &newPos,
00048 const QPointF &oldPos);
00049
00050 static const int PDF_CROPPING_BOTTOM = 1;
00051 static const int PDF_CROPPING_LEFT = 2;
00052 static const int PDF_CROPPING_RIGHT = 4;
00053 static const int PDF_CROPPING_TOP = 8;
00054
00056 QSize windowSize () const;
00057
00058 private:
00059 PdfCropping ();
00060
00061 void createWidgets (QGraphicsScene &scene);
00062 void disableEventsWhileMovingAutomatically();
00063 void enableEventsWhileMovingAutomatically();
00064 QRectF rectFromTLAndBR () const;
00065 void updateBox();
00066
00067 ViewPreview &m_view;
00068
00069
00070 QGraphicsRectItem *m_box;
00071
00072
00073 PdfFrameHandle *m_handleTL;
00074 PdfFrameHandle *m_handleTR;
00075 PdfFrameHandle *m_handleBR;
00076 PdfFrameHandle *m_handleBL;
00077
00078 };
00079
00080 #endif // PDF_CROPPING_H