Qt 4.8
qevent_p.h
Go to the documentation of this file.
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 
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,
73  QKeyEventEx(const QKeyEventEx &other);
74 
75  ~QKeyEventEx();
76 
77 protected:
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:
95  friend class QMouseEvent;
96 };
97 
99 {
100 public:
102  : ref(1),
103  id(id),
104  state(Qt::TouchPointReleased),
105  pressure(qreal(-1.))
106  { }
107 
109  {
111  d->ref = 1;
112  if (!this->ref.deref())
113  delete this;
114  return d;
115  }
116 
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;
125 };
126 
127 #ifndef QT_NO_GESTURES
129 {
130 public:
131  enum Type {
138  Swipe
139  };
140 
142  : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0)
143 #ifdef Q_WS_WIN
144  , sequenceId(0), argument(0)
145 #endif
146  {
147  }
148 
150  float percentage;
152  float angle;
153 #ifdef Q_WS_WIN
156 #endif
157 };
158 
160 {
161 public:
163  : gestures(list), widget(0)
164  {
165  }
166 
171 };
172 #endif // QT_NO_GESTURES
173 
175 {
176 public:
177  inline QFileOpenEventPrivate(const QUrl &url)
178  : url(url)
179  {
180  }
182 
184 #ifdef Q_OS_SYMBIAN
185  RFile file;
186 #endif
187 };
188 
190 
191 #endif // QEVENT_P_H
The QKeyEvent class describes a key event.
Definition: qevent.h:224
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Definition: qatomic.h:55
quint32 nVirtualKey
Definition: qevent_p.h:79
quint32 nativeScanCode() const
Returns the native scan code of the key event.
Definition: qevent.cpp:872
Qt::TouchPointStates state
Definition: qevent_p.h:119
#define Q_WS_WIN
Defined on Windows.
Definition: qglobal.h:921
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QWidget * widget
Definition: qevent_p.h:168
quint32 nativeModifiers() const
Returns the native modifiers of a key event.
Definition: qevent.cpp:906
quint32 nModifiers
Definition: qevent_p.h:80
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
Definition: qevent.cpp:999
int key() const
Returns the code of the key that was pressed or released.
Definition: qevent.h:231
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
unsigned __int64 quint64
Definition: qglobal.h:943
QMap< Qt::GestureType, QWidget * > targetWidgets
Definition: qevent_p.h:170
int count() const
Returns the number of keys involved in this event.
Definition: qevent.h:238
unsigned long ulong
Definition: qglobal.h:997
QTouchEventTouchPointPrivate * detach()
Definition: qevent_p.h:108
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
QEventPrivate * d
Definition: qcoreevent.h:315
quint32 nScanCode
Definition: qevent_p.h:78
~QKeyEventEx()
Definition: qevent.cpp:947
QList< QGesture * > gestures
Definition: qevent_p.h:167
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
QString text() const
Returns the Unicode text that this key generated.
Definition: qevent.h:236
unsigned short ushort
Definition: qglobal.h:995
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QTouchEventTouchPointPrivate(int id)
Definition: qevent_p.h:101
unsigned int quint32
Definition: qglobal.h:938
Definition: qnamespace.h:54
QGestureEventPrivate(const QList< QGesture *> &list)
Definition: qevent_p.h:162
QPointF posF
Definition: qevent_p.h:94
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
QMap< Qt::GestureType, bool > accepted
Definition: qevent_p.h:169
QFileOpenEventPrivate(const QUrl &url)
Definition: qevent_p.h:177
quint32 nativeVirtualKey() const
Returns the native virtual key, or key sym of the key event.
Definition: qevent.cpp:889
QKeyEventEx(Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text, bool autorep, ushort count, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers)
Creates an extended key event object, which in addition to the normal key event data, also contains the native scan code, virtual key and modifiers.
Definition: qevent.cpp:921
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
MouseButton
Definition: qnamespace.h:150