summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/blackberry/qbbscreeneventhandler.h
diff options
context:
space:
mode:
authorKevin Krammer <kevin.krammer.qnx@kdab.com>2012-03-29 11:23:42 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-03-30 12:40:19 (GMT)
commitdb50af5e307b9fc0c29567ac39012c7716bc45a6 (patch)
treec0fb8add28fb3d3b3883eeffd575805445536e8f /src/plugins/platforms/blackberry/qbbscreeneventhandler.h
parentacbdd48f4401f2cc9b48eb3bd79d957b1c4e2949 (diff)
downloadQt-db50af5e307b9fc0c29567ac39012c7716bc45a6.zip
Qt-db50af5e307b9fc0c29567ac39012c7716bc45a6.tar.gz
Qt-db50af5e307b9fc0c29567ac39012c7716bc45a6.tar.bz2
Move screen event processing into its own class
The event handler class can then be reused when we have proper BPS event support available from corelib Backport of a80a2c6da241dac77f533bc702a1c7d94349a812 Change-Id: I9f8f661ca6b976aa02990bc8c8af8e5472e5faa4 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/platforms/blackberry/qbbscreeneventhandler.h')
-rw-r--r--src/plugins/platforms/blackberry/qbbscreeneventhandler.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbscreeneventhandler.h b/src/plugins/platforms/blackberry/qbbscreeneventhandler.h
new file mode 100644
index 0000000..2e5851e
--- /dev/null
+++ b/src/plugins/platforms/blackberry/qbbscreeneventhandler.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion <blackberry-qt@qnx.com>
+** Contact: Klarälvdalens Datakonsult AB <info@kdab.com>
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBBSCREENEVENTHANDLER_H
+#define QBBSCREENEVENTHANDLER_H
+
+#include <QWindowSystemInterface>
+
+#include <screen/screen.h>
+
+QT_BEGIN_NAMESPACE
+
+class QBBScreenEventHandler
+{
+public:
+ QBBScreenEventHandler();
+
+ static void injectKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
+ void injectPointerMoveEvent(int x, int y);
+
+ bool handleEvent(screen_event_t event);
+ bool handleEvent(screen_event_t event, int qnxType);
+
+private:
+ void handleKeyboardEvent(screen_event_t event);
+ void handlePointerEvent(screen_event_t event);
+ void handleTouchEvent(screen_event_t event, int type);
+ void handleCloseEvent(screen_event_t event);
+
+private:
+ enum {
+ MAX_TOUCH_POINTS = 10
+ };
+
+ QPoint mLastGlobalMousePoint;
+ QPoint mLastLocalMousePoint;
+ Qt::MouseButtons mLastButtonState;
+ void* mLastMouseWindow;
+
+ QWindowSystemInterface::TouchPoint mTouchPoints[MAX_TOUCH_POINTS];
+};
+
+QT_END_NAMESPACE
+
+#endif // QBBSCREENEVENTHANDLER_H