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 QMLTYPESCLASSDESCRIPTION_P_H
5#define QMLTYPESCLASSDESCRIPTION_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/qstring.h>
19#include <QtCore/qjsonobject.h>
20#include <QtCore/qvector.h>
21#include <QtCore/qset.h>
22#include <QtCore/qversionnumber.h>
23
24QT_BEGIN_NAMESPACE
25
26struct QmlTypesClassDescription
27{
28 const QJsonObject *resolvedClass = nullptr;
29 QString file;
30 QString className;
31 QString elementName;
32 QString defaultProp;
33 QString parentProp;
34 QString superClass;
35 QString attachedType;
36 QString extensionType;
37 QString sequenceValueType;
38 QString accessSemantics;
39 QList<QTypeRevision> revisions;
40 QTypeRevision addedInRevision;
41 QTypeRevision removedInRevision;
42 bool isCreatable = true;
43 bool isSingleton = false;
44 bool hasCustomParser = false;
45 bool omitFromQmlTypes = false;
46 bool extensionIsNamespace = false;
47 QStringList implementsInterfaces;
48 QStringList deferredNames;
49 QStringList immediateNames;
50
51 enum CollectMode {
52 TopLevel,
53 SuperClass,
54 RelatedType
55 };
56
57 void collect(const QJsonObject *classDef, const QVector<QJsonObject> &types,
58 const QVector<QJsonObject> &foreign, CollectMode mode,
59 QTypeRevision defaultRevision);
60 const QJsonObject *collectRelated(
61 const QString &related, const QVector<QJsonObject> &types,
62 const QVector<QJsonObject> &foreign, QTypeRevision defaultRevision,
63 const QStringList &namespaces);
64 static const QJsonObject *findType(
65 const QVector<QJsonObject> &types, const QVector<QJsonObject> &foreign,
66 const QString &name, const QStringList &namespaces);
67
68 void collectLocalAnonymous(const QJsonObject *classDef,const QVector<QJsonObject> &types,
69 const QVector<QJsonObject> &foreign, QTypeRevision defaultRevision);
70
71
72private:
73 void collectSuperClasses(
74 const QJsonObject *classDef, const QVector<QJsonObject> &types,
75 const QVector<QJsonObject> &foreign, CollectMode mode, QTypeRevision defaultRevision);
76 void collectInterfaces(const QJsonObject *classDef);
77};
78
79QT_END_NAMESPACE
80#endif // QMLTYPESCLASSDESCRIPTION_P_H
81

source code of qtdeclarative/src/qmltyperegistrar/qqmltypesclassdescription_p.h