krita

kis_strategy_move.h

00001 /*
00002  *  Copyright (c) 2002 Patrick Julien  <freak@codepimps.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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 
KDE Home | KDE Accessibility Home | Description of Access Keys