| 1 | // Copyright (C) 2016 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 QQMLPROFILERCLIENT_P_H |
| 5 | #define QQMLPROFILERCLIENT_P_H |
| 6 | |
| 7 | #include "qqmldebugclient_p.h" |
| 8 | #include "qqmlprofilereventlocation_p.h" |
| 9 | #include "qqmlprofilereventreceiver_p.h" |
| 10 | #include "qqmlprofilerclientdefinitions_p.h" |
| 11 | |
| 12 | #include <private/qpacket_p.h> |
| 13 | |
| 14 | // |
| 15 | // W A R N I N G |
| 16 | // ------------- |
| 17 | // |
| 18 | // This file is not part of the Qt API. It exists purely as an |
| 19 | // implementation detail. This header file may change from version to |
| 20 | // version without notice, or even be removed. |
| 21 | // |
| 22 | // We mean it. |
| 23 | // |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class QQmlProfilerClientPrivate; |
| 28 | class QQmlProfilerClient : public QQmlDebugClient |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | Q_DECLARE_PRIVATE(QQmlProfilerClient) |
| 32 | Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged) |
| 33 | |
| 34 | public: |
| 35 | QQmlProfilerClient(QQmlDebugConnection *connection, QQmlProfilerEventReceiver *eventReceiver, |
| 36 | quint64 features = std::numeric_limits<quint64>::max()); |
| 37 | ~QQmlProfilerClient(); |
| 38 | |
| 39 | bool isRecording() const; |
| 40 | void setRecording(bool); |
| 41 | quint64 recordedFeatures() const; |
| 42 | virtual void messageReceived(const QByteArray &) override; |
| 43 | |
| 44 | void clearEvents(); |
| 45 | void clearAll(); |
| 46 | |
| 47 | void sendRecordingStatus(int engineId = -1); |
| 48 | void setRequestedFeatures(quint64 features); |
| 49 | void setFlushInterval(quint32 flushInterval); |
| 50 | |
| 51 | protected: |
| 52 | QQmlProfilerClient(QQmlProfilerClientPrivate &dd); |
| 53 | void onStateChanged(State status); |
| 54 | |
| 55 | Q_SIGNALS: |
| 56 | void complete(qint64 maximumTime); |
| 57 | void traceFinished(qint64 timestamp, const QList<int> &engineIds); |
| 58 | void traceStarted(qint64 timestamp, const QList<int> &engineIds); |
| 59 | |
| 60 | void recordingChanged(bool arg); |
| 61 | void recordedFeaturesChanged(quint64 features); |
| 62 | |
| 63 | void cleared(); |
| 64 | }; |
| 65 | |
| 66 | QT_END_NAMESPACE |
| 67 | |
| 68 | #endif // QQMLPROFILERCLIENT_P_H |
| 69 | |