blob: d328a4c36e020dcc06797f1024fbecd1ad0deff4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "qmlpreviewplugin.h"
#include "qmlpreviewclient.h"
#include "qmldebugtranslationclient.h"
#include "qmlpreviewfileontargetfinder.h"
#include <qmldebug/qmldebugconnectionmanager.h>
#include <utils/fileinprojectfinder.h>
#include <utils/filesystemwatcher.h>
namespace ProjectExplorer {
class Target;
}
namespace QmlPreview {
namespace Internal {
class QmlPreviewConnectionManager : public QmlDebug::QmlDebugConnectionManager
{
Q_OBJECT
public:
virtual ~QmlPreviewConnectionManager();
explicit QmlPreviewConnectionManager(QObject *parent = nullptr);
void setTarget(ProjectExplorer::Target *target);
void setFileLoader(QmlPreviewFileLoader fileLoader);
void setFileClassifier(QmlPreviewFileClassifier fileClassifier);
void setFpsHandler(QmlPreviewFpsHandler fpsHandler);
void setQmlDebugTranslationClientCreator(QmlDebugTranslationClientCreator creator);
signals:
void loadFile(const QString &filename, const QString &changedFile, const QByteArray &contents);
void zoom(float zoomFactor);
void language(const QString &locale);
void rerun();
void restart();
protected:
void createClients() override;
void destroyClients() override;
private:
void createPreviewClient();
void createDebugTranslationClient();
void clearClient(QObject *client);
QUrl findValidI18nDirectoryAsUrl(const QString &locale);
Utils::FileInProjectFinder m_projectFileFinder;
QmlPreviewFileOnTargetFinder m_targetFileFinder;
QPointer<QmlPreviewClient> m_qmlPreviewClient;
std::unique_ptr<QmlDebugTranslationClient> m_qmlDebugTranslationClient;
Utils::FileSystemWatcher m_fileSystemWatcher;
QUrl m_lastLoadedUrl;
QString m_lastUsedLanguage;
QmlPreviewFileLoader m_fileLoader = nullptr;
QmlPreviewFileClassifier m_fileClassifier = nullptr;
QmlPreviewFpsHandler m_fpsHandler = nullptr;
QmlDebugTranslationClientCreator m_createDebugTranslationClientMethod;
};
} // namespace Internal
} // namespace QmlPreview
|