Qt 4.8
qwindowsysteminterface_qpa_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 #ifndef QWINDOWSYSTEMINTERFACE_QPA_P_H
42 #define QWINDOWSYSTEMINTERFACE_QPA_P_H
43 
45 
47 
49 
51 public:
52  enum EventType {
61  Key,
68  };
69 
71  public:
73  : type(t) { }
74  virtual ~WindowSystemEvent() {}
76  };
77 
78  class CloseEvent : public WindowSystemEvent {
79  public:
81  : WindowSystemEvent(Close), topLevel(tlw) { }
83  };
84 
86  public:
87  GeometryChangeEvent(QWidget *tlw, const QRect &newGeometry)
88  : WindowSystemEvent(GeometryChange), tlw(tlw), newGeometry(newGeometry)
89  { }
92  };
93 
94  class EnterEvent : public WindowSystemEvent {
95  public:
97  : WindowSystemEvent(Enter), enter(enter)
98  { }
100  };
101 
102  class LeaveEvent : public WindowSystemEvent {
103  public:
105  : WindowSystemEvent(Leave), leave(leave)
106  { }
108  };
109 
111  public:
112  ActivatedWindowEvent(QWidget *activatedWindow)
113  : WindowSystemEvent(ActivatedWindow), activated(activatedWindow)
114  { }
116  };
117 
119  public:
121  : WindowSystemEvent(WindowStateChanged), tlw(_tlw), newState(_newState)
122  { }
123 
126  };
127 
128  class UserEvent : public WindowSystemEvent {
129  public:
131  : WindowSystemEvent(t), widget(w), timestamp(time) { }
133  unsigned long timestamp;
134  };
135 
136  class MouseEvent : public UserEvent {
137  public:
138  MouseEvent(QWidget * w, ulong time, const QPoint & local, const QPoint & global, Qt::MouseButtons b)
139  : UserEvent(w, time, Mouse), localPos(local), globalPos(global), buttons(b) { }
142  Qt::MouseButtons buttons;
143  };
144 
145  class WheelEvent : public UserEvent {
146  public:
147  WheelEvent(QWidget *w, ulong time, const QPoint & local, const QPoint & global, int d, Qt::Orientation o)
148  : UserEvent(w, time, Wheel), delta(d), localPos(local), globalPos(global), orient(o) { }
149  int delta;
153  };
154 
155  class KeyEvent : public UserEvent {
156  public:
157  KeyEvent(QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1)
158  :UserEvent(w, time, Key), key(k), unicode(text), repeat(autorep),
159  repeatCount(count), modifiers(mods), keyType(t),
160  nativeScanCode(0), nativeVirtualKey(0), nativeModifiers(0) { }
161  KeyEvent(QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods,
162  quint32 nativeSC, quint32 nativeVK, quint32 nativeMods,
163  const QString & text = QString(), bool autorep = false, ushort count = 1)
164  :UserEvent(w, time, Key), key(k), unicode(text), repeat(autorep),
165  repeatCount(count), modifiers(mods), keyType(t),
166  nativeScanCode(nativeSC), nativeVirtualKey(nativeVK), nativeModifiers(nativeMods) { }
167  int key;
169  bool repeat;
171  Qt::KeyboardModifiers modifiers;
176  };
177 
178  class TouchEvent : public UserEvent {
179  public:
181  :UserEvent(w, time, Touch), devType(d), points(p), touchType(t) { }
185 
186  };
187 
189  public:
190  ScreenCountEvent (int count)
191  : WindowSystemEvent(ScreenCountChange) , count(count) { }
192  int count;
193  };
194 
196  public:
198  : WindowSystemEvent(ScreenGeometry), index(index) { }
199  int index;
200  };
201 
203  public:
205  : WindowSystemEvent(ScreenAvailableGeometry), index(index) { }
206  int index;
207  };
208 
210  public:
213  };
214 
216  public:
220  };
221 
224 
225  static int windowSystemEventsQueued();
227  static void queueWindowSystemEvent(WindowSystemEvent *ev);
228 
229  static QTime eventTime;
230 };
231 
234 
235 #endif // QWINDOWSYSTEMINTERFACE_QPA_P_H
double d
Definition: qnumeric_p.h:62
TouchEvent(QWidget *w, ulong time, QEvent::Type t, QTouchEvent::DeviceType d, const QList< QTouchEvent::TouchPoint > &p)
Qt::KeyboardModifiers modifiers
This property holds the keyboard modifier flags that existed immediately before the event occurred...
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
QPointer< QWidget > widget
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
WindowStateChangedEvent(QWidget *_tlw, Qt::WindowState _newState)
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
UserEvent(QWidget *w, ulong time, EventType t)
KeyEvent(QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
Qt::MouseButtons buttons
This property holds the mouse buttons pressed when the event was generated.
The QString class provides a Unicode character string.
Definition: qstring.h:83
DeviceType
This enum represents the type of device that generated a QTouchEvent.
Definition: qevent.h:805
int key
This property holds the code of the key that was pressed or released.
KeyEvent(QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, quint32 nativeSC, quint32 nativeVK, quint32 nativeMods, const QString &text=QString(), bool autorep=false, ushort count=1)
static QList< WindowSystemEvent * > windowSystemEventQueue
The QTime class provides clock time functions.
Definition: qdatetime.h:148
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static void queueWindowSystemEvent(WindowSystemEvent *ev)
unsigned long ulong
Definition: qglobal.h:997
WheelEvent(QWidget *w, ulong time, const QPoint &local, const QPoint &global, int d, Qt::Orientation o)
static WindowSystemEvent * getWindowSystemEvent()
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
MouseEvent(QWidget *w, ulong time, const QPoint &local, const QPoint &global, Qt::MouseButtons b)
unsigned short ushort
Definition: qglobal.h:995
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
unsigned int quint32
Definition: qglobal.h:938
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
quint16 index
GeometryChangeEvent(QWidget *tlw, const QRect &newGeometry)
Orientation
Definition: qnamespace.h:174
#define QT_END_HEADER
Definition: qglobal.h:137
WindowState
Definition: qnamespace.h:366
#define text
Definition: qobjectdefs.h:80