1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtQml module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QMLPROFILERCLIENT_H
43 #define QMLPROFILERCLIENT_H
45 #include "qqmldebugclient.h"
46 #include <QtQml/private/qqmlprofilerservice_p.h>
47 #include "qmlprofilereventlocation.h"
49 class ProfilerClientPrivate;
50 class ProfilerClient : public QQmlDebugClient
54 Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged)
55 Q_PROPERTY(bool recording READ isRecording WRITE setRecording
56 NOTIFY recordingChanged)
59 ProfilerClient(const QString &clientName,
60 QQmlDebugConnection *client);
63 bool isEnabled() const;
64 bool isRecording() const;
67 void setRecording(bool);
68 virtual void clearData();
69 virtual void sendRecordingStatus();
73 void recordingChanged(bool arg);
74 void enabledChanged();
78 virtual void stateChanged(State);
85 class QmlProfilerClient : public ProfilerClient
90 QmlProfilerClient(QQmlDebugConnection *client);
95 void sendRecordingStatus();
98 void traceFinished( qint64 time );
99 void traceStarted( qint64 time );
100 void range(QQmlProfilerService::RangeType type,
101 QQmlProfilerService::BindingType bindingType,
102 qint64 startTime, qint64 length,
103 const QStringList &data,
104 const QmlEventLocation &location);
105 void frame(qint64 time, int frameRate, int animationCount);
108 virtual void messageReceived(const QByteArray &);
111 class QmlProfilerClientPrivate *d;
114 class V8ProfilerClient : public ProfilerClient
126 V8ProfilerClient(QQmlDebugConnection *client);
130 void sendRecordingStatus();
133 void range(int depth, const QString &function, const QString &filename,
134 int lineNumber, double totalTime, double selfTime);
137 virtual void messageReceived(const QByteArray &);
140 #endif // QMLPROFILERCLIENT_H