home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / canvasgesture.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-12-28  |  3.0 KB  |  80 lines

  1. /*
  2.  For general Scribus (>=1.3.2) copyright and licensing information please refer
  3.  to the COPYING file provided with the program. Following this notice may exist
  4.  a copyright and/or license notice that predates the release of Scribus 1.3.2
  5.  for which a new license (GPL+exception) is in place.
  6.  */
  7. /***************************************************************************
  8. *                                                                         *
  9. *   This program is free software; you can redistribute it and/or modify  *
  10. *   it under the terms of the GNU General Public License as published by  *
  11. *   the Free Software Foundation; either version 2 of the License, or     *
  12. *   (at your option) any later version.                                   *
  13. *                                                                         *
  14. ***************************************************************************/
  15.  
  16.  
  17.  
  18. #ifndef CANVAS_GESTURE_H
  19. #define CANVAS_GESTURE_H
  20.  
  21. #include "scribusapi.h"
  22. #include "canvasmode.h"
  23.  
  24. class QDragEnterEvent;
  25. class QDragMoveEvent;
  26. class QDragLeaveEvent;
  27. class QDropEvent;
  28. class QEvent;
  29. class QInputMethodEvent;
  30. class QMouseEvent;
  31. class QKeyEvent;
  32. class QPainter;
  33.  
  34. class  Canvas;
  35. struct CanvasViewMode;
  36. class  ScribusDoc;
  37. class  ScribusView;
  38.  
  39.  
  40.  
  41. /**
  42.   This class is a superclass for canvas gestures. CanvasGestures are
  43.   temporary canvasmodes which have a pointer to the CanvasMode in which they
  44.   started. ScribusView::stopGesture() will return control to that mode.
  45.   By default, all events are delegated to the canvas mode.
  46.  */
  47. class SCRIBUS_API CanvasGesture : public CanvasMode
  48. {
  49. protected:
  50.     CanvasGesture (CanvasMode* parent) : CanvasMode(parent->view()), m_delegate(parent) {};
  51.     CanvasGesture (ScribusView* view) : CanvasMode(view), m_delegate(NULL) {};
  52.     
  53. public:    
  54.     virtual void enterEvent(QEvent * e) { m_delegate->enterEvent(e); }
  55.     virtual void leaveEvent(QEvent * e) { m_delegate->leaveEvent(e); }
  56.  
  57.     virtual void dragEnterEvent(QDragEnterEvent *e) { m_delegate->dragEnterEvent(e); }
  58.     virtual void dragMoveEvent(QDragMoveEvent *e) { m_delegate->dragMoveEvent(e); }
  59.     virtual void dragLeaveEvent(QDragLeaveEvent *e) { m_delegate->dragLeaveEvent(e); }
  60.     virtual void dropEvent(QDropEvent *e) { m_delegate->dropEvent(e); }
  61.     
  62.     virtual void mouseDoubleClickEvent(QMouseEvent *m) { m_delegate->mouseDoubleClickEvent(m); }
  63.     virtual void mouseReleaseEvent(QMouseEvent *m) { m_delegate->mouseReleaseEvent(m); }
  64.     virtual void mouseMoveEvent(QMouseEvent *m) { m_delegate->mouseMoveEvent(m); }
  65.     virtual void mousePressEvent(QMouseEvent *m) { m_delegate->mousePressEvent(m); }
  66.  
  67.     virtual void keyPressEvent(QKeyEvent *e) { m_delegate->keyPressEvent(e); }
  68.     virtual void keyReleaseEvent(QKeyEvent *e) { m_delegate->keyReleaseEvent(e); }
  69.     virtual void inputMethodEvent(QInputMethodEvent *e) { m_delegate->inputMethodEvent(e); }
  70.     
  71.     CanvasMode* delegate() { return m_delegate; }
  72.     void setDelegate(CanvasMode* delegate) { if (delegate) m_delegate = delegate; }
  73.     
  74. protected:
  75.     CanvasMode* m_delegate;
  76. };
  77.  
  78.  
  79. #endif
  80.