summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qnx.pro10
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp17
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxservices.cpp81
-rw-r--r--src/plugins/platforms/qnx/qqnxservices.h64
5 files changed, 176 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index cf82084de0..588464fc47 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -37,6 +37,7 @@ SOURCES = main.cpp \
qqnxclipboard.cpp \
qqnxrootwindow.cpp
+
HEADERS = qqnxbuffer.h \
qqnxeventthread.h \
qqnxkeytranslator.h \
@@ -51,6 +52,11 @@ HEADERS = qqnxbuffer.h \
qqnxclipboard.h \
qqnxrootwindow.h
+CONFIG(blackberry) {
+ SOURCES += qqnxservices.cpp
+ HEADERS += qqnxservices.h
+}
+
CONFIG(qqnx_imf) {
DEFINES += QQNX_IMF
HEADERS += qqnxinputcontext_imf.h
@@ -64,6 +70,10 @@ QMAKE_CXXFLAGS += -I./private
LIBS += -lpps -lscreen -lEGL -lclipboard
+CONFIG(blackberry) {
+ LIBS += -lbps
+}
+
include (../../../platformsupport/eglconvenience/eglconvenience.pri)
include (../../../platformsupport/fontdatabases/fontdatabases.pri)
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index cb7f14f963..5ef34f3aea 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -50,6 +50,7 @@
#include "qqnxvirtualkeyboard.h"
#include "qqnxclipboard.h"
#include "qqnxglcontext.h"
+#include "qqnxservices.h"
#if defined(QQnx_IMF)
#include "qqnxinputcontext_imf.h"
@@ -82,6 +83,7 @@ QQnxIntegration::QQnxIntegration()
, m_fontDatabase(new QGenericUnixFontDatabase())
, m_paintUsingOpenGL(false)
, m_eventDispatcher(createUnixEventDispatcher())
+ , m_services(0)
#ifndef QT_NO_CLIPBOARD
, m_clipboard(0)
#endif
@@ -124,6 +126,11 @@ QQnxIntegration::QQnxIntegration()
// Set up the input context
m_inputContext = new QQnxInputContext;
+
+ // Create services handling class
+#ifdef Q_OS_BLACKBERRY
+ m_services = new QQnxServices;
+#endif
}
QQnxIntegration::~QQnxIntegration()
@@ -154,6 +161,11 @@ 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
@@ -266,6 +278,11 @@ QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
+QPlatformServices * QQnxIntegration::services() const
+{
+ return m_services;
+}
+
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
#if defined(QQNXINTEGRATION_DEBUG)
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 892bb6e16f..6aa16100ad 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -54,6 +54,7 @@ class QQnxEventThread;
class QQnxInputContext;
class QQnxNavigatorEventHandler;
class QQnxWindow;
+class QQnxServices;
#ifndef QT_NO_CLIPBOARD
class QQnxClipboard;
@@ -91,6 +92,8 @@ public:
bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
+ virtual QPlatformServices *services() const;
+
static QWindow *window(screen_window_t qnxWindow);
private:
@@ -104,6 +107,7 @@ private:
QPlatformFontDatabase *m_fontDatabase;
bool m_paintUsingOpenGL;
QAbstractEventDispatcher *m_eventDispatcher;
+ QQnxServices *m_services;
#ifndef QT_NO_CLIPBOARD
mutable QQnxClipboard* m_clipboard;
#endif
diff --git a/src/plugins/platforms/qnx/qqnxservices.cpp b/src/plugins/platforms/qnx/qqnxservices.cpp
new file mode 100644
index 0000000000..a1a27906ae
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxservices.cpp
@@ -0,0 +1,81 @@
+/***************************************************************************
+**
+** 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
diff --git a/src/plugins/platforms/qnx/qqnxservices.h b/src/plugins/platforms/qnx/qqnxservices.h
new file mode 100644
index 0000000000..36eb8edf65
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxservices.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+**
+** 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