1 /***************************************************************************
3 ** Copyright (C) 2011 - 2012 Research In Motion
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the plugins of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QQNXINTEGRATION_H
43 #define QQNXINTEGRATION_H
45 #include <QtGui/qplatformintegration_qpa.h>
47 #include <QtCore/qmutex.h>
49 #include <screen/screen.h>
53 class QQnxEventThread;
54 class QQnxNativeInterface;
57 class QQnxScreenEventHandler;
59 #ifdef Q_OS_BLACKBERRY
60 class QQnxInputContext;
61 class QQnxNavigatorEventHandler;
62 class QQnxNavigatorEventNotifier;
63 class QQnxAbstractVirtualKeyboard;
67 #ifndef QT_NO_CLIPBOARD
71 template<class K, class V> class QHash;
72 typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
74 class QQnxIntegration : public QPlatformIntegration
80 bool hasCapability(QPlatformIntegration::Capability cap) const;
82 QPlatformWindow *createPlatformWindow(QWindow *window) const;
83 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
84 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
86 #ifdef Q_OS_BLACKBERRY
87 QPlatformInputContext *inputContext() const;
90 void moveToScreen(QWindow *window, int screen);
92 QAbstractEventDispatcher *guiThreadEventDispatcher() const;
94 QPlatformFontDatabase *fontDatabase() const { return m_fontDatabase; }
96 QPlatformNativeInterface *nativeInterface() const;
98 #ifndef QT_NO_CLIPBOARD
99 QPlatformClipboard *clipboard() const;
102 QVariant styleHint(StyleHint hint) const;
104 bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
106 #ifdef Q_OS_BLACKBERRY
107 QPlatformServices *services() const;
110 static QWindow *window(screen_window_t qnxWindow);
113 void createDisplays();
114 void destroyDisplays();
115 QQnxScreen *primaryDisplay() const;
117 static void addWindow(screen_window_t qnxWindow, QWindow *window);
118 static void removeWindow(screen_window_t qnxWindow);
120 screen_context_t m_screenContext;
121 QQnxEventThread *m_eventThread;
122 #ifdef Q_OS_BLACKBERRY
123 QQnxNavigatorEventHandler *m_navigatorEventHandler;
124 QQnxNavigatorEventNotifier *m_navigatorEventNotifier;
125 QQnxAbstractVirtualKeyboard *m_virtualKeyboard;
126 QQnxInputContext *m_inputContext;
127 QQnxServices *m_services;
129 QPlatformFontDatabase *m_fontDatabase;
130 bool m_paintUsingOpenGL;
131 QAbstractEventDispatcher *m_eventDispatcher;
132 QQnxNativeInterface *m_nativeInterface;
133 QList<QQnxScreen*> m_screens;
134 QQnxScreenEventHandler *m_screenEventHandler;
135 #ifndef QT_NO_CLIPBOARD
136 mutable QQnxClipboard* m_clipboard;
139 static QQnxWindowMapper ms_windowMapper;
140 static QMutex ms_windowMapperMutex;
142 friend class QQnxWindow;
147 #endif // QQNXINTEGRATION_H