1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QQMLENGINEDEBUGCLIENT_H
5#define QQMLENGINEDEBUGCLIENT_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qqmldebugclient_p.h>
19#include <private/qpacket_p.h>
20
21#include <QtCore/qurl.h>
22#include <QtCore/qvariant.h>
23
24QT_BEGIN_NAMESPACE
25
26struct QQmlEngineDebugPropertyReference
27{
28 qint32 objectDebugId = -1;
29 QString name;
30 QVariant value;
31 QString valueTypeName;
32 QString binding;
33 bool hasNotifySignal = false;
34};
35
36struct QQmlEngineDebugFileReference
37{
38 QUrl url;
39 qint32 lineNumber = -1;
40 qint32 columnNumber = -1;
41};
42
43struct QQmlEngineDebugObjectReference
44{
45 qint32 debugId = -1;
46 QString className;
47 QString idString;
48 QString name;
49 QQmlEngineDebugFileReference source;
50 qint32 contextDebugId = -1;
51 QList<QQmlEngineDebugPropertyReference> properties;
52 QList<QQmlEngineDebugObjectReference> children;
53};
54
55struct QQmlEngineDebugContextReference
56{
57 qint32 debugId = -1;
58 QString name;
59 QList<QQmlEngineDebugObjectReference> objects;
60 QList<QQmlEngineDebugContextReference> contexts;
61};
62
63struct QQmlEngineDebugEngineReference
64{
65 qint32 debugId = -1;
66 QString name;
67};
68
69class QQmlEngineDebugClientPrivate;
70class QQmlEngineDebugClient : public QQmlDebugClient
71{
72 Q_OBJECT
73 Q_DECLARE_PRIVATE(QQmlEngineDebugClient)
74
75public:
76 explicit QQmlEngineDebugClient(QQmlDebugConnection *conn);
77
78 qint32 addWatch(const QQmlEngineDebugPropertyReference &,
79 bool *success);
80 qint32 addWatch(const QQmlEngineDebugContextReference &, const QString &,
81 bool *success);
82 qint32 addWatch(const QQmlEngineDebugObjectReference &, const QString &,
83 bool *success);
84 qint32 addWatch(const QQmlEngineDebugObjectReference &,
85 bool *success);
86 qint32 addWatch(const QQmlEngineDebugFileReference &,
87 bool *success);
88
89 void removeWatch(qint32 watch, bool *success);
90
91 qint32 queryAvailableEngines(bool *success);
92 qint32 queryRootContexts(const QQmlEngineDebugEngineReference &,
93 bool *success);
94 qint32 queryObject(const QQmlEngineDebugObjectReference &,
95 bool *success);
96 qint32 queryObjectsForLocation(const QString &file,
97 qint32 lineNumber, qint32 columnNumber, bool *success);
98 qint32 queryObjectRecursive(const QQmlEngineDebugObjectReference &,
99 bool *success);
100 qint32 queryObjectsForLocationRecursive(const QString &file,
101 qint32 lineNumber, qint32 columnNumber, bool *success);
102 qint32 queryExpressionResult(qint32 objectDebugId,
103 const QString &expr,
104 bool *success);
105 qint32 queryExpressionResultBC(qint32 objectDebugId,
106 const QString &expr,
107 bool *success);
108 qint32 setBindingForObject(qint32 objectDebugId, const QString &propertyName,
109 const QVariant &bindingExpression,
110 bool isLiteralValue,
111 const QString &source, qint32 line, bool *success);
112 qint32 resetBindingForObject(qint32 objectDebugId,
113 const QString &propertyName, bool *success);
114 qint32 setMethodBody(qint32 objectDebugId, const QString &methodName,
115 const QString &methodBody, bool *success);
116
117 qint32 getId();
118
119 void decode(QPacket &ds, QQmlEngineDebugContextReference &);
120 void decode(QPacket &ds, QQmlEngineDebugObjectReference &, bool simple);
121 void decode(QPacket &ds, QList<QQmlEngineDebugObjectReference> &o, bool simple);
122
123 QList<QQmlEngineDebugEngineReference> engines() const;
124 QQmlEngineDebugContextReference rootContext() const;
125 QQmlEngineDebugObjectReference object() const;
126 QList<QQmlEngineDebugObjectReference> objects() const;
127 QVariant resultExpr() const;
128 bool valid() const;
129
130Q_SIGNALS:
131 void newObject(qint32 objectId);
132 void valueChanged(QByteArray,QVariant);
133 void result();
134
135protected:
136 void messageReceived(const QByteArray &) override;
137};
138
139QT_END_NAMESPACE
140
141Q_DECLARE_METATYPE(QQmlEngineDebugObjectReference)
142
143#endif // QQMLENGINEDEBUGCLIENT_H
144

source code of qtdeclarative/src/qmldebug/qqmlenginedebugclient_p.h