source: trunk/src/gui/graphicsview/qgraphicssceneevent.h@ 332

Last change on this file since 332 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 8.6 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the QtGui module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QGRAPHICSSCENEEVENT_H
43#define QGRAPHICSSCENEEVENT_H
44
45#include <QtCore/qcoreevent.h>
46#include <QtCore/qpoint.h>
47
48QT_BEGIN_HEADER
49
50QT_BEGIN_NAMESPACE
51
52QT_MODULE(Gui)
53
54#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
55
56class QMimeData;
57class QPointF;
58class QSizeF;
59class QWidget;
60
61class QGraphicsSceneEventPrivate;
62class Q_GUI_EXPORT QGraphicsSceneEvent : public QEvent
63{
64public:
65 QGraphicsSceneEvent(Type type);
66 ~QGraphicsSceneEvent();
67
68 QWidget *widget() const;
69 void setWidget(QWidget *widget);
70
71protected:
72 QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
73 QGraphicsSceneEventPrivate *d_ptr;
74 Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
75};
76
77class QGraphicsSceneMouseEventPrivate;
78class Q_GUI_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent
79{
80public:
81 QGraphicsSceneMouseEvent(Type type = None);
82 ~QGraphicsSceneMouseEvent();
83
84 QPointF pos() const;
85 void setPos(const QPointF &pos);
86
87 QPointF scenePos() const;
88 void setScenePos(const QPointF &pos);
89
90 QPoint screenPos() const;
91 void setScreenPos(const QPoint &pos);
92
93 QPointF buttonDownPos(Qt::MouseButton button) const;
94 void setButtonDownPos(Qt::MouseButton button, const QPointF &pos);
95
96 QPointF buttonDownScenePos(Qt::MouseButton button) const;
97 void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos);
98
99 QPoint buttonDownScreenPos(Qt::MouseButton button) const;
100 void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos);
101
102 QPointF lastPos() const;
103 void setLastPos(const QPointF &pos);
104
105 QPointF lastScenePos() const;
106 void setLastScenePos(const QPointF &pos);
107
108 QPoint lastScreenPos() const;
109 void setLastScreenPos(const QPoint &pos);
110
111 Qt::MouseButtons buttons() const;
112 void setButtons(Qt::MouseButtons buttons);
113
114 Qt::MouseButton button() const;
115 void setButton(Qt::MouseButton button);
116
117 Qt::KeyboardModifiers modifiers() const;
118 void setModifiers(Qt::KeyboardModifiers modifiers);
119
120private:
121 Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
122};
123
124class QGraphicsSceneWheelEventPrivate;
125class Q_GUI_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent
126{
127public:
128 QGraphicsSceneWheelEvent(Type type = None);
129 ~QGraphicsSceneWheelEvent();
130
131 QPointF pos() const;
132 void setPos(const QPointF &pos);
133
134 QPointF scenePos() const;
135 void setScenePos(const QPointF &pos);
136
137 QPoint screenPos() const;
138 void setScreenPos(const QPoint &pos);
139
140 Qt::MouseButtons buttons() const;
141 void setButtons(Qt::MouseButtons buttons);
142
143 Qt::KeyboardModifiers modifiers() const;
144 void setModifiers(Qt::KeyboardModifiers modifiers);
145
146 int delta() const;
147 void setDelta(int delta);
148
149 Qt::Orientation orientation() const;
150 void setOrientation(Qt::Orientation orientation);
151
152private:
153 Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
154};
155
156class QGraphicsSceneContextMenuEventPrivate;
157class Q_GUI_EXPORT QGraphicsSceneContextMenuEvent : public QGraphicsSceneEvent
158{
159public:
160 enum Reason { Mouse, Keyboard, Other };
161
162 QGraphicsSceneContextMenuEvent(Type type = None);
163 ~QGraphicsSceneContextMenuEvent();
164
165 QPointF pos() const;
166 void setPos(const QPointF &pos);
167
168 QPointF scenePos() const;
169 void setScenePos(const QPointF &pos);
170
171 QPoint screenPos() const;
172 void setScreenPos(const QPoint &pos);
173
174 Qt::KeyboardModifiers modifiers() const;
175 void setModifiers(Qt::KeyboardModifiers modifiers);
176
177 Reason reason() const;
178 void setReason(Reason reason);
179
180private:
181 Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
182};
183
184class QGraphicsSceneHoverEventPrivate;
185class Q_GUI_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent
186{
187public:
188 QGraphicsSceneHoverEvent(Type type = None);
189 ~QGraphicsSceneHoverEvent();
190
191 QPointF pos() const;
192 void setPos(const QPointF &pos);
193
194 QPointF scenePos() const;
195 void setScenePos(const QPointF &pos);
196
197 QPoint screenPos() const;
198 void setScreenPos(const QPoint &pos);
199
200 QPointF lastPos() const;
201 void setLastPos(const QPointF &pos);
202
203 QPointF lastScenePos() const;
204 void setLastScenePos(const QPointF &pos);
205
206 QPoint lastScreenPos() const;
207 void setLastScreenPos(const QPoint &pos);
208
209 Qt::KeyboardModifiers modifiers() const;
210 void setModifiers(Qt::KeyboardModifiers modifiers);
211
212private:
213 Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
214};
215
216class QGraphicsSceneHelpEventPrivate;
217class Q_GUI_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent
218{
219public:
220 QGraphicsSceneHelpEvent(Type type = None);
221 ~QGraphicsSceneHelpEvent();
222
223 QPointF scenePos() const;
224 void setScenePos(const QPointF &pos);
225
226 QPoint screenPos() const;
227 void setScreenPos(const QPoint &pos);
228
229private:
230 Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
231};
232
233class QGraphicsSceneDragDropEventPrivate;
234class Q_GUI_EXPORT QGraphicsSceneDragDropEvent : public QGraphicsSceneEvent
235{
236public:
237 QGraphicsSceneDragDropEvent(Type type = None);
238 ~QGraphicsSceneDragDropEvent();
239
240 QPointF pos() const;
241 void setPos(const QPointF &pos);
242
243 QPointF scenePos() const;
244 void setScenePos(const QPointF &pos);
245
246 QPoint screenPos() const;
247 void setScreenPos(const QPoint &pos);
248
249 Qt::MouseButtons buttons() const;
250 void setButtons(Qt::MouseButtons buttons);
251
252 Qt::KeyboardModifiers modifiers() const;
253 void setModifiers(Qt::KeyboardModifiers modifiers);
254
255 Qt::DropActions possibleActions() const;
256 void setPossibleActions(Qt::DropActions actions);
257
258 Qt::DropAction proposedAction() const;
259 void setProposedAction(Qt::DropAction action);
260 void acceptProposedAction();
261
262 Qt::DropAction dropAction() const;
263 void setDropAction(Qt::DropAction action);
264
265 QWidget *source() const;
266 void setSource(QWidget *source);
267
268 const QMimeData *mimeData() const;
269 void setMimeData(const QMimeData *data);
270
271private:
272 Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
273};
274
275class QGraphicsSceneResizeEventPrivate;
276class Q_GUI_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent
277{
278 Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
279public:
280 QGraphicsSceneResizeEvent();
281 ~QGraphicsSceneResizeEvent();
282
283 QSizeF oldSize() const;
284 void setOldSize(const QSizeF &size);
285
286 QSizeF newSize() const;
287 void setNewSize(const QSizeF &size);
288};
289
290class QGraphicsSceneMoveEventPrivate;
291class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
292{
293 Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
294public:
295 QGraphicsSceneMoveEvent();
296 ~QGraphicsSceneMoveEvent();
297
298 QPointF oldPos() const;
299 void setOldPos(const QPointF &pos);
300
301 QPointF newPos() const;
302 void setNewPos(const QPointF &pos);
303};
304
305#endif // QT_NO_GRAPHICSVIEW
306
307QT_END_NAMESPACE
308
309QT_END_HEADER
310
311#endif
Note: See TracBrowser for help on using the repository browser.