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 QQMLNATIVEDEBUGCONNECTOR_H |
5 | #define QQMLNATIVEDEBUGCONNECTOR_H |
6 | |
7 | #include <private/qqmldebugconnector_p.h> |
8 | #include <QtCore/qvector.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class QQmlNativeDebugConnector : public QQmlDebugConnector |
13 | { |
14 | Q_OBJECT |
15 | |
16 | public: |
17 | QQmlNativeDebugConnector(); |
18 | ~QQmlNativeDebugConnector() override; |
19 | |
20 | bool blockingMode() const override; |
21 | QQmlDebugService *service(const QString &name) const override; |
22 | void addEngine(QJSEngine *engine) override; |
23 | void removeEngine(QJSEngine *engine) override; |
24 | bool hasEngine(QJSEngine *engine) const override; |
25 | bool addService(const QString &name, QQmlDebugService *service) override; |
26 | bool removeService(const QString &name) override; |
27 | bool open(const QVariantHash &configuration) override; |
28 | static void setDataStreamVersion(int version); |
29 | |
30 | private: |
31 | void sendMessage(const QString &name, const QByteArray &message); |
32 | void sendMessages(const QString &name, const QList<QByteArray> &messages); |
33 | void announceObjectAvailability(const QString &objectType, QObject *object, bool available); |
34 | |
35 | QVector<QQmlDebugService *> m_services; |
36 | QVector<QJSEngine *> m_engines; |
37 | bool m_blockingMode; |
38 | }; |
39 | |
40 | class QQmlNativeDebugConnectorFactory : public QQmlDebugConnectorFactory |
41 | { |
42 | Q_OBJECT |
43 | Q_PLUGIN_METADATA(IID QQmlDebugConnectorFactory_iid FILE "qqmlnativedebugconnector.json") |
44 | public: |
45 | QQmlDebugConnector *create(const QString &key) override; |
46 | }; |
47 | |
48 | QT_END_NAMESPACE |
49 | |
50 | #endif // QQMLNATIVEDEBUGCONNECTOR_H |
51 | |
52 |