2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2012-02-24 10:47:17 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-02-24 10:47:17 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-02-24 10:47:17 +01: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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-02-24 10:47:17 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-02-24 10:47:17 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
#include "qmlprofilerstatemanager.h"
|
2016-05-04 18:54:59 +02:00
|
|
|
#include "qmleventlocation.h"
|
2016-04-19 16:43:30 +02:00
|
|
|
#include <utils/port.h>
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2013-07-30 18:35:51 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QStringList>
|
2015-11-16 17:29:17 +01:00
|
|
|
#include <QAbstractSocket>
|
2013-07-30 18:35:51 +02:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
namespace QmlProfiler {
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerModelManager;
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class QmlProfilerClientManager : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit QmlProfilerClientManager(QObject *parent = 0);
|
|
|
|
|
~QmlProfilerClientManager();
|
|
|
|
|
|
2016-06-10 11:15:53 +02:00
|
|
|
void setProfilerStateManager(QmlProfilerStateManager *profilerState);
|
2016-04-19 16:43:30 +02:00
|
|
|
void setTcpConnection(QString host, Utils::Port port);
|
2015-11-17 16:42:21 +01:00
|
|
|
void setLocalSocket(QString file);
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
void clearBufferedData();
|
2012-05-11 17:19:15 +02:00
|
|
|
bool isConnected() const;
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
void setModelManager(QmlProfilerModelManager *m);
|
2015-08-28 12:50:46 +02:00
|
|
|
void setFlushInterval(quint32 flushInterval);
|
|
|
|
|
|
2015-11-18 12:34:52 +01:00
|
|
|
bool aggregateTraces() const;
|
|
|
|
|
void setAggregateTraces(bool aggregateTraces);
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
signals:
|
|
|
|
|
void connectionFailed();
|
2012-05-08 15:14:11 +02:00
|
|
|
void connectionClosed();
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2016-04-19 16:43:30 +02:00
|
|
|
void connectTcpClient(Utils::Port port);
|
2015-11-17 16:42:21 +01:00
|
|
|
void connectLocalClient(const QString &file);
|
2012-02-24 10:47:17 +01:00
|
|
|
void disconnectClient();
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void tryToConnect();
|
2014-05-05 17:18:11 +02:00
|
|
|
void qmlDebugConnectionOpened();
|
|
|
|
|
void qmlDebugConnectionClosed();
|
2015-11-16 17:29:17 +01:00
|
|
|
void qmlDebugConnectionError(QAbstractSocket::SocketError error);
|
|
|
|
|
void qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state);
|
2014-05-05 17:18:11 +02:00
|
|
|
void logState(const QString &);
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
void retryMessageBoxFinished(int result);
|
|
|
|
|
|
2014-04-03 12:33:14 +02:00
|
|
|
void qmlComplete(qint64 maximumTime);
|
2015-11-18 15:18:58 +01:00
|
|
|
void qmlNewEngine(int engineId);
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
void profilerStateChanged();
|
|
|
|
|
void clientRecordingChanged();
|
|
|
|
|
|
|
|
|
|
private:
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerClientManagerPrivate;
|
|
|
|
|
QmlProfilerClientManagerPrivate *d;
|
|
|
|
|
|
2015-11-17 16:42:21 +01:00
|
|
|
void createConnection();
|
2012-02-24 10:47:17 +01:00
|
|
|
void connectClientSignals();
|
|
|
|
|
void disconnectClientSignals();
|
|
|
|
|
|
|
|
|
|
void stopClientsRecording();
|
|
|
|
|
};
|
|
|
|
|
|
2016-04-28 16:02:54 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|