Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
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 };
237Q_DECLARE_FLAGS(SimpleWrapOptions, SimpleWrapOption)
238Q_DECLARE_OPERATORS_FOR_FLAGS(SimpleWrapOptions)
239
242
245
246enum class ListOptions {
247 Normal,
248 Reverse
249};
251
252enum class EscapeOptions{
255};
257
266
267enum class AstDumperOption {
268 None=0,
269 NoLocations=0x1,
270 NoAnnotations=0x2,
271 DumpNode=0x4,
272 SloppyCompare=0x8
273};
275Q_DECLARE_FLAGS(AstDumperOptions, AstDumperOption)
276Q_DECLARE_OPERATORS_FOR_FLAGS(AstDumperOptions)
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};
283
286
287
297
298enum class WriteOutCheck {
299 None = 0x0,
300 UpdatedDomCompare = 0x1,
301 UpdatedDomStable = 0x2,
302 Reparse = 0x4,
303 ReparseCompare = 0x8,
304 ReparseStable = 0x10,
305 DumpOnFailure = 0x20,
306 All = 0x3F,
308};
310Q_DECLARE_FLAGS(WriteOutChecks, WriteOutCheck)
311Q_DECLARE_OPERATORS_FOR_FLAGS(WriteOutChecks)
312
314 None = 0x0,
315 ObjectType = 0x1,
316 ValueType = 0x2,
317 Signal = 0x4,
318 Method = 0x8,
319 Attribute = 0x10,
320 Id = 0x20,
321 Namespace = 0x40,
322 Global = 0x80,
323 MethodParameter = 0x100,
324 Singleton = 0x200,
325 AttachedType = 0x400,
326};
328Q_DECLARE_FLAGS(LocalSymbolsTypes, LocalSymbolsType)
329Q_DECLARE_OPERATORS_FOR_FLAGS(LocalSymbolsTypes)
330
331
399
406
408
409} // end namespace Dom
410} // end namespace QQmlJS
411
413
414#endif // QQMLDOMCONSTANTS_P_H
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.