QtGui/qwindowsysteminterface_qpa.h Source File

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 
58 class Q_GUI_EXPORT QWindowSystemInterface
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
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
Definition: qpoint.h:53
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
GLuint GLuint GLsizei count
Definition: GLee.h:872
WindowState
Definition: qnamespace.h:366
Orientation
Definition: qnamespace.h:174
GLubyte GLubyte b
Definition: GLee.h:5404
TouchPointState
Definition: qnamespace.h:1738
Definition: qrect.h:58
Definition: qrect.h:511
unsigned int quint32
Definition: qglobal.h:938
GLsizei const GLfloat * points
Definition: GLee.h:3793
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
GLdouble GLdouble t
Definition: GLee.h:1181
#define QT_END_HEADER
Definition: qglobal.h:142