2011-03-25 09:25:17 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-07-06 15:48:52 +00:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2011-03-25 09:25:17 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2011-03-25 09:25:17 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
#ifndef QMLPROFILERTOOL_H
|
|
|
|
|
#define QMLPROFILERTOOL_H
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
#include <analyzerbase/ianalyzertool.h>
|
|
|
|
|
#include <analyzerbase/ianalyzerengine.h>
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QPoint>
|
2011-07-26 13:56:14 +02:00
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
namespace QmlProfiler {
|
2011-03-11 12:22:57 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-10-04 17:04:33 +02:00
|
|
|
#define TraceFileExtension ".qtd"
|
2011-08-22 16:01:50 +02:00
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
class QmlProfilerTool : public Analyzer::IAnalyzerTool
|
2011-03-11 12:22:57 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
public:
|
2011-06-30 18:55:48 +02:00
|
|
|
explicit QmlProfilerTool(QObject *parent);
|
2011-03-11 12:22:57 +01:00
|
|
|
~QmlProfilerTool();
|
|
|
|
|
|
2011-11-11 12:16:20 +01:00
|
|
|
Core::Id id() const;
|
2012-01-10 19:17:24 +01:00
|
|
|
ProjectExplorer::RunMode runMode() const;
|
2011-03-11 12:22:57 +01:00
|
|
|
QString displayName() const;
|
2011-06-28 19:14:08 +02:00
|
|
|
QString description() const;
|
2011-07-01 14:19:12 +02:00
|
|
|
ToolMode toolMode() const;
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-06-30 13:44:22 +02:00
|
|
|
void extensionsInitialized() {}
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-04 14:39:28 +02:00
|
|
|
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
2011-06-28 19:14:08 +02:00
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-12-27 22:41:31 +01:00
|
|
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
2012-01-10 19:17:24 +01:00
|
|
|
ProjectExplorer::RunMode mode) const;
|
2011-12-27 22:41:31 +01:00
|
|
|
|
|
|
|
|
Analyzer::AnalyzerStartParameters createStartParameters(
|
|
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration,
|
2012-01-10 19:17:24 +01:00
|
|
|
ProjectExplorer::RunMode mode) const;
|
2011-12-27 22:41:31 +01:00
|
|
|
|
2011-07-06 16:52:14 +02:00
|
|
|
QWidget *createWidgets();
|
2011-07-04 18:33:47 +02:00
|
|
|
void startTool(Analyzer::StartMode mode);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2012-02-28 11:15:51 +01:00
|
|
|
void connectClient(quint16 port);
|
2011-03-11 12:22:57 +01:00
|
|
|
void disconnectClient();
|
|
|
|
|
|
2011-04-06 12:26:19 +02:00
|
|
|
void startRecording();
|
2011-03-11 12:22:57 +01:00
|
|
|
void stopRecording();
|
2012-02-13 15:26:57 +01:00
|
|
|
void recordingButtonChanged(bool recording);
|
2011-04-06 12:26:19 +02:00
|
|
|
void setRecording(bool recording);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-08-25 16:30:36 +02:00
|
|
|
void setAppIsRunning();
|
|
|
|
|
void setAppIsStopped();
|
|
|
|
|
|
2012-01-12 16:36:40 +01:00
|
|
|
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber);
|
2011-11-28 16:30:30 +01:00
|
|
|
void updateTimers();
|
|
|
|
|
void profilerStateChanged(bool qmlActive, bool v8active);
|
2011-03-24 12:42:15 +01:00
|
|
|
|
2011-06-24 18:19:08 +02:00
|
|
|
void clearDisplay();
|
|
|
|
|
|
2011-07-26 13:56:14 +02:00
|
|
|
void showContextMenu(const QPoint &position);
|
|
|
|
|
|
2011-03-24 12:42:15 +01:00
|
|
|
signals:
|
|
|
|
|
void setTimeLabel(const QString &);
|
2011-11-28 16:30:30 +01:00
|
|
|
void setStatusLabel(const QString &);
|
2011-04-06 12:26:19 +02:00
|
|
|
void fetchingData(bool);
|
2011-04-14 15:23:17 +02:00
|
|
|
void connectionFailed();
|
2011-08-25 16:30:36 +02:00
|
|
|
void cancelRun();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-01 13:48:10 +02:00
|
|
|
private slots:
|
2011-04-12 17:24:56 +02:00
|
|
|
void tryToConnect();
|
2011-04-14 17:19:28 +02:00
|
|
|
void connectionStateChanged();
|
2011-11-16 17:06:00 +01:00
|
|
|
void showSaveOption();
|
2011-07-26 13:56:14 +02:00
|
|
|
void showSaveDialog();
|
|
|
|
|
void showLoadDialog();
|
2011-08-18 16:10:33 +02:00
|
|
|
void showErrorDialog(const QString &error);
|
2011-09-14 13:26:19 +02:00
|
|
|
void retryMessageBoxFinished(int result);
|
2012-02-13 15:26:57 +01:00
|
|
|
void eventListStateChanged();
|
2011-04-01 13:48:10 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
private:
|
2011-04-12 17:24:56 +02:00
|
|
|
void connectToClient();
|
2011-04-15 14:51:49 +02:00
|
|
|
void updateRecordingState();
|
2011-07-06 14:13:04 +02:00
|
|
|
void ensureWidgets();
|
2011-07-27 11:49:39 +02:00
|
|
|
void logStatus(const QString &msg);
|
|
|
|
|
void logError(const QString &msg);
|
2011-04-12 17:24:56 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
class QmlProfilerToolPrivate;
|
|
|
|
|
QmlProfilerToolPrivate *d;
|
|
|
|
|
};
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|
2011-03-11 12:22:57 +01:00
|
|
|
|
|
|
|
|
#endif // QMLPROFILERTOOL_H
|