Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgassetimportmanager_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSGASSETIMPORTMANAGER_H
7#define QSSGASSETIMPORTMANAGER_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DAssetImport/private/qtquick3dassetimportglobal_p.h>
21
22#include <QtCore/QObject>
23#include <QtCore/QVector>
24#include <QtCore/QMap>
25#include <QtCore/QDir>
26#include <QtCore/QString>
27#include <QtCore/QList>
28#include <QtCore/qjsonobject.h>
29
30QT_BEGIN_NAMESPACE
31
32class QSSGAssetImporter;
33class QQuick3DNode;
34namespace QSSGSceneDesc { struct Scene; }
35
45
46class Q_QUICK3DASSETIMPORT_EXPORT QSSGAssetImportManager : public QObject
47{
48 Q_OBJECT
49public:
50 explicit QSSGAssetImportManager(QObject *parent = nullptr);
51 ~QSSGAssetImportManager();
52
53 enum class ImportState : quint8
54 {
55 Success,
56 IoError,
57 Unsupported
58 };
59
60 using PluginOptionMaps = QHash<QString, QJsonObject>;
61
62 // ### Temp API
63 ImportState importFile(const QString &filename,
64 const QDir &outputPath,
65 QString *error = nullptr);
66 ImportState importFile(const QString &filename,
67 const QDir &outputPath,
68 const QJsonObject &options = QJsonObject(),
69 QString *error = nullptr);
70 ImportState importFile(const QUrl &url,
71 QSSGSceneDesc::Scene &scene,
72 QString *error = nullptr);
73 ImportState importFile(const QUrl &url,
74 QSSGSceneDesc::Scene &scene,
75 const QJsonObject &options = QJsonObject(),
76 QString *error = nullptr);
77 QJsonObject getOptionsForFile(const QString &filename);
78 PluginOptionMaps getAllOptions() const;
79 QHash<QString, QStringList> getSupportedExtensions() const;
80 QList<QSSGAssetImporterPluginInfo> getImporterPluginInfos() const;
81
82private:
83 QVector<QSSGAssetImporter *> m_assetImporters;
84 QMap<QString, QSSGAssetImporter *> m_extensionsMap;
85};
86
87QT_END_NAMESPACE
88
89#endif // QSSGASSETIMPORTMANAGER_H
Combined button and popup list for selecting options.