1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
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 The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file.  Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
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 
53 QT_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
67 class QKeyEventEx : public QKeyEvent
68 {
69 public:
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 
77 protected:
78     quint32 nScanCode;
79     quint32 nVirtualKey;
80     quint32 nModifiers;
81     friend class QKeyEvent;
82 };
83 
84 // ### Qt 5: remove
85 class QMouseEventEx : public QMouseEvent
86 {
87 public:
88     QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos,
89                   Qt::MouseButton button, Qt::MouseButtons buttons,
90                   Qt::KeyboardModifiers modifiers);
91     ~QMouseEventEx();
92 
93 protected:
94     QPointF posF;
95     friend class QMouseEvent;
96 };
97 
98 class QTouchEventTouchPointPrivate
99 {
100 public:
QTouchEventTouchPointPrivate(int id)101     inline QTouchEventTouchPointPrivate(int id)
102         : ref(1),
103           id(id),
104           state(Qt::TouchPointReleased),
105           pressure(qreal(-1.))
106     { }
107 
detach()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
128 class QNativeGestureEvent : public QEvent
129 {
130 public:
131     enum Type {
132         None,
133         GestureBegin,
134         GestureEnd,
135         Pan,
136         Zoom,
137         Rotate,
138         Swipe
139     };
140 
QNativeGestureEvent()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 
159 class QGestureEventPrivate
160 {
161 public:
QGestureEventPrivate(const QList<QGesture * > & list)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 
174 class QFileOpenEventPrivate
175 {
176 public:
QFileOpenEventPrivate(const QUrl & url)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 
189 QT_END_NAMESPACE
190 
191 #endif // QEVENT_P_H
192