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
qqmldomconstants_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QQMLDOMCONSTANTS_P_H
6#define QQMLDOMCONSTANTS_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 "qqmldom_global.h"
20
21#include <QtCore/QObject>
22#include <QtCore/QMetaObject>
23#include <QtCore/private/qglobal_p.h>
24
26
27namespace QQmlJS{
28namespace Dom {
29
30Q_NAMESPACE_EXPORT(QMLDOM_EXPORT)
31
40Q_ENUM_NS(PathRoot)
41
52Q_ENUM_NS(PathCurrent)
53
55Q_ENUM_NS(Language)
56
57enum class VisitOption {
58 None = 0,
59 VisitSelf = 0x1, // Visit the start item
60 VisitAdopted = 0x2, // Visit adopted types (but never recurses them)
61 Recurse = 0x4, // recurse non adopted types
62 NoPath = 0x8, // does not generate path consistent with visit
64};
65Q_ENUM_NS(VisitOption)
68
69enum class LookupOption {
70 Normal = 0,
71 Strict = 0x1,
72 VisitTopClassType = 0x2, // static lookup of class (singleton) or attached type, the default is
73 // visiting instance methods
75};
76Q_ENUM_NS(LookupOption)
79
81Q_ENUM_NS(LookupType)
82
89Q_ENUM_NS(VisitPrototypesOption)
92
94Q_ENUM_NS(DomKind)
95
96enum class DomType {
97 Empty, // only for default ctor
98
99 ExternalItemInfo, // base class for anything represented by an actual file
100 ExternalItemPair, // pair of newest version of item, and latest valid update ### REVISIT
101 // ExternalOwningItems refer to an external path and can be shared between environments
102 JsFile, // file
103 QmlFile, // file
104 /* enum A { B, C }
105 * *
106 EnumItem is marked with * */
108
109 // types
110 EnumDecl, // A in above example
111 JsResource, // QML file contains QML object, JSFile contains JsResource
112 QmlComponent, // "normal" QML file based Component; also can represent inline components
113 GlobalComponent, // component of global object ### REVISIT, try to replace with one of the above
114
115 ModuleAutoExport, // dependent imports to automatically load when a module is imported
116 Export, // An exported type
117
118 // header stuff
119 Import, // wrapped
121
122 // qml elements
124 QmlObject, // the Item in Item {}; also used to represent types in qmltype files
125 ConstantData, // the 2 in "property int i: 2"; can be any generic data in a QML document
126 SimpleObjectWrap, // internal wrapping to give uniform DOMItem access; ### research more
127 ScriptExpression, // wraps an AST script expression as a DOMItem
128 Reference, // reference to another DOMItem; e.g. asking for a type of an object returns a
129 // Reference
130 PropertyDefinition, // _just_ the property definition; without the binding, even if it's one
131 // line
132 Binding, // the part after the ":"
134 MethodInfo, // container of MethodParameter
135 Version, // wrapped
137 CommentedElement, // attached to AST if they have pre-/post-comments?
138 RegionComments, // DomItems have attached RegionComments; can attach comments to fine grained
139 // "regions" in a DomItem; like the default keyword of a property definition
140 AstComments, // hash-table from AST node to commented element
141 FileLocationsInfo, // mapping from DomItem to file location ### REVISIT: try to move out of
142 // hierarchy?
143
144 // convenience collecting types
145 PropertyInfo, // not a DOM Item, just a convenience class
146
147 // containers
151
152 // supporting objects
153 LoadInfo, // owning, used inside DomEnvironment ### REVISIT: move out of hierarchy
154 ErrorMessage, // wrapped
156
157 // Dom top level
158 DomEnvironment, // a consistent view of modules, types, files, etc.
159 DomUniverse, // a cache of what can be found in the DomEnvironment, contains the latest valid
160 // version for every file/type, etc. + latest overall
161
162 // Dom Script elements
163 // TODO
164 ScriptElementWrap, // internal wrapping to give uniform access of script elements (e.g. for
165 // statement lists)
166 ScriptElementStart, // marker to check if a DomType is a scriptelement or not
215
216 ScriptElementStop, // marker to check if a DomType is a scriptelement or not
217};
218Q_ENUM_NS(DomType)
219
220enum class SimpleWrapOption { None = 0, ValueType = 1 };
221Q_ENUM_NS(SimpleWrapOption)
224
226Q_ENUM_NS(BindingValueKind)
227
229Q_ENUM_NS(BindingType)
230
235Q_ENUM_NS(ListOptions)
236
241Q_ENUM_NS(EscapeOptions)
242
250Q_ENUM_NS(ErrorLevel)
251
259Q_ENUM_NS(AstDumperOption)
262
263enum class GoTo {
264 Strict, // never go to an non uniquely defined result
265 MostLikely // if needed go up to the most likely location between multiple options
266};
267Q_ENUM_NS(GoTo)
268
270Q_ENUM_NS(AddOption)
271
272/*!
273\internal
274FilterUpOptions decide in which direction the filtering is done.
275ReturnInner starts the search at top(), and work its way down to the current
276element.
277ReturnOuter and ReturnOuterNoSelf starts the search at the current element and
278works their way up to to top().
279*/
281Q_ENUM_NS(FilterUpOptions)
282
290Q_ENUM_NS(WriteOutCheck)
293
295 None = 0x0,
298 Signal = 0x4,
299 Method = 0x8,
300 Attribute = 0x10,
301 Id = 0x20,
302 Namespace = 0x40,
303 Global = 0x80,
305 Singleton = 0x200,
307};
308Q_ENUM_NS(LocalSymbolsType)
311
312/*!
313\internal
314The FileLocationRegion allows to map the different FileLocation subregions to their position in
315the actual code. For example, \c{ColonTokenRegion} denotes the position of the ':' token in a
316binding like `myProperty: something()`, or the ':' token in a pragma like `pragma Hello: World`.
317
318These are used for formatting in qmlformat and autocompletion in qmlls.
319
320MainRegion denotes the entire FileLocation region.
321
322\sa{OutWriter::regionToString}, {FileLocations::regionName}
323*/
390};
392
393enum DomCreationOption : char {
394 Default, // required by qmlformat for example
395 Extended, // required by qmlls for example
396 Minimal, // required by QmlDocumentParser in Qt Design Studio, for example
397};
398
399} // end namespace Dom
400} // end namespace QQmlJS
401
402QT_END_NAMESPACE
403
404#endif // QQMLDOMCONSTANTS_P_H
std::pair< AST::Node *, CommentAnchor > CommentKey
Represents a comment.
Keeps the comment associated with an element.
A value type that references any element of the Dom.
Represents a Node of FileLocations tree.
std::function< index_type(const DomItem &)> Length
std::function< QSet< QString >(const DomItem &)> Keys
A DomItem that owns other DomItems and is managed through a shared pointer.
Represents an immutable JsonPath like path in the Qml code model (from a DomItem to another DomItem).
QList< std::pair< SourceLocation, DomItem > > Attributes
static constexpr DomType kindValue
Keeps the comments associated with a DomItem.
\inmodule QtSql
Provides entities to maintain mappings between elements and their location in a file.
Q_ENUM_NS(FileLocationRegion)
QString fileLocationRegionName(FileLocationRegion region)
FileLocationRegion fileLocationRegionValue(QStringView region)
static QMetaEnum regionEnum
QCborValue sourceLocationToQCborValue(QQmlJS::SourceLocation loc)
Combined button and popup list for selecting options.
#define QMLDOM_EXPORT
qOverloadedVisitor(Ts...) -> qOverloadedVisitor< Ts... >