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
|
|
|
|
2016-07-14 09:41:04 +02:00
|
|
|
#include "qmlprofilertraceclient.h"
|
|
|
|
|
|
|
|
|
|
#include <qmldebug/qmldebugclient.h>
|
2016-04-19 16:43:30 +02:00
|
|
|
#include <utils/port.h>
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2016-07-14 09:41:04 +02:00
|
|
|
#include <QPointer>
|
|
|
|
|
#include <QTimer>
|
2013-07-30 18:35:51 +02:00
|
|
|
#include <QObject>
|
2016-07-14 09:41:04 +02:00
|
|
|
#include <QVector>
|
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;
|
2016-07-14 09:41:04 +02:00
|
|
|
class QmlProfilerStateManager;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class QmlProfilerClientManager : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit QmlProfilerClientManager(QObject *parent = 0);
|
2016-07-25 14:09:20 +02:00
|
|
|
~QmlProfilerClientManager();
|
2012-02-24 10:47:17 +01:00
|
|
|
|
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);
|
2016-07-14 09:41:04 +02:00
|
|
|
void clearConnection();
|
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);
|
|
|
|
|
|
2016-07-14 09:41:04 +02:00
|
|
|
void setRetryParams(int interval, int maxAttempts);
|
|
|
|
|
void retryConnect();
|
|
|
|
|
void connectToTcpServer();
|
|
|
|
|
void startLocalServer();
|
|
|
|
|
|
2016-08-04 17:29:05 +02:00
|
|
|
void stopRecording();
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
signals:
|
2016-07-14 09:41:04 +02:00
|
|
|
void connectionOpened();
|
2012-02-24 10:47:17 +01:00
|
|
|
void connectionFailed();
|
2012-05-08 15:14:11 +02:00
|
|
|
void connectionClosed();
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2016-07-14 09:41:04 +02:00
|
|
|
private:
|
|
|
|
|
QPointer<QmlProfilerStateManager> m_profilerState;
|
|
|
|
|
QPointer<QmlProfilerModelManager> m_modelManager;
|
|
|
|
|
QScopedPointer<QmlDebug::QmlDebugConnection> m_connection;
|
|
|
|
|
QScopedPointer<QmlProfilerTraceClient> m_qmlclientplugin;
|
|
|
|
|
|
|
|
|
|
QTimer m_connectionTimer;
|
|
|
|
|
|
|
|
|
|
QString m_localSocket;
|
|
|
|
|
QString m_tcpHost;
|
|
|
|
|
Utils::Port m_tcpPort;
|
|
|
|
|
quint32 m_flushInterval = 0;
|
|
|
|
|
|
|
|
|
|
int m_retryInterval = 200;
|
|
|
|
|
int m_maximumRetries = 50;
|
|
|
|
|
int m_numRetries = 0;
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
void disconnectClient();
|
2016-07-14 09:41:04 +02:00
|
|
|
void stopConnectionTimer();
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2014-05-05 17:18:11 +02:00
|
|
|
void qmlDebugConnectionOpened();
|
|
|
|
|
void qmlDebugConnectionClosed();
|
2016-07-15 13:09:38 +02:00
|
|
|
void qmlDebugConnectionFailed();
|
|
|
|
|
|
2014-05-05 17:18:11 +02:00
|
|
|
void logState(const QString &);
|
|
|
|
|
|
2015-11-17 16:42:21 +01:00
|
|
|
void createConnection();
|
2012-02-24 10:47:17 +01:00
|
|
|
void connectClientSignals();
|
|
|
|
|
void disconnectClientSignals();
|
|
|
|
|
};
|
|
|
|
|
|
2016-04-28 16:02:54 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|