00001
00002
00003
00004
00005
00006
00007 #ifndef NON_PDF_CROPPING_H
00008 #define NON_PDF_CROPPING_H
00009
00010 #include <QRect>
00011 #include <QSize>
00012
00013 class NonPdfFrameHandle;
00014 class QGraphicsRectItem;
00015 class QGraphicsScene;
00016 class QPointF;
00017 class ViewPreview;
00018
00022 class NonPdfCropping
00023 {
00024 public:
00026 NonPdfCropping(QGraphicsScene &scene,
00027 ViewPreview &view);
00028
00030 QRectF frameRect () const;
00031
00033 void moveBL (const QPointF &newPos,
00034 const QPointF &oldPos);
00035
00037 void moveBR (const QPointF &newPos,
00038 const QPointF &oldPos);
00039
00041 void moveTL (const QPointF &newPos,
00042 const QPointF &oldPos);
00043
00045 void moveTR (const QPointF &newPos,
00046 const QPointF &oldPos);
00047
00048 static const int NON_PDF_CROPPING_BOTTOM = 1;
00049 static const int NON_PDF_CROPPING_LEFT = 2;
00050 static const int NON_PDF_CROPPING_RIGHT = 4;
00051 static const int NON_PDF_CROPPING_TOP = 8;
00052
00054 QSize windowSize () const;
00055
00056 private:
00057 NonPdfCropping ();
00058
00059 void createWidgets (QGraphicsScene &scene);
00060 void disableEventsWhileMovingAutomatically();
00061 void enableEventsWhileMovingAutomatically();
00062 QRectF rectFromTLAndBR () const;
00063 void updateBox();
00064
00065 ViewPreview &m_view;
00066
00067
00068 QGraphicsRectItem *m_box;
00069
00070
00071 NonPdfFrameHandle *m_handleTL;
00072 NonPdfFrameHandle *m_handleTR;
00073 NonPdfFrameHandle *m_handleBR;
00074 NonPdfFrameHandle *m_handleBL;
00075
00076 };
00077
00078 #endif // NON_PDF_CROPPING_H