canvasmode_legacy.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CANVAS_MODE_LEGACY_H
00019 #define CANVAS_MODE_LEGACY_H
00020
00021 #include <QObject>
00022 #include <QTime>
00023
00024 #include "canvasmode.h"
00025 #include "fpointarray.h"
00026
00027 class LineMove;
00028 class PageItem;
00029 class PageItem_TextFrame;
00030 class QTimer;
00031 class ResizeGesture;
00032 class RulerGesture;
00033 class ScribusMainWindow;
00034 class ScribusView;
00035
00036
00037
00038
00039 class LegacyMode : public QObject, public CanvasMode
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 LegacyMode(ScribusView* view);
00045
00046 virtual void enterEvent(QEvent *);
00047 virtual void leaveEvent(QEvent *);
00048
00049 virtual void activate(bool);
00050 virtual void deactivate(bool);
00051 virtual void mouseDoubleClickEvent(QMouseEvent *m);
00052 virtual void mouseReleaseEvent(QMouseEvent *m);
00053 virtual void mouseMoveEvent(QMouseEvent *m);
00054 virtual void mousePressEvent(QMouseEvent *m);
00055 virtual void drawControls(QPainter* p);
00056
00057 protected:
00058 void setResizeCursor(int);
00059
00060 private:
00061 inline bool GetItem(PageItem** pi);
00062 void drawTextCursor(QPainter* p, PageItem_TextFrame* textframe);
00063 void selectPage(QMouseEvent *m);
00064 bool SeleItem(QMouseEvent *m);
00065 void SetupDraw(int Nr);
00066 void SetupDrawNoResize(int nr);
00067 void createContextMenu(PageItem *currItem, double mx, double my);
00068 int HandleSizer(PageItem *currItem, QRect mpo, QMouseEvent *m);
00069
00070 int Cp, oldCp;
00071 bool inItemCreation, shiftSelItems, FirstPoly;
00072 int frameResizeHandle;
00073 int RotMode;
00074 int dragConstrainInitPtX, dragConstrainInitPtY;
00075 double Mxp, Myp, Dxp, Dyp;
00076 int GxM, GyM;
00077 double SeRx, SeRy;
00078 bool MoveGX, MoveGY;
00079 FPointArray RecordP;
00080 ScribusMainWindow* m_ScMW;
00081 ResizeGesture* resizeGesture;
00082 LineMove* lineMoveGesture;
00083 RulerGesture* guideMoveGesture;
00084 bool m_cursorVisible;
00085 QTime m_blinkTime;
00086 QTimer* m_blinker;
00087
00088 public slots:
00089 void importToPage();
00090
00091 private slots:
00092 void blinkTextCursor();
00093 };
00094
00095
00096 #endif