Qt 6.x
The Qt SDK
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
4#ifndef QQMLDOMCONSTANTS_P_H
5#define QQMLDOMCONSTANTS_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 "qqmldom_global.h"
19
20#include <QtCore/QObject>
21#include <QtCore/QMetaObject>
22#include <QtCore/private/qglobal_p.h>
23
25
26namespace QQmlJS{
27namespace Dom {
28
30
31enum class PathRoot {
32 Other,
33 Modules,
34 Cpp,
35 Libs,
36 Top,
37 Env,
39};
41
42enum class PathCurrent {
43 Other,
44 Obj,
48 Module,
49 Ids,
50 Types,
53 Lookup
54};
56
59
60enum class ResolveOption{
61 None=0,
62 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)
63};
65Q_DECLARE_FLAGS(ResolveOptions, ResolveOption)
67
68enum class VisitOption {
69 None = 0,
70 VisitSelf = 0x1, // Visit the start item
71 VisitAdopted = 0x2, // Visit adopted types (but never recurses them)
72 Recurse = 0x4, // recurse non adopted types
73 NoPath = 0x8, // does not generate path consistent with visit
75};
77Q_DECLARE_FLAGS(VisitOptions, VisitOption)
79
80enum class LookupOption {
81 Normal = 0,
82 Strict = 0x1,
83 VisitTopClassType = 0x2, // static lookup of class (singleton) or attached type, the default is
84 // visiting instance methods
85 SkipFirstScope = 0x4
86};
88Q_DECLARE_FLAGS(LookupOptions, LookupOption)
90
93
95 Normal = 0,
96 SkipFirst = 0x1,
97 RevisitWarn = 0x2,
99};
101Q_DECLARE_FLAGS(VisitPrototypesOptions, VisitPrototypesOption)
102Q_DECLARE_OPERATORS_FOR_FLAGS(VisitPrototypesOptions)
103
106
107enum class DomType {
108 Empty, // only for default ctor
109
110 ExternalItemInfo, // base class for anything represented by an actual file
111 ExternalItemPair, // pair of newest version of item, and latest valid update ### REVISIT
112 // ExternalOwningItems refer to an external path and can be shared between environments
113 QmlDirectory, // dir e.g. used for implicit import
114 QmldirFile, // qmldir
115 JsFile, // file
116 QmlFile, // file
117 QmltypesFile, // qmltypes
118 GlobalScope, // language dependent (currently no difference)
119 /* enum A { B, C }
120 * *
121 EnumItem is marked with * */
122 EnumItem,
123
124 // types
125 EnumDecl, // A in above example
126 JsResource, // QML file contains QML object, JSFile contains JsResource
127 QmltypesComponent, // Component inside a qmltypes fles; compared to component it has exported
128 // meta-object revisions; singleton flag; can export multiple names
129 QmlComponent, // "normal" QML file based Component; also can represent inline components
130 GlobalComponent, // component of global object ### REVISIT, try to replace with one of the above
131
132 ModuleAutoExport, // dependent imports to automatically load when a module is imported
133 ModuleIndex, // index for all the imports of a major version
134 ModuleScope, // a specific import with full version
135 ImportScope, // the scope including the types coming from one or more imports
136 Export, // An exported type
137
138 // header stuff
139 Import, // wrapped
140 Pragma,
141
142 // qml elements
143 Id,
144 QmlObject, // the Item in Item {}; also used to represent types in qmltype files
145 ConstantData, // the 2 in "property int i: 2"; can be any generic data in a QML document
146 SimpleObjectWrap, // internal wrapping to give uniform DOMItem access; ### research more
147 ScriptExpression, // wraps an AST script expression as a DOMItem
148 Reference, // reference to another DOMItem; e.g. asking for a type of an object returns a
149 // Reference
150 PropertyDefinition, // _just_ the property definition; without the binding, even if it's one
151 // line
152 Binding, // the part after the ":"
154 MethodInfo, // container of MethodParameter
155 Version, // wrapped
156 Comment,
157 CommentedElement, // attached to AST if they have pre-/post-comments?
158 RegionComments, // DomItems have attached RegionComments; can attach comments to fine grained
159 // "regions" in a DomItem; like the default keyword of a property definition
160 AstComments, // hash-table from AST node to commented element
161 FileLocations, // mapping from DomItem to file location ### REVISIT: try to move out of
162 // hierarchy?
163 UpdatedScriptExpression, // used in writeOut method when formatting changes ### Revisit: try to
164 // move out of DOM hierarchy
165
166 // convenience collecting types
167 PropertyInfo, // not a DOM Item, just a convenience class
168
169 // Moc objects, mainly for testing ### Try to remove them; replace their usage in tests with
170 // "real" instances
172 MockOwner,
173
174 // containers
175 Map,
176 List,
177 ListP,
178
179 // supporting objects
180 LoadInfo, // owning, used inside DomEnvironment ### REVISIT: move out of hierarchy
181 ErrorMessage, // wrapped
182 AttachedInfo, // owning
183
184 // Dom top level
185 DomEnvironment, // a consistent view of modules, types, files, etc.
186 DomUniverse, // a cache of what can be found in the DomEnvironment, contains the latest valid
187 // version for every file/type, etc. + latest overall
188
189 // Dom Script elements
190 // TODO
191 ScriptElementWrap, // internal wrapping to give uniform access of script elements (e.g. for
192 // statement lists)
193 ScriptElementStart, // marker to check if a DomType is a scriptelement or not
225
226 ScriptElementStop, // marker to check if a DomType is a scriptelement or not
227};
229
230enum class SimpleWrapOption { None = 0, ValueType = 1 };
232Q_DECLARE_FLAGS(SimpleWrapOptions, SimpleWrapOption)
233Q_DECLARE_OPERATORS_FOR_FLAGS(SimpleWrapOptions)
234
237
240
241enum class ListOptions {
242 Normal,
243 Reverse
244};
246
247enum class LoadOption {
248 DefaultLoad = 0x0,
249 ForceLoad = 0x1,
250};
252Q_DECLARE_FLAGS(LoadOptions, LoadOption)
254
255enum class EscapeOptions{
258};
260
261enum class ErrorLevel{
267};
269
270enum class AstDumperOption {
271 None=0,
272 NoLocations=0x1,
273 NoAnnotations=0x2,
274 DumpNode=0x4,
275 SloppyCompare=0x8
276};
278Q_DECLARE_FLAGS(AstDumperOptions, AstDumperOption)
279Q_DECLARE_OPERATORS_FOR_FLAGS(AstDumperOptions)
280
281enum class GoTo {
282 Strict, // never go to an non uniquely defined result
283 MostLikely // if needed go up to the most likely location between multiple options
284};
286
289
292
293enum class WriteOutCheck {
294 None = 0x0,
295 UpdatedDomCompare = 0x1,
296 UpdatedDomStable = 0x2,
297 Reparse = 0x4,
298 ReparseCompare = 0x8,
299 ReparseStable = 0x10,
300 DumpOnFailure = 0x20,
301 All = 0x3F,
303};
305Q_DECLARE_FLAGS(WriteOutChecks, WriteOutCheck)
306Q_DECLARE_OPERATORS_FOR_FLAGS(WriteOutChecks)
307
309 None = 0x0,
310 QmlTypes = 0x1,
311 Types = 0x3,
312 Signals = 0x4,
313 Methods = 0xC,
314 Attributes = 0x10,
315 Ids = 0x20,
316 Components = 0x40,
317 Namespaces = 0x80,
318 Globals = 0x100,
319 MethodParameters = 0x200,
320 All = 0x3FF
321};
323Q_DECLARE_FLAGS(LocalSymbolsTypes, LocalSymbolsType)
324Q_DECLARE_OPERATORS_FOR_FLAGS(LocalSymbolsTypes)
325
326} // end namespace Dom
327} // end namespace QQmlJS
328
330
331#endif // QQMLDOMCONSTANTS_P_H
Associates comments with AST::Node *.
Attached info creates a tree to attach extra info to DomItems.
Represents a comment.
Keeps the comment associated with an element.
Represents a consistent set of types organized in modules, it is the top level of the DOM.
Represents a set of parsed/loaded modules libraries and a plugins.
Represents an error message connected to the dom.
Represents and maintains a mapping between elements and their location in a file.
Keeps the comments associated with a DomItem.
Language
Definition language.h:13
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
@ QtCriticalMsg
Definition qlogging.h:32
@ QtInfoMsg
Definition qlogging.h:34
@ QtWarningMsg
Definition qlogging.h:31
@ QtFatalMsg
Definition qlogging.h:33
@ QtDebugMsg
Definition qlogging.h:30
#define QMLDOM_EXPORT
BindingType
#define Q_ENUM_NS(x)
#define Q_NAMESPACE_EXPORT(...)
A common base class for all the script elements.