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 QQnxInputContext;
55 class QQnxNativeInterface;
56 class QQnxNavigatorEventHandler;
57 class QQnxNavigatorEventNotifier;
58 class QQnxAbstractVirtualKeyboard;
62 class QQnxScreenEventHandler;
64 #ifndef QT_NO_CLIPBOARD
68 template<class K, class V> class QHash;
69 typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
71 class QQnxIntegration : public QPlatformIntegration
77 bool hasCapability(QPlatformIntegration::Capability cap) const;
79 QPlatformWindow *createPlatformWindow(QWindow *window) const;
80 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
81 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
83 QPlatformInputContext *inputContext() const;
85 void moveToScreen(QWindow *window, int screen);
87 QAbstractEventDispatcher *guiThreadEventDispatcher() const;
89 QPlatformFontDatabase *fontDatabase() const { return m_fontDatabase; }
91 QPlatformNativeInterface *nativeInterface() const;
93 #ifndef QT_NO_CLIPBOARD
94 QPlatformClipboard *clipboard() const;
97 QVariant styleHint(StyleHint hint) const;
99 bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
101 QPlatformServices *services() const;
103 static QWindow *window(screen_window_t qnxWindow);
106 void createDisplays();
107 void destroyDisplays();
108 QQnxScreen *primaryDisplay() const;
110 static void addWindow(screen_window_t qnxWindow, QWindow *window);
111 static void removeWindow(screen_window_t qnxWindow);
113 screen_context_t m_screenContext;
114 QQnxEventThread *m_eventThread;
115 QQnxNavigatorEventHandler *m_navigatorEventHandler;
116 QQnxNavigatorEventNotifier *m_navigatorEventNotifier;
117 QQnxAbstractVirtualKeyboard *m_virtualKeyboard;
118 QQnxInputContext *m_inputContext;
119 QPlatformFontDatabase *m_fontDatabase;
120 bool m_paintUsingOpenGL;
121 QAbstractEventDispatcher *m_eventDispatcher;
122 QQnxNativeInterface *m_nativeInterface;
123 QQnxServices *m_services;
124 QList<QQnxScreen*> m_screens;
125 QQnxScreenEventHandler *m_screenEventHandler;
126 #ifndef QT_NO_CLIPBOARD
127 mutable QQnxClipboard* m_clipboard;
130 static QQnxWindowMapper ms_windowMapper;
131 static QMutex ms_windowMapperMutex;
133 friend class QQnxWindow;
138 #endif // QQNXINTEGRATION_H