Warning, file /sdk/ktechlab/src/eventinfo.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /*************************************************************************** 0002 * Copyright (C) 2005 by David Saxton * 0003 * david@bluehaze.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 ***************************************************************************/ 0010 0011 #ifndef EVENTINFO_H 0012 #define EVENTINFO_H 0013 0014 #include <QPoint> 0015 0016 class ItemView; 0017 0018 class KtlQCanvasItem; 0019 class QEvent; 0020 class QMouseEvent; 0021 class QWheelEvent; 0022 0023 /** 0024 Contains information from for a mouse event that occurred on a canvas. Like a 0025 QMouseEvent / QEvent / QWheelEvent, but abstracted to the canvas coordinate 0026 system, as well as holding lots of useful information. 0027 @author David Saxton 0028 */ 0029 class EventInfo 0030 { 0031 public: 0032 EventInfo(); 0033 EventInfo(ItemView *itemView, QMouseEvent *e); 0034 EventInfo(ItemView *itemView, QWheelEvent *e); 0035 EventInfo(ItemView *itemView, QEvent *e); 0036 0037 QMouseEvent *mousePressEvent(int dx, int dy) const; 0038 QMouseEvent *mouseReleaseEvent(int dx, int dy) const; 0039 QMouseEvent *mouseDoubleClickEvent(int dx, int dy) const; 0040 QMouseEvent *mouseMoveEvent(int dx, int dy) const; 0041 QWheelEvent *wheelEvent(int dx, int dy) const; 0042 0043 QPoint pos; 0044 QPoint globalPos; 0045 KtlQCanvasItem *qcanvasItemClickedOn; 0046 short scrollDelta; 0047 Qt::Orientation scrollOrientation; 0048 bool isRightClick; 0049 bool isMiddleClick; 0050 bool ctrlPressed; 0051 bool shiftPressed; 0052 bool altPressed; 0053 0054 protected: 0055 void extractPos(ItemView *itemView, const QPoint &contentsMouseClick); 0056 void reset(); 0057 }; 0058 0059 #endif