canvasgesture.h
Go to the documentation of this file.00001 /* 00002 For general Scribus (>=1.3.2) copyright and licensing information please refer 00003 to the COPYING file provided with the program. Following this notice may exist 00004 a copyright and/or license notice that predates the release of Scribus 1.3.2 00005 for which a new license (GPL+exception) is in place. 00006 */ 00007 /*************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 00017 00018 #ifndef CANVAS_GESTURE_H 00019 #define CANVAS_GESTURE_H 00020 00021 #include "scribusapi.h" 00022 #include "canvasmode.h" 00023 00024 class QDragEnterEvent; 00025 class QDragMoveEvent; 00026 class QDragLeaveEvent; 00027 class QDropEvent; 00028 class QEvent; 00029 class QInputMethodEvent; 00030 class QMouseEvent; 00031 class QKeyEvent; 00032 class QPainter; 00033 00034 class Canvas; 00035 struct CanvasViewMode; 00036 class ScribusDoc; 00037 class ScribusView; 00038 00039 00040 00047 class SCRIBUS_API CanvasGesture : public CanvasMode 00048 { 00049 protected: 00050 CanvasGesture (CanvasMode* parent) : CanvasMode(parent->view()), m_delegate(parent) {}; 00051 CanvasGesture (ScribusView* view) : CanvasMode(view), m_delegate(NULL) {}; 00052 00053 public: 00054 virtual void enterEvent(QEvent * e) { m_delegate->enterEvent(e); } 00055 virtual void leaveEvent(QEvent * e) { m_delegate->leaveEvent(e); } 00056 00057 virtual void dragEnterEvent(QDragEnterEvent *e) { m_delegate->dragEnterEvent(e); } 00058 virtual void dragMoveEvent(QDragMoveEvent *e) { m_delegate->dragMoveEvent(e); } 00059 virtual void dragLeaveEvent(QDragLeaveEvent *e) { m_delegate->dragLeaveEvent(e); } 00060 virtual void dropEvent(QDropEvent *e) { m_delegate->dropEvent(e); } 00061 00062 virtual void mouseDoubleClickEvent(QMouseEvent *m) { m_delegate->mouseDoubleClickEvent(m); } 00063 virtual void mouseReleaseEvent(QMouseEvent *m) { m_delegate->mouseReleaseEvent(m); } 00064 virtual void mouseMoveEvent(QMouseEvent *m) { m_delegate->mouseMoveEvent(m); } 00065 virtual void mousePressEvent(QMouseEvent *m) { m_delegate->mousePressEvent(m); } 00066 00067 virtual void keyPressEvent(QKeyEvent *e) { m_delegate->keyPressEvent(e); } 00068 virtual void keyReleaseEvent(QKeyEvent *e) { m_delegate->keyReleaseEvent(e); } 00069 virtual void inputMethodEvent(QInputMethodEvent *e) { m_delegate->inputMethodEvent(e); } 00070 00071 CanvasMode* delegate() { return m_delegate; } 00072 void setDelegate(CanvasMode* delegate) { if (delegate) m_delegate = delegate; } 00073 00074 protected: 00075 CanvasMode* m_delegate; 00076 }; 00077 00078 00079 #endif
