aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltyperegistrar/qqmltyperegistrar_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmltyperegistrar/qqmltyperegistrar_p.h')
-rw-r--r--src/qmltyperegistrar/qqmltyperegistrar_p.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/qmltyperegistrar/qqmltyperegistrar_p.h b/src/qmltyperegistrar/qqmltyperegistrar_p.h
new file mode 100644
index 0000000000..e0811f2ade
--- /dev/null
+++ b/src/qmltyperegistrar/qqmltyperegistrar_p.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef QMLTYPEREGISTRAR_P_H
+#define QMLTYPEREGISTRAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qcbormap.h>
+#include <QtCore/qversionnumber.h>
+
+#include <cstdlib>
+
+#include "qmetatypesjsonprocessor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QmlTypeRegistrar
+{
+ QString m_module;
+ QString m_targetNamespace;
+ QTypeRevision m_moduleVersion;
+ QList<quint8> m_pastMajorVersions;
+ QList<QString> m_includes;
+ bool m_followForeignVersioning = false;
+ QVector<MetaType> m_types;
+ QVector<MetaType> m_foreignTypes;
+ QList<QAnyStringView> m_referencedTypes;
+
+ MetaType findType(QAnyStringView name) const;
+ MetaType findTypeForeign(QAnyStringView name) const;
+
+public:
+ void write(QTextStream &os, QAnyStringView outFileName) const;
+ bool generatePluginTypes(const QString &pluginTypesFile);
+ void setModuleNameAndNamespace(const QString &module, const QString &targetNamespace);
+ void setModuleVersions(QTypeRevision moduleVersion, const QList<quint8> &pastMajorVersions,
+ bool followForeignVersioning);
+ void setIncludes(const QList<QString> &includes);
+ void setTypes(const QVector<MetaType> &types, const QVector<MetaType> &foreignTypes);
+ void setReferencedTypes(const QList<QAnyStringView> &referencedTypes);
+
+ static bool argumentsFromCommandLineAndFile(QStringList &allArguments,
+ const QStringList &arguments);
+ static int runExtract(const QString &baseName, const MetaTypesJsonProcessor &processor);
+};
+
+QT_END_NAMESPACE
+#endif // QMLTYPEREGISTRAR_P_H