| 1 | // Copyright (C) 2018 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 QQMLDEBUGCLIENT_P_H |
| 5 | #define QQMLDEBUGCLIENT_P_H |
| 6 | |
| 7 | #include <QtCore/qobject.h> |
| 8 | #include <QtCore/private/qglobal_p.h> |
| 9 | |
| 10 | // |
| 11 | // W A R N I N G |
| 12 | // ------------- |
| 13 | // |
| 14 | // This file is not part of the Qt API. It exists purely as an |
| 15 | // implementation detail. This header file may change from version to |
| 16 | // version without notice, or even be removed. |
| 17 | // |
| 18 | // We mean it. |
| 19 | // |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class QQmlDebugConnection; |
| 24 | class QQmlDebugClientPrivate; |
| 25 | class QQmlDebugClient : public QObject |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | Q_DISABLE_COPY(QQmlDebugClient) |
| 29 | Q_DECLARE_PRIVATE(QQmlDebugClient) |
| 30 | |
| 31 | public: |
| 32 | enum State { NotConnected, Unavailable, Enabled }; |
| 33 | |
| 34 | QQmlDebugClient(const QString &name, QQmlDebugConnection *parent); |
| 35 | ~QQmlDebugClient(); |
| 36 | |
| 37 | QString name() const; |
| 38 | float serviceVersion() const; |
| 39 | State state() const; |
| 40 | void sendMessage(const QByteArray &message); |
| 41 | |
| 42 | QQmlDebugConnection *connection() const; |
| 43 | |
| 44 | Q_SIGNALS: |
| 45 | void stateChanged(State state); |
| 46 | |
| 47 | protected: |
| 48 | QQmlDebugClient(QQmlDebugClientPrivate &dd); |
| 49 | |
| 50 | private: |
| 51 | friend class QQmlDebugConnection; |
| 52 | virtual void messageReceived(const QByteArray &message); |
| 53 | }; |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif // QQMLDEBUGCLIENT_P_H |
| 58 | |