2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2011-06-28 15:51:20 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
#ifndef QMLPROFILERTRACECLIENT_H
|
|
|
|
#define QMLPROFILERTRACECLIENT_H
|
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
#include "qmldebugclient.h"
|
2011-08-05 11:12:27 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
2012-01-12 16:36:40 +01:00
|
|
|
#include "qmlprofilereventlocation.h"
|
2012-04-18 12:06:10 +02:00
|
|
|
#include "qmldebug_global.h"
|
2011-08-05 11:12:27 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStack>
|
|
|
|
#include <QStringList>
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
namespace QmlDebug {
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
class QMLDEBUG_EXPORT QmlProfilerTraceClient : public QmlDebug::QmlDebugClient
|
2011-06-28 15:51:20 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2011-11-28 16:30:30 +01:00
|
|
|
Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged)
|
2011-06-28 15:51:20 +02:00
|
|
|
Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
|
|
|
|
|
2011-07-28 10:51:51 +02:00
|
|
|
// don't hide by signal
|
|
|
|
using QObject::event;
|
|
|
|
|
2011-06-28 15:51:20 +02:00
|
|
|
public:
|
2014-09-09 18:22:58 +02:00
|
|
|
QmlProfilerTraceClient(QmlDebugConnection *client, quint64 features);
|
2011-08-05 12:58:43 +02:00
|
|
|
~QmlProfilerTraceClient();
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2011-11-10 17:08:07 +01:00
|
|
|
bool isEnabled() const;
|
2011-08-05 12:58:43 +02:00
|
|
|
bool isRecording() const;
|
2012-02-24 10:47:17 +01:00
|
|
|
void setRecording(bool);
|
2015-06-30 15:55:33 +02:00
|
|
|
quint64 recordedFeatures() const;
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
public slots:
|
2011-08-05 12:58:43 +02:00
|
|
|
void clearData();
|
2015-10-30 12:35:17 +01:00
|
|
|
void sendRecordingStatus();
|
2015-06-30 15:55:33 +02:00
|
|
|
void setRequestedFeatures(quint64 features);
|
2015-08-28 12:50:46 +02:00
|
|
|
void setFlushInterval(quint32 flushInterval);
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
signals:
|
2014-04-03 12:33:14 +02:00
|
|
|
void complete(qint64 maximumTime);
|
2014-03-12 17:20:52 +01:00
|
|
|
void traceFinished(qint64 time, const QList<int> &engineIds);
|
|
|
|
void traceStarted(qint64 time, const QList<int> &engineIds);
|
2014-06-03 16:57:32 +02:00
|
|
|
void rangedEvent(QmlDebug::Message, QmlDebug::RangeType, int detailType, qint64 startTime,
|
2014-06-13 16:33:30 +02:00
|
|
|
qint64 length, const QString &data,
|
2014-06-03 16:57:32 +02:00
|
|
|
const QmlDebug::QmlEventLocation &location, qint64 param1, qint64 param2,
|
|
|
|
qint64 param3, qint64 param4, qint64 param5);
|
2015-11-18 13:13:46 +01:00
|
|
|
void debugMessage(QtMsgType type, qint64 timestamp, const QString &text,
|
|
|
|
const QmlDebug::QmlEventLocation &location);
|
2011-06-28 15:51:20 +02:00
|
|
|
void recordingChanged(bool arg);
|
2015-06-30 15:55:33 +02:00
|
|
|
void recordedFeaturesChanged(quint64 features);
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2011-11-28 16:30:30 +01:00
|
|
|
void enabledChanged();
|
2011-08-05 12:58:43 +02:00
|
|
|
void cleared();
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
protected:
|
2014-05-05 16:11:43 +02:00
|
|
|
virtual void stateChanged(State status);
|
2011-06-28 15:51:20 +02:00
|
|
|
virtual void messageReceived(const QByteArray &);
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
private:
|
|
|
|
void setRecordingFromServer(bool);
|
|
|
|
|
2011-06-28 15:51:20 +02:00
|
|
|
private:
|
2011-08-05 12:58:43 +02:00
|
|
|
class QmlProfilerTraceClientPrivate *d;
|
2011-06-28 15:51:20 +02:00
|
|
|
};
|
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
} // namespace QmlDebug
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
#endif // QMLPROFILERTRACECLIENT_H
|