aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmldebug/qmldebugclient.h
blob: 6608698c6aa31aca87caaf8e93f406d558b5d1e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "qmldebug_global.h"
#include <qtcpsocket.h>

#include <QDataStream>

namespace QmlDebug {

class QmlDebugConnection;
class QmlDebugClientPrivate;
class QMLDEBUG_EXPORT QmlDebugClient : public QObject
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(QmlDebugClient)
    Q_DISABLE_COPY(QmlDebugClient)

public:
    enum State { NotConnected, Unavailable, Enabled };

    QmlDebugClient(const QString &, QmlDebugConnection *parent);
    ~QmlDebugClient() override;

    QString name() const;
    float serviceVersion() const;
    State state() const;
    QmlDebugConnection *connection() const;
    int dataStreamVersion() const;

    virtual void sendMessage(const QByteArray &);
    virtual void stateChanged(State);
    virtual void messageReceived(const QByteArray &);

private:
    QScopedPointer<QmlDebugClientPrivate> d_ptr;
};

} // namespace QmlDebug