801bd7b6e5760c18970035f21b2c3bc260d12c2f
[profile/ivi/qtbase.git] / src / plugins / platforms / qnx / qqnxintegration.h
1 /***************************************************************************
2 **
3 ** Copyright (C) 2011 - 2012 Research In Motion
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
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.
16 **
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.
20 **
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.
28 **
29 ** Other Usage
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.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QQNXINTEGRATION_H
43 #define QQNXINTEGRATION_H
44
45 #include <QtGui/qplatformintegration_qpa.h>
46
47 #include <QtCore/qmutex.h>
48
49 #include <screen/screen.h>
50
51 QT_BEGIN_NAMESPACE
52
53 class QQnxEventThread;
54 class QQnxInputContext;
55 class QQnxNativeInterface;
56 class QQnxNavigatorEventHandler;
57 class QQnxNavigatorEventNotifier;
58 class QQnxAbstractVirtualKeyboard;
59 class QQnxWindow;
60 class QQnxServices;
61 class QQnxScreen;
62 class QQnxScreenEventHandler;
63
64 #ifndef QT_NO_CLIPBOARD
65 class QQnxClipboard;
66 #endif
67
68 template<class K, class V> class QHash;
69 typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
70
71 class QQnxIntegration : public QPlatformIntegration
72 {
73 public:
74     QQnxIntegration();
75     ~QQnxIntegration();
76
77     bool hasCapability(QPlatformIntegration::Capability cap) const;
78
79     QPlatformWindow *createPlatformWindow(QWindow *window) const;
80     QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
81     QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
82
83     QPlatformInputContext *inputContext() const;
84
85     void moveToScreen(QWindow *window, int screen);
86
87     QAbstractEventDispatcher *guiThreadEventDispatcher() const;
88
89     QPlatformFontDatabase *fontDatabase() const { return m_fontDatabase; }
90
91     QPlatformNativeInterface *nativeInterface() const;
92
93 #ifndef QT_NO_CLIPBOARD
94     QPlatformClipboard *clipboard() const;
95 #endif
96
97     QVariant styleHint(StyleHint hint) const;
98
99     bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
100
101     QPlatformServices *services() const;
102
103     static QWindow *window(screen_window_t qnxWindow);
104
105 private:
106     void createDisplays();
107     void destroyDisplays();
108     QQnxScreen *primaryDisplay() const;
109
110     static void addWindow(screen_window_t qnxWindow, QWindow *window);
111     static void removeWindow(screen_window_t qnxWindow);
112
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;
128 #endif
129
130     static QQnxWindowMapper ms_windowMapper;
131     static QMutex ms_windowMapperMutex;
132
133     friend class QQnxWindow;
134 };
135
136 QT_END_NAMESPACE
137
138 #endif // QQNXINTEGRATION_H