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
41Q_ENUM_NS(PathRoot)
42
54Q_ENUM_NS(PathCurrent)
55
57Q_ENUM_NS(Language)
58
59enum class ResolveOption{
61 TraceVisit=0x1 // call the function along all elements of the path, not just for the target (the function might be called even if the target is never reached)
62};
63Q_ENUM_NS(ResolveOption)
66
67enum class VisitOption {
68 None = 0,
69 VisitSelf = 0x1, // Visit the start item
70 VisitAdopted = 0x2, // Visit adopted types (but never recurses them)
71 Recurse = 0x4, // recurse non adopted types
72 NoPath = 0x8, // does not generate path consistent with visit
74};
75Q_ENUM_NS(VisitOption)
78
79enum class LookupOption {
80 Normal = 0,
81 Strict = 0x1,
82 VisitTopClassType = 0x2, // static lookup of class (singleton) or attached type, the default is
83 // visiting instance methods
85};
86Q_ENUM_NS(LookupOption)
89
91Q_ENUM_NS(LookupType)
92
99Q_ENUM_NS(VisitPrototypesOption)
102
104Q_ENUM_NS(DomKind)
105
106enum class DomType {
107 Empty, // only for default ctor
108
109 ExternalItemInfo, // base class for anything represented by an actual file
110 ExternalItemPair, // pair of newest version of item, and latest valid update ### REVISIT
111 // ExternalOwningItems refer to an external path and can be shared between environments
112 JsFile, // file
113 QmlFile, // file
114 /* enum A { B, C }
115 * *
116 EnumItem is marked with * */
118
119 // types
120 EnumDecl, // A in above example
121 JsResource, // QML file contains QML object, JSFile contains JsResource
122 QmlComponent, // "normal" QML file based Component; also can represent inline components
123 GlobalComponent, // component of global object ### REVISIT, try to replace with one of the above
124
125 ModuleAutoExport, // dependent imports to automatically load when a module is imported
126 Export, // An exported type
127
128 // header stuff
129 Import, // wrapped
131
132 // qml elements
134 QmlObject, // the Item in Item {}; also used to represent types in qmltype files
135 ConstantData, // the 2 in "property int i: 2"; can be any generic data in a QML document
136 SimpleObjectWrap, // internal wrapping to give uniform DOMItem access; ### research more
137 ScriptExpression, // wraps an AST script expression as a DOMItem
138 Reference, // reference to another DOMItem; e.g. asking for a type of an object returns a
139 // Reference
140 PropertyDefinition, // _just_ the property definition; without the binding, even if it's one
141 // line
142 Binding, // the part after the ":"
144 MethodInfo, // container of MethodParameter
145 Version, // wrapped
147 CommentedElement, // attached to AST if they have pre-/post-comments?
148 RegionComments, // DomItems have attached RegionComments; can attach comments to fine grained
149 // "regions" in a DomItem; like the default keyword of a property definition
150 AstComments, // hash-table from AST node to commented element
151 FileLocationsInfo, // mapping from DomItem to file location ### REVISIT: try to move out of
152 // hierarchy?
153
154 // convenience collecting types
155 PropertyInfo, // not a DOM Item, just a convenience class
156
157 // Moc objects, mainly for testing ### Try to remove them; replace their usage in tests with
158 // "real" instances
161
162 // containers
166
167 // supporting objects
168 LoadInfo, // owning, used inside DomEnvironment ### REVISIT: move out of hierarchy
169 ErrorMessage, // wrapped
171
172 // Dom top level
173 DomEnvironment, // a consistent view of modules, types, files, etc.
174 DomUniverse, // a cache of what can be found in the DomEnvironment, contains the latest valid
175 // version for every file/type, etc. + latest overall
176
177 // Dom Script elements
178 // TODO
179 ScriptElementWrap, // internal wrapping to give uniform access of script elements (e.g. for
180 // statement lists)
181 ScriptElementStart, // marker to check if a DomType is a scriptelement or not
230
231 ScriptElementStop, // marker to check if a DomType is a scriptelement or not
232};
233Q_ENUM_NS(DomType)
234
235enum class SimpleWrapOption { None = 0, ValueType = 1 };
236Q_ENUM_NS(SimpleWrapOption)
239
241Q_ENUM_NS(BindingValueKind)
242
244Q_ENUM_NS(BindingType)
245
250Q_ENUM_NS(ListOptions)
251
256Q_ENUM_NS(EscapeOptions)
257
265Q_ENUM_NS(ErrorLevel)
266
274Q_ENUM_NS(AstDumperOption)
277
278enum class GoTo {
279 Strict, // never go to an non uniquely defined result
280 MostLikely // if needed go up to the most likely location between multiple options
281};
282Q_ENUM_NS(GoTo)
283
285Q_ENUM_NS(AddOption)
286
287/*!
288\internal
289FilterUpOptions decide in which direction the filtering is done.
290ReturnInner starts the search at top(), and work its way down to the current
291element.
292ReturnOuter and ReturnOuterNoSelf starts the search at the current element and
293works their way up to to top().
294*/
296Q_ENUM_NS(FilterUpOptions)
297
305Q_ENUM_NS(WriteOutCheck)
308
310 None = 0x0,
313 Signal = 0x4,
314 Method = 0x8,
315 Attribute = 0x10,
316 Id = 0x20,
317 Namespace = 0x40,
318 Global = 0x80,
320 Singleton = 0x200,
322};
323Q_ENUM_NS(LocalSymbolsType)
326
327/*!
328\internal
329The FileLocationRegion allows to map the different FileLocation subregions to their position in
330the actual code. For example, \c{ColonTokenRegion} denotes the position of the ':' token in a
331binding like `myProperty: something()`, or the ':' token in a pragma like `pragma Hello: World`.
332
333These are used for formatting in qmlformat and autocompletion in qmlls.
334
335MainRegion denotes the entire FileLocation region.
336
337\sa{OutWriter::regionToString}, {FileLocations::regionName}
338*/
405};
407
408enum DomCreationOption : char {
409 Default, // required by qmlformat for example
410 Extended, // required by qmlls for example
411 Minimal, // required by QmlDocumentParser in Qt Design Studio, for example
412};
413
414} // end namespace Dom
415} // end namespace QQmlJS
416
417QT_END_NAMESPACE
418
419#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
QMap< QString, QMap< QString, MockObject > > subMaps
A DomItem that owns other DomItems and is managed through a shared pointer.
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... >