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 QQmlEngineDebugService :
public QQmlDebugService
127 ~QQmlEngineDebugService() override;
129 static const QString s_key;
131 virtual void objectCreated(QJSEngine *engine, QObject *object) = 0;
132 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)());
133 static QQmlDebugStatesDelegate *createStatesDelegate();
136 friend class QQmlDebugConnector;
138 explicit QQmlEngineDebugService(
float version, QObject *parent =
nullptr) :
139 QQmlDebugService(s_key, version, parent) {}
141 QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) {
return prev->m_nextSignal; }
144#if QT_CONFIG(translation)
145struct TranslationBindingInformation
147 static const TranslationBindingInformation
148 create(
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
149 const QV4::CompiledData::Binding *binding, QObject *scopeObject,
150 QQmlRefPointer<QQmlContextData> ctxt);
152 QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
153 QObject *scopeObject;
154 QQmlRefPointer<QQmlContextData> ctxt;
156 QString propertyName;
157 QQmlTranslation translation;
163class Q_QML_EXPORT QQmlDebugTranslationService :
public QQmlDebugService
167 ~QQmlDebugTranslationService() override;
169 static const QString s_key;
171 virtual void foundTranslationBinding(
const TranslationBindingInformation &translationBindingInformation) = 0;
173 friend class QQmlDebugConnector;
175 explicit QQmlDebugTranslationService(
float version, QObject *parent =
nullptr) :
176 QQmlDebugService(s_key, version, parent) {}
181class Q_QML_EXPORT QQmlInspectorService :
public QQmlDebugService
185 ~QQmlInspectorService() override;
187 static const QString s_key;
189 virtual void addWindow(QQuickWindow *) = 0;
190 virtual void setParentWindow(QQuickWindow *, QWindow *) = 0;
191 virtual void removeWindow(QQuickWindow *) = 0;
194 friend class QQmlDebugConnector;
196 explicit QQmlInspectorService(
float version, QObject *parent =
nullptr) :
197 QQmlDebugService(s_key, version, parent) {}
200class Q_QML_EXPORT QDebugMessageService :
public QQmlDebugService
204 ~QDebugMessageService() override;
206 static const QString s_key;
208 virtual void synchronizeTime(
const QElapsedTimer &otherTimer) = 0;
211 friend class QQmlDebugConnector;
213 explicit QDebugMessageService(
float version, QObject *parent =
nullptr) :
214 QQmlDebugService(s_key, version, parent) {}
217class Q_QML_EXPORT QQmlEngineControlService :
public QQmlDebugService
221 ~QQmlEngineControlService() override;
223 static const QString s_key;
226 friend class QQmlDebugConnector;
228 QQmlEngineControlService(
float version, QObject *parent =
nullptr) :
229 QQmlDebugService(s_key, version, parent) {}
233class Q_QML_EXPORT QQmlNativeDebugService :
public QQmlDebugService
237 ~QQmlNativeDebugService() override;
239 static const QString s_key;
242 friend class QQmlDebugConnector;
244 explicit QQmlNativeDebugService(
float version, QObject *parent =
nullptr)
245 : 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)