Qt 4.8
qwindowsysteminterface_qpa.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_H
42 #define QWINDOWSYSTEMINTERFACE_H
43 
44 #include <QtCore/QTime>
45 #include <QtGui/qwindowdefs.h>
46 #include <QtCore/QEvent>
47 #include <QtGui/QWidget>
48 #include <QtCore/QWeakPointer>
49 #include <QtCore/QMutex>
50 #include <QtGui/QTouchEvent>
51 
53 
55 
56 QT_MODULE(Gui)
57 
59 {
60 public:
61  static void handleMouseEvent(QWidget *w, const QPoint & local, const QPoint & global, Qt::MouseButtons b);
62  static void handleMouseEvent(QWidget *w, ulong timestamp, const QPoint & local, const QPoint & global, Qt::MouseButtons b);
63 
64  static void handleKeyEvent(QWidget *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
65  static void handleKeyEvent(QWidget *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
66 
67  static void handleExtendedKeyEvent(QWidget *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
68  quint32 nativeScanCode, quint32 nativeVirtualKey,
69  quint32 nativeModifiers,
70  const QString& text = QString(), bool autorep = false,
71  ushort count = 1);
72  static void handleExtendedKeyEvent(QWidget *w, ulong timestamp, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
73  quint32 nativeScanCode, quint32 nativeVirtualKey,
74  quint32 nativeModifiers,
75  const QString& text = QString(), bool autorep = false,
76  ushort count = 1);
77 
78  static void handleWheelEvent(QWidget *w, const QPoint & local, const QPoint & global, int d, Qt::Orientation o);
79  static void handleWheelEvent(QWidget *w, ulong timestamp, const QPoint & local, const QPoint & global, int d, Qt::Orientation o);
80 
81  struct TouchPoint {
82  int id; // for application use
83  bool isPrimary; // for application use
84  QPointF normalPosition; // touch device coordinates, (0 to 1, 0 to 1)
85  QRectF area; // the touched area, centered at position in screen coordinates
86  qreal pressure; // 0 to 1
87  Qt::TouchPointState state; //Qt::TouchPoint{Pressed|Moved|Stationary|Released}
88  };
89 
90  static void handleTouchEvent(QWidget *w, QEvent::Type type, QTouchEvent::DeviceType devType, const QList<struct TouchPoint> &points);
91  static void handleTouchEvent(QWidget *w, ulong timestamp, QEvent::Type type, QTouchEvent::DeviceType devType, const QList<struct TouchPoint> &points);
92 
93  static void handleGeometryChange(QWidget *w, const QRect &newRect);
94  static void handleCloseEvent(QWidget *w);
95  static void handleEnterEvent(QWidget *w);
96  static void handleLeaveEvent(QWidget *w);
97  static void handleWindowActivated(QWidget *w);
98  static void handleWindowStateChanged(QWidget *w, Qt::WindowState newState);
99 
100  // Changes to the screen
101  static void handleScreenGeometryChange(int screenIndex);
102  static void handleScreenAvailableGeometryChange(int screenIndex);
103  static void handleScreenCountChange(int count);
104 
105  static void handleLocaleChange();
106 
107  static void handlePlatformPanelEvent(QWidget *w);
108 };
109 
112 #endif // QWINDOWSYSTEMINTERFACE_H
double d
Definition: qnumeric_p.h:62
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
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
#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 long ulong
Definition: qglobal.h:997
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
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
TouchPointState
This enum represents the state of a touch point at the time the QTouchEvent occurred.
Definition: qnamespace.h:1738
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define class
Orientation
Definition: qnamespace.h:174
#define QT_END_HEADER
Definition: qglobal.h:137
WindowState
Definition: qnamespace.h:366
#define text
Definition: qobjectdefs.h:80
The QList class is a template class that provides lists.
Definition: qdatastream.h:62