4#ifndef QQMLDEBUGSERVICEINTERFACES_P_H
5#define QQMLDEBUGSERVICEINTERFACES_P_H
18#include <QtCore/qstring.h>
19#include <private/qtqmlglobal_p.h>
20#if QT_CONFIG(qml_debug)
21#include <private/qqmldebugservice_p.h>
23#include <private/qqmldebugstatesdelegate_p.h>
24#include <private/qqmlboundsignal_p.h>
25#include <private/qqmltranslation_p.h>
35#if !QT_CONFIG(qml_debug)
37class TranslationBindingInformation;
42 void signalEmitted(
const QString &) {}
45class QQmlProfilerService
48 void startProfiling(QJSEngine *engine, quint64 features = std::numeric_limits<quint64>::max())
54 void stopProfiling(QJSEngine *) {}
57class QQmlEngineDebugService
60 void objectCreated(QJSEngine *, QObject *) {}
61 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*)()) {}
64class QQmlInspectorService {
66 void addWindow(QQuickWindow *) {}
67 void setParentWindow(QQuickWindow *, QWindow *) {}
68 void removeWindow(QQuickWindow *) {}
71class QDebugMessageService {};
72class QQmlEngineControlService {};
73class QQmlNativeDebugService {};
74class QQmlDebugTranslationService {
76 virtual void foundTranslationBinding(
const TranslationBindingInformation &) {}
81class Q_QML_EXPORT QV4DebugService :
public QQmlDebugService
85 ~QV4DebugService() override;
87 static const QString s_key;
89 virtual void signalEmitted(
const QString &signal) = 0;
92 friend class QQmlDebugConnector;
94 explicit QV4DebugService(
float version, QObject *parent =
nullptr) :
95 QQmlDebugService(s_key, version, parent) {}
98class QQmlAbstractProfilerAdapter;
99class Q_QML_EXPORT QQmlProfilerService :
public QQmlDebugService
103 ~QQmlProfilerService() override;
105 static const QString s_key;
107 virtual void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
108 virtual void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
110 virtual void startProfiling(QJSEngine *engine,
111 quint64 features = std::numeric_limits<quint64>::max()) = 0;
112 virtual void stopProfiling(QJSEngine *engine) = 0;
114 virtual void dataReady(QQmlAbstractProfilerAdapter *profiler) = 0;
117 friend class QQmlDebugConnector;
119 explicit QQmlProfilerService(
float version, QObject *parent =
nullptr) :
120 QQmlDebugService(s_key, version, parent) {}
123class Q_QML_EXPORT QQuickEventReplayService :
public QQmlDebugService
127 ~QQuickEventReplayService() override;
129 static const QString s_key;
132 friend class QQmlDebugConnector;
134 explicit QQuickEventReplayService(
float version, QObject *parent =
nullptr) :
135 QQmlDebugService(s_key, version, parent) {}
138class Q_QML_EXPORT QQmlEngineDebugService :
public QQmlDebugService{
141 ~QQmlEngineDebugService() override;
143 static const QString s_key;
145 virtual void objectCreated(QJSEngine *engine, QObject *object) = 0;
146 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)());
147 static QQmlDebugStatesDelegate *createStatesDelegate();
150 friend class QQmlDebugConnector;
152 explicit QQmlEngineDebugService(
float version, QObject *parent =
nullptr) :
153 QQmlDebugService(s_key, version, parent) {}
155 QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) {
return prev->m_nextSignal; }
158#if QT_CONFIG(translation)
159struct TranslationBindingInformation
161 static const TranslationBindingInformation
162 create(
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
163 const QV4::CompiledData::Binding *binding, QObject *scopeObject,
164 QQmlRefPointer<QQmlContextData> ctxt);
166 QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
167 QObject *scopeObject;
168 QQmlRefPointer<QQmlContextData> ctxt;
170 QString propertyName;
171 QQmlTranslation translation;
177class Q_QML_EXPORT QQmlDebugTranslationService :
public QQmlDebugService
181 ~QQmlDebugTranslationService() override;
183 static const QString s_key;
185 virtual void foundTranslationBinding(
const TranslationBindingInformation &translationBindingInformation) = 0;
187 friend class QQmlDebugConnector;
189 explicit QQmlDebugTranslationService(
float version, QObject *parent =
nullptr) :
190 QQmlDebugService(s_key, version, parent) {}
195class Q_QML_EXPORT QQmlInspectorService :
public QQmlDebugService
199 ~QQmlInspectorService() override;
201 static const QString s_key;
203 virtual void addWindow(QQuickWindow *) = 0;
204 virtual void setParentWindow(QQuickWindow *, QWindow *) = 0;
205 virtual void removeWindow(QQuickWindow *) = 0;
208 friend class QQmlDebugConnector;
210 explicit QQmlInspectorService(
float version, QObject *parent =
nullptr) :
211 QQmlDebugService(s_key, version, parent) {}
214class Q_QML_EXPORT QDebugMessageService :
public QQmlDebugService
218 ~QDebugMessageService() override;
220 static const QString s_key;
222 virtual void synchronizeTime(
const QElapsedTimer &otherTimer) = 0;
225 friend class QQmlDebugConnector;
227 explicit QDebugMessageService(
float version, QObject *parent =
nullptr) :
228 QQmlDebugService(s_key, version, parent) {}
231class Q_QML_EXPORT QQmlEngineControlService :
public QQmlDebugService
235 ~QQmlEngineControlService() override;
237 static const QString s_key;
240 friend class QQmlDebugConnector;
242 QQmlEngineControlService(
float version, QObject *parent =
nullptr) :
243 QQmlDebugService(s_key, version, parent) {}
247class Q_QML_EXPORT QQmlNativeDebugService :
public QQmlDebugService
251 ~QQmlNativeDebugService() override;
253 static const QString s_key;
256 friend class QQmlDebugConnector;
258 explicit QQmlNativeDebugService(
float version, QObject *parent =
nullptr)
259 : QQmlDebugService(s_key, version, parent) {}
#define Q_ATOMIC_FLAG_INIT
static Q_CONSTINIT std::atomic_flag s_printedWarning
QT_REQUIRE_CONFIG(qml_debug)
QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error)
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)