[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[2] | 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 | **
|
---|
[561] | 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.
|
---|
[2] | 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 | **
|
---|
[561] | 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
[2] | 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | #ifndef QEVENT_P_H
|
---|
| 43 | #define QEVENT_P_H
|
---|
| 44 |
|
---|
| 45 | #include <QtCore/qglobal.h>
|
---|
[561] | 46 | #include <QtCore/qurl.h>
|
---|
| 47 | #include <QtGui/qevent.h>
|
---|
[2] | 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
|
---|
[561] | 63 | class QKeyEventEx : public QKeyEvent
|
---|
[2] | 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
|
---|
[561] | 81 | class QMouseEventEx : public QMouseEvent
|
---|
[2] | 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 |
|
---|
[561] | 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 | class QNativeGestureEvent : public QEvent
|
---|
| 124 | {
|
---|
| 125 | public:
|
---|
| 126 | enum Type {
|
---|
| 127 | None,
|
---|
| 128 | GestureBegin,
|
---|
| 129 | GestureEnd,
|
---|
| 130 | Pan,
|
---|
| 131 | Zoom,
|
---|
| 132 | Rotate,
|
---|
| 133 | Swipe
|
---|
| 134 | };
|
---|
| 135 |
|
---|
| 136 | QNativeGestureEvent()
|
---|
| 137 | : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0)
|
---|
| 138 | #ifdef Q_WS_WIN
|
---|
| 139 | , sequenceId(0), argument(0)
|
---|
| 140 | #endif
|
---|
| 141 | {
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | Type gestureType;
|
---|
| 145 | float percentage;
|
---|
| 146 | QPoint position;
|
---|
| 147 | float angle;
|
---|
| 148 | #ifdef Q_WS_WIN
|
---|
| 149 | ulong sequenceId;
|
---|
| 150 | quint64 argument;
|
---|
| 151 | #endif
|
---|
| 152 | };
|
---|
| 153 |
|
---|
| 154 | class QGestureEventPrivate
|
---|
| 155 | {
|
---|
| 156 | public:
|
---|
| 157 | inline QGestureEventPrivate(const QList<QGesture *> &list)
|
---|
| 158 | : gestures(list), widget(0)
|
---|
| 159 | {
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | QList<QGesture *> gestures;
|
---|
| 163 | QWidget *widget;
|
---|
| 164 | QMap<Qt::GestureType, bool> accepted;
|
---|
| 165 | QMap<Qt::GestureType, QWidget *> targetWidgets;
|
---|
| 166 | };
|
---|
| 167 |
|
---|
| 168 |
|
---|
| 169 | class QFileOpenEventPrivate
|
---|
| 170 | {
|
---|
| 171 | public:
|
---|
| 172 | inline QFileOpenEventPrivate(const QUrl &url)
|
---|
| 173 | : url(url)
|
---|
| 174 | {
|
---|
| 175 | }
|
---|
| 176 |
|
---|
| 177 | QUrl url;
|
---|
| 178 | };
|
---|
| 179 |
|
---|
[2] | 180 | QT_END_NAMESPACE
|
---|
| 181 |
|
---|
| 182 | #endif // QEVENT_P_H
|
---|