1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOFFSCREENINTEGRATION_H
5#define QOFFSCREENINTEGRATION_H
6
7#include <qpa/qplatformintegration.h>
8#include <qpa/qplatformnativeinterface.h>
9
10#include <qscopedpointer.h>
11#include <qjsonobject.h>
12
13QT_BEGIN_NAMESPACE
14
15class QOffscreenBackendData;
16class QOffscreenScreen;
17
18class QOffscreenIntegration : public QPlatformIntegration
19{
20public:
21 QOffscreenIntegration(const QStringList& paramList);
22 ~QOffscreenIntegration();
23
24 QJsonObject defaultConfiguration() const;
25 std::optional<QJsonObject> resolveConfigFileConfiguration(const QStringList& paramList) const;
26 void setConfiguration(const QJsonObject &configuration);
27 QJsonObject configuration() const;
28
29 void initialize() override;
30 bool hasCapability(QPlatformIntegration::Capability cap) const override;
31
32 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
33 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
34#if QT_CONFIG(draganddrop)
35 QPlatformDrag *drag() const override;
36#endif
37
38 QPlatformInputContext *inputContext() const override;
39 QPlatformServices *services() const override;
40
41 QPlatformFontDatabase *fontDatabase() const override;
42 QAbstractEventDispatcher *createEventDispatcher() const override;
43
44 QPlatformNativeInterface *nativeInterface() const override;
45
46 QStringList themeNames() const override;
47 QPlatformTheme *createPlatformTheme(const QString &name) const override;
48
49 static QOffscreenIntegration *createOffscreenIntegration(const QStringList& paramList);
50
51 QList<QOffscreenScreen *> screens() const;
52protected:
53 QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
54#if QT_CONFIG(draganddrop)
55 QScopedPointer<QPlatformDrag> m_drag;
56#endif
57 QScopedPointer<QPlatformInputContext> m_inputContext;
58 QScopedPointer<QPlatformServices> m_services;
59 mutable QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
60 QList<QOffscreenScreen *> m_screens;
61 bool m_windowFrameMarginsEnabled = true;
62 QJsonObject m_configuration;
63};
64
65QT_END_NAMESPACE
66
67#endif
68

source code of qtbase/src/plugins/platforms/offscreen/qoffscreenintegration.h