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
qqmltyperegistrar_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 WITH Qt-GPL-exception-1.0
3
4#ifndef QMLTYPEREGISTRAR_P_H
5#define QMLTYPEREGISTRAR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qcbormap.h>
19#include <QtCore/qversionnumber.h>
20
21#include <cstdlib>
22
24
26
28{
29 QString m_module;
30 QString m_targetNamespace;
31 QTypeRevision m_moduleVersion;
32 QList<quint8> m_pastMajorVersions;
33 QList<QString> m_includes;
34 bool m_followForeignVersioning = false;
35 QVector<MetaType> m_types;
36 QVector<MetaType> m_foreignTypes;
37 QList<QAnyStringView> m_referencedTypes;
38 QList<UsingDeclaration> m_usingDeclarations;
39
40 MetaType findType(QAnyStringView name) const;
41 MetaType findTypeForeign(QAnyStringView name) const;
42
43public:
44 void write(QTextStream &os, QAnyStringView outFileName) const;
45 bool generatePluginTypes(const QString &pluginTypesFile, bool generatingJSRoot = false);
46 void setModuleNameAndNamespace(const QString &module, const QString &targetNamespace);
47 void setModuleVersions(QTypeRevision moduleVersion, const QList<quint8> &pastMajorVersions,
48 bool followForeignVersioning);
49 void setIncludes(const QList<QString> &includes);
50 void setTypes(const QVector<MetaType> &types, const QVector<MetaType> &foreignTypes);
51 void setReferencedTypes(const QList<QAnyStringView> &referencedTypes);
52 void setUsingDeclarations(const QList<UsingDeclaration> &usingDeclarations);
53
54 static bool argumentsFromCommandLineAndFile(QStringList &allArguments,
55 const QStringList &arguments);
56 static int runExtract(
57 const QString &baseName, const QString &nameSpace,
58 const MetaTypesJsonProcessor &processor);
59};
60
61QT_END_NAMESPACE
62#endif // QMLTYPEREGISTRAR_P_H
MetaType()=default
bool generatePluginTypes(const QString &pluginTypesFile, bool generatingJSRoot=false)
void setModuleNameAndNamespace(const QString &module, const QString &targetNamespace)
static bool argumentsFromCommandLineAndFile(QStringList &allArguments, const QStringList &arguments)
void setTypes(const QVector< MetaType > &types, const QVector< MetaType > &foreignTypes)
void setIncludes(const QList< QString > &includes)
static int runExtract(const QString &baseName, const QString &nameSpace, const MetaTypesJsonProcessor &processor)
void write(QTextStream &os, QAnyStringView outFileName) const
void setModuleVersions(QTypeRevision moduleVersion, const QList< quint8 > &pastMajorVersions, bool followForeignVersioning)
void setUsingDeclarations(const QList< UsingDeclaration > &usingDeclarations)
void setReferencedTypes(const QList< QAnyStringView > &referencedTypes)
void setGeneratingJSRoot(bool jsroot)
static QString registrationVarName(const QString &module)
bool operator<(const ExclusiveVersionRange &x, const ExclusiveVersionRange &y)
True if x was removed before y was introduced.
QString conflictingVersionToString(const ExclusiveVersionRange &r)
bool operator==(const ExclusiveVersionRange &x, const ExclusiveVersionRange &y)
True when x and y share a common version.