Extends platform services for QNX devices.
Change-Id: I1eb685cdb38591cd73eaaf40ffb5691db0142953
Reviewed-by: Jeff Kehres <jkehres@rim.com>
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
qqnxclipboard.cpp \
qqnxrootwindow.cpp
+
HEADERS = qqnxbuffer.h \
qqnxeventthread.h \
qqnxkeytranslator.h \
qqnxclipboard.h \
qqnxrootwindow.h
+CONFIG(blackberry) {
+ SOURCES += qqnxservices.cpp
+ HEADERS += qqnxservices.h
+}
+
CONFIG(qqnx_imf) {
DEFINES += QQNX_IMF
HEADERS += qqnxinputcontext_imf.h
LIBS += -lpps -lscreen -lEGL -lclipboard
+CONFIG(blackberry) {
+ LIBS += -lbps
+}
+
include (../../../platformsupport/eglconvenience/eglconvenience.pri)
include (../../../platformsupport/fontdatabases/fontdatabases.pri)
#include "qqnxvirtualkeyboard.h"
#include "qqnxclipboard.h"
#include "qqnxglcontext.h"
+#include "qqnxservices.h"
#if defined(QQnx_IMF)
#include "qqnxinputcontext_imf.h"
, m_fontDatabase(new QGenericUnixFontDatabase())
, m_paintUsingOpenGL(false)
, m_eventDispatcher(createUnixEventDispatcher())
+ , m_services(0)
#ifndef QT_NO_CLIPBOARD
, m_clipboard(0)
#endif
// Set up the input context
m_inputContext = new QQnxInputContext;
+
+ // Create services handling class
+#ifdef Q_OS_BLACKBERRY
+ m_services = new QQnxServices;
+#endif
}
QQnxIntegration::~QQnxIntegration()
// Cleanup global OpenGL resources
QQnxGLContext::shutdown();
+ // Destroy services class
+#ifdef Q_OS_BLACKBERRY
+ delete m_services;
+#endif
+
#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << "QQnx: platform plugin shutdown end";
#endif
return QPlatformIntegration::styleHint(hint);
}
+QPlatformServices * QQnxIntegration::services() const
+{
+ return m_services;
+}
+
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
#if defined(QQNXINTEGRATION_DEBUG)
class QQnxInputContext;
class QQnxNavigatorEventHandler;
class QQnxWindow;
+class QQnxServices;
#ifndef QT_NO_CLIPBOARD
class QQnxClipboard;
bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
+ virtual QPlatformServices *services() const;
+
static QWindow *window(screen_window_t qnxWindow);
private:
QPlatformFontDatabase *m_fontDatabase;
bool m_paintUsingOpenGL;
QAbstractEventDispatcher *m_eventDispatcher;
+ QQnxServices *m_services;
#ifndef QT_NO_CLIPBOARD
mutable QQnxClipboard* m_clipboard;
#endif
--- /dev/null
+/***************************************************************************
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the plugins 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqnxservices.h"
+
+#include <bps/navigator.h>
+#include <stdbool.h>
+#include <sys/platform.h>
+#include <QUrl>
+
+QT_BEGIN_NAMESPACE
+
+QQnxServices::QQnxServices()
+{
+ bps_initialize();
+}
+
+QQnxServices::~QQnxServices()
+{
+ bps_shutdown();
+}
+
+bool QQnxServices::openUrl(const QUrl &url)
+{
+ return navigatorInvoke(url);
+}
+
+bool QQnxServices::openDocument(const QUrl &url)
+{
+ return navigatorInvoke(url);
+}
+
+bool QQnxServices::navigatorInvoke(const QUrl &url)
+{
+ if (!url.isValid() || url.isRelative())
+ return false;
+
+ int ret = navigator_invoke(url.toString().toUtf8(), 0);
+
+ return (ret == BPS_SUCCESS);
+}
+
+QT_END_NAMESPACE
--- /dev/null
+/***************************************************************************
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the plugins 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQNXSERVICES_H
+#define QQNXSERVICES_H
+
+#include <QtGui/QPlatformServices>
+
+QT_BEGIN_NAMESPACE
+
+class QQnxServices : public QPlatformServices
+{
+public:
+ QQnxServices();
+ ~QQnxServices();
+
+ bool openUrl(const QUrl &url);
+ bool openDocument(const QUrl &url);
+
+private:
+ bool navigatorInvoke(const QUrl &url);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQNXSERVICES_H