1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this 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 have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef QEVENT_P_H
|
---|
43 | #define QEVENT_P_H
|
---|
44 |
|
---|
45 | #include <QtCore/qglobal.h>
|
---|
46 | #include <QtCore/qurl.h>
|
---|
47 | #include <QtGui/qevent.h>
|
---|
48 |
|
---|
49 | QT_BEGIN_NAMESPACE
|
---|
50 |
|
---|
51 | //
|
---|
52 | // W A R N I N G
|
---|
53 | // -------------
|
---|
54 | //
|
---|
55 | // This file is not part of the Qt API. It exists purely as an
|
---|
56 | // implementation detail. This header file may change from version to
|
---|
57 | // version without notice, or even be removed.
|
---|
58 | //
|
---|
59 | // We mean it.
|
---|
60 | //
|
---|
61 |
|
---|
62 | // ### Qt 5: remove
|
---|
63 | class QKeyEventEx : public QKeyEvent
|
---|
64 | {
|
---|
65 | public:
|
---|
66 | QKeyEventEx(Type type, int key, Qt::KeyboardModifiers modifiers,
|
---|
67 | const QString &text, bool autorep, ushort count,
|
---|
68 | quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers);
|
---|
69 | QKeyEventEx(const QKeyEventEx &other);
|
---|
70 |
|
---|
71 | ~QKeyEventEx();
|
---|
72 |
|
---|
73 | protected:
|
---|
74 | quint32 nScanCode;
|
---|
75 | quint32 nVirtualKey;
|
---|
76 | quint32 nModifiers;
|
---|
77 | friend class QKeyEvent;
|
---|
78 | };
|
---|
79 |
|
---|
80 | // ### Qt 5: remove
|
---|
81 | class QMouseEventEx : public QMouseEvent
|
---|
82 | {
|
---|
83 | public:
|
---|
84 | QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos,
|
---|
85 | Qt::MouseButton button, Qt::MouseButtons buttons,
|
---|
86 | Qt::KeyboardModifiers modifiers);
|
---|
87 | ~QMouseEventEx();
|
---|
88 |
|
---|
89 | protected:
|
---|
90 | QPointF posF;
|
---|
91 | friend class QMouseEvent;
|
---|
92 | };
|
---|
93 |
|
---|
94 | class QTouchEventTouchPointPrivate
|
---|
95 | {
|
---|
96 | public:
|
---|
97 | inline QTouchEventTouchPointPrivate(int id)
|
---|
98 | : ref(1),
|
---|
99 | id(id),
|
---|
100 | state(Qt::TouchPointReleased),
|
---|
101 | pressure(qreal(-1.))
|
---|
102 | { }
|
---|
103 |
|
---|
104 | inline QTouchEventTouchPointPrivate *detach()
|
---|
105 | {
|
---|
106 | QTouchEventTouchPointPrivate *d = new QTouchEventTouchPointPrivate(*this);
|
---|
107 | d->ref = 1;
|
---|
108 | if (!this->ref.deref())
|
---|
109 | delete this;
|
---|
110 | return d;
|
---|
111 | }
|
---|
112 |
|
---|
113 | QAtomicInt ref;
|
---|
114 | int id;
|
---|
115 | Qt::TouchPointStates state;
|
---|
116 | QRectF rect, sceneRect, screenRect;
|
---|
117 | QPointF normalizedPos,
|
---|
118 | startPos, startScenePos, startScreenPos, startNormalizedPos,
|
---|
119 | lastPos, lastScenePos, lastScreenPos, lastNormalizedPos;
|
---|
120 | qreal pressure;
|
---|
121 | };
|
---|
122 |
|
---|
123 | #ifndef QT_NO_GESTURES
|
---|
124 | class QNativeGestureEvent : public QEvent
|
---|
125 | {
|
---|
126 | public:
|
---|
127 | enum Type {
|
---|
128 | None,
|
---|
129 | GestureBegin,
|
---|
130 | GestureEnd,
|
---|
131 | Pan,
|
---|
132 | Zoom,
|
---|
133 | Rotate,
|
---|
134 | Swipe
|
---|
135 | };
|
---|
136 |
|
---|
137 | QNativeGestureEvent()
|
---|
138 | : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0)
|
---|
139 | #ifdef Q_WS_WIN
|
---|
140 | , sequenceId(0), argument(0)
|
---|
141 | #endif
|
---|
142 | {
|
---|
143 | }
|
---|
144 |
|
---|
145 | Type gestureType;
|
---|
146 | float percentage;
|
---|
147 | QPoint position;
|
---|
148 | float angle;
|
---|
149 | #ifdef Q_WS_WIN
|
---|
150 | ulong sequenceId;
|
---|
151 | quint64 argument;
|
---|
152 | #endif
|
---|
153 | };
|
---|
154 |
|
---|
155 | class QGestureEventPrivate
|
---|
156 | {
|
---|
157 | public:
|
---|
158 | inline QGestureEventPrivate(const QList<QGesture *> &list)
|
---|
159 | : gestures(list), widget(0)
|
---|
160 | {
|
---|
161 | }
|
---|
162 |
|
---|
163 | QList<QGesture *> gestures;
|
---|
164 | QWidget *widget;
|
---|
165 | QMap<Qt::GestureType, bool> accepted;
|
---|
166 | QMap<Qt::GestureType, QWidget *> targetWidgets;
|
---|
167 | };
|
---|
168 | #endif // QT_NO_GESTURES
|
---|
169 |
|
---|
170 | class QFileOpenEventPrivate
|
---|
171 | {
|
---|
172 | public:
|
---|
173 | inline QFileOpenEventPrivate(const QUrl &url)
|
---|
174 | : url(url)
|
---|
175 | {
|
---|
176 | }
|
---|
177 |
|
---|
178 | QUrl url;
|
---|
179 | };
|
---|
180 |
|
---|
181 | QT_END_NAMESPACE
|
---|
182 |
|
---|
183 | #endif // QEVENT_P_H
|
---|