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