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-03-14 19:18:38 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
2012-02-24 10:47:17 +01:00
|
|
|
class QMessageBox;
|
2012-03-14 19:18:38 +01:00
|
|
|
QT_END_NAMESPACE
|
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-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
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
QList <QAction *> profilerContextMenuActions() const;
|
|
|
|
|
|
|
|
|
|
// display dialogs / log output
|
|
|
|
|
static QMessageBox *requestMessageBox();
|
|
|
|
|
static void handleHelpRequest(const QString &link);
|
|
|
|
|
static void logStatus(const QString &msg);
|
|
|
|
|
static void logError(const QString &msg);
|
|
|
|
|
static void showNonmodalWarning(const QString &warningMsg);
|
|
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
public slots:
|
2012-02-24 10:47:17 +01:00
|
|
|
void profilerStateChanged();
|
|
|
|
|
void clientRecordingChanged();
|
|
|
|
|
void serverRecordingChanged();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
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
|
|
|
|
2012-01-12 16:36:40 +01:00
|
|
|
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-01 13:48:10 +02:00
|
|
|
private slots:
|
2012-02-24 10:47:17 +01:00
|
|
|
void clearData();
|
|
|
|
|
void showErrorDialog(const QString &error);
|
|
|
|
|
void profilerDataModelStateChanged();
|
|
|
|
|
void updateTimeDisplay();
|
|
|
|
|
|
2011-11-16 17:06:00 +01:00
|
|
|
void showSaveOption();
|
2011-07-26 13:56:14 +02:00
|
|
|
void showSaveDialog();
|
|
|
|
|
void showLoadDialog();
|
2011-04-01 13:48:10 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
private:
|
2012-02-24 10:47:17 +01:00
|
|
|
void clearDisplay();
|
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
|