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