krita
kis_strategy_move.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KIS_STRATEGY_MOVE_H_
00020 #define KIS_STRATEGY_MOVE_H_
00021
00022 #include <qpoint.h>
00023 #include <qrect.h>
00024
00025 #include <koffice_export.h>
00026
00027 class KisCanvasController;
00028 class KisCanvasSubject;
00029
00030 class KRITAUI_EXPORT KisStrategyMove {
00031 public:
00032 KisStrategyMove();
00033 explicit KisStrategyMove(KisCanvasSubject *subject);
00034 virtual ~KisStrategyMove();
00035
00036 public:
00037 void reset(KisCanvasSubject *subject);
00038 void startDrag(const QPoint& pos);
00039 void drag(const QPoint& pos);
00040 void endDrag(const QPoint& pos, bool undo = true);
00041 void simpleMove(const QPoint& pt1, const QPoint& pt2);
00042 void simpleMove(Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2);
00043
00044 private:
00045 KisStrategyMove(const KisStrategyMove&);
00046 KisStrategyMove& operator=(const KisStrategyMove&);
00047
00048 private:
00049 KisCanvasController *m_controller;
00050 KisCanvasSubject *m_subject;
00051 QRect m_deviceBounds;
00052 QPoint m_dragStart;
00053 QPoint m_layerStart;
00054 QPoint m_layerPosition;
00055 bool m_dragging;
00056 };
00057
00058 #endif // KIS_STRATEGY_MOVE_H_
00059
|