blob: 2e2077bcc593bed3e2581419a0145f9540b2a2f3 (
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
|
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2019 Luxoft Sweden AB
// Copyright (C) 2018 Pelagicore AG
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef RUNTIMEFACTORY_H
#define RUNTIMEFACTORY_H
#include <QtCore/QHash>
#include <QtCore/QObject>
#include <QtAppManCommon/global.h>
QT_BEGIN_NAMESPACE_AM
class Application;
class AbstractRuntime;
class AbstractRuntimeManager;
class AbstractContainer;
class RuntimeFactory : public QObject
{
Q_OBJECT
public:
static RuntimeFactory *instance();
~RuntimeFactory() override;
QStringList runtimeIds() const;
AbstractRuntimeManager *manager(const QString &id);
AbstractRuntime *create(AbstractContainer *container, Application *app);
AbstractRuntime *createQuickLauncher(AbstractContainer *container, const QString &id);
void setConfiguration(const QVariantMap &configuration);
void setSlowAnimations(bool isSlow);
bool registerRuntime(AbstractRuntimeManager *manager);
bool registerRuntime(AbstractRuntimeManager *manager, const QString &identifier);
private:
RuntimeFactory(QObject *parent = nullptr);
RuntimeFactory(const RuntimeFactory &);
RuntimeFactory &operator=(const RuntimeFactory &);
static RuntimeFactory *s_instance;
QHash<QString, AbstractRuntimeManager *> m_runtimes;
// To be passed to newly created runtimes
bool m_slowAnimations{false};
};
QT_END_NAMESPACE_AM
#endif // RUNTIMEFACTORY_H
|