VR-Forces 4.2 Class Documentation
dragDropHandler.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2003 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: dragDropHandler.h,v $ $Revision: 1.18 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DRAGDROPHANDLER_H_
13 #define DRAGDROPHANDLER_H_
14 
15 #include "tmqt/eventHandler.h"
16 #include "symbolMapper/modelData.h"
18 
19 #include <QtCore/QTimer>
20 #include <QtCore/QDateTime>
21 #include <QtCore/QHash>
22 
23 class DtBaseWindow;
24 class DtDragObject;
25 class DtTMMapArea;
26 class DtStdContextMenu;
27 class DtSymbol;
28 
33 {
34  Q_OBJECT
35 
36 public:
37  DtDragData(DtTMMapArea* area, DtEventHandler* parent);
38 
39  virtual ~DtDragData();
40 
41  virtual void reset();
42 
43 public slots:
47  virtual void showDraggedSymbol();
48  virtual void symbolRemoved(const DtModelKey& symbol);
49 
50 public:
54  bool myEndDrag;
55  QTimer* myDragTimer;
56  QTime myDrawTimer;
58  QVector<DtModelKey> myDragData;
60  Qt::MouseButtons myMouseButtonState;
61 };
62 
65 {
66  Q_OBJECT
67 
68 public:
69 
72 
74  virtual ~DtDragDropHandler();
75 
79  virtual bool isValidForDrag(DtTMMapArea* map, DtModelKey &key);
80 
84  virtual DtDragObject* createDragObject(DtTMMapArea* activeMap, QString &dragging);
85 
87  virtual void dragMove(DtTMMapArea* area, DtModelData* data, const DtPoint& delta);
88 
89 public:
91  static DtEventHandler* create(DtEventController* owner, void* usr);
92 
93 public slots:
94  virtual bool mouseEvent(DtTMMapArea* area, QMouseEvent* evnt, const DtPoint& pnt);
95 
96 protected slots:
99  virtual bool dropSymbols(DtTMMapArea* area, QDropEvent* e);
100 
101 public:
102  virtual bool dropEvent(DtTMMapArea* area, QDropEvent* evnt);
103  virtual bool dragMoveEvent(DtTMMapArea* area, QDragMoveEvent* evnt);
104  virtual bool dragEnterEvent(DtTMMapArea* area, QDragEnterEvent* evnt);
105  virtual bool dragLeaveEvent(DtTMMapArea* area, QDragLeaveEvent* evnt);
106 
107 protected:
109  virtual bool canDrag(DtTMMapArea* area) const;
110 
112  virtual void endDrag(DtTMMapArea* area, int timerMsec);
113 
121  virtual bool getDropLocationData(DtTMMapArea* area, const QPoint& dropPoint, QString& idStr, QVector<DtPoint>& pnts, double heightChange);
122 
124  virtual DtDragData* dragDataForArea(DtTMMapArea* area);
125 
126  virtual void tick();
127 
129  virtual void dropSymbol(DtTMMapArea* area, const QPoint& dropPoint, DtModelData* symData, double heightChange = 0.);
130 
133  virtual int timeout() const;
134 
136  virtual bool dragAboutToStart(DtTMMapArea*);
137 
139  virtual void modifyPoint(const DtModelData& data, DtPoint& pnt);
140 
141  virtual bool dropSymbols(DtTMMapArea* area, const QPoint& dropPoint, const QString& idStr, double heightChange = 0.);
142 
143 protected:
144  QHash<DtTMMapArea*, DtDragData*> myMapDragData;
146 };
147 
148 #endif //DRAGDROPHANDLER_H_
149 
150 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)