aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldom/qqmldomconstants_p.h
blob: bf552c6db1bf63957cbd8ad5286aef5efc0af7be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**/
#ifndef QQMLDOMCONSTANTS_P_H
#define QQMLDOMCONSTANTS_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include "qqmldom_global.h"

#include <QtCore/QObject>
#include <QtCore/QMetaObject>
#include <QtCore/private/qglobal_p.h>

QT_BEGIN_NAMESPACE

namespace QQmlJS{
namespace Dom {

Q_NAMESPACE_EXPORT(QMLDOM_EXPORT)

enum class PathRoot {
    Other,
    Modules,
    Cpp,
    Libs,
    Top,
    Env,
    Universe
};
Q_ENUM_NS(PathRoot)

enum class PathCurrent {
    Other,
    Obj,
    ObjChain,
    ScopeChain,
    Component,
    Module,
    Ids,
    Types,
    LookupStrict,
    LookupDynamic,
    Lookup
};
Q_ENUM_NS(PathCurrent)

enum class Language { QmlQuick1, QmlQuick2, QmlQuick3, QmlCompiled, QmlAnnotation, Qbs };
Q_ENUM_NS(Language)

enum class ResolveOption{
    None=0,
    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)
};
Q_ENUM_NS(ResolveOption)
Q_DECLARE_FLAGS(ResolveOptions, ResolveOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(ResolveOptions)

enum class VisitOption {
    None = 0,
    VisitSelf = 0x1, // Visit the start item
    VisitAdopted = 0x2, // Visit adopted types (but never recurses them)
    Recurse = 0x4, // recurse non adopted types
    NoPath = 0x8, // does not generate path consistent with visit
    Default = VisitOption::VisitSelf | VisitOption::VisitAdopted | VisitOption::Recurse
};
Q_ENUM_NS(VisitOption)
Q_DECLARE_FLAGS(VisitOptions, VisitOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(VisitOptions)

enum class LookupOption {
    Normal = 0,
    Strict = 0x1,
    VisitTopClassType = 0x2, // static lookup of class (singleton) or attached type, the default is
                             // visiting instance methods
    SkipFirstScope = 0x4
};
Q_ENUM_NS(LookupOption)
Q_DECLARE_FLAGS(LookupOptions, LookupOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(LookupOptions)

enum class LookupType { PropertyDef, Binding, Property, Method, Type, CppType, Symbol };
Q_ENUM_NS(LookupType)

enum class VisitPrototypesOption {
    Normal = 0,
    SkipFirst = 0x1,
    RevisitWarn = 0x2,
    ManualProceedToScope = 0x4
};
Q_ENUM_NS(VisitPrototypesOption)
Q_DECLARE_FLAGS(VisitPrototypesOptions, VisitPrototypesOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(VisitPrototypesOptions)

enum class DomKind {
    Empty,
    Object,
    List,
    Map,
    Value
};
Q_ENUM_NS(DomKind)

enum class DomType {
    Empty,

    ExternalItemInfo,
    ExternalItemPair,
    // ExternalOwningItems refer to an external path and can be shared between environments
    QmlDirectory, // dir
    QmldirFile, // qmldir
    JsFile, // file
    QmlFile, // file
    QmltypesFile, // qmltypes
    GlobalScope, // language dependent
    EnumItem,

    // types
    EnumDecl,
    JsResource,
    QmltypesComponent,
    QmlComponent,
    GlobalComponent,

    ModuleAutoExport, // dependent imports to automatically load when a module is imported
    ModuleIndex, // index for all the imports of a major version
    ModuleScope, // a specific import with full version
    ImportScope, // the scope including the types coming from one or more imports
    Export, // An exported type

    // header stuff
    Import, // wrapped
    Pragma,

    // qml elements
    Id,
    QmlObject,
    ConstantData,
    SimpleObjectWrap,
    ScriptExpression,
    Reference,
    PropertyDefinition,
    Binding,
    MethodParameter,
    MethodInfo,
    Version, // wrapped
    Comment,
    CommentedElement,
    RegionComments,
    AstComments,
    FileLocations,
    UpdatedScriptExpression,

    // convenience collecting types
    PropertyInfo,

    // Moc objects, mainly for testing
    MockObject,
    MockOwner,

    // containers
    Map,
    List,
    ListP,

    // supporting objects
    LoadInfo, // owning
    ErrorMessage, // wrapped
    AttachedInfo, // owning

    // Dom top level
    DomEnvironment,
    DomUniverse
};
Q_ENUM_NS(DomType)

enum class SimpleWrapOption { None = 0, ValueType = 1 };
Q_ENUM_NS(SimpleWrapOption)
Q_DECLARE_FLAGS(SimpleWrapOptions, SimpleWrapOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(SimpleWrapOptions)

enum class BindingValueKind { Object, ScriptExpression, Array, Empty };
Q_ENUM_NS(BindingValueKind)

enum class BindingType { Normal, OnBinding };
Q_ENUM_NS(BindingType)

enum class ListOptions {
    Normal,
    Reverse
};
Q_ENUM_NS(ListOptions)

enum class LoadOption {
    DefaultLoad = 0x0,
    ForceLoad = 0x1,
};
Q_ENUM_NS(LoadOption)
Q_DECLARE_FLAGS(LoadOptions, LoadOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(LoadOptions)

enum class EscapeOptions{
    OuterQuotes,
    NoOuterQuotes
};
Q_ENUM_NS(EscapeOptions)

enum class ErrorLevel{
    Debug = QtMsgType::QtDebugMsg,
    Info = QtMsgType::QtInfoMsg,
    Warning = QtMsgType::QtWarningMsg,
    Error = QtMsgType::QtCriticalMsg,
    Fatal = QtMsgType::QtFatalMsg
};
Q_ENUM_NS(ErrorLevel)

enum class AstDumperOption {
    None=0,
    NoLocations=0x1,
    NoAnnotations=0x2,
    DumpNode=0x4,
    SloppyCompare=0x8
};
Q_ENUM_NS(AstDumperOption)
Q_DECLARE_FLAGS(AstDumperOptions, AstDumperOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(AstDumperOptions)

enum class GoTo {
    Strict, // never go to an non uniquely defined result
    MostLikely // if needed go up to the most likely location between multiple options
};
Q_ENUM_NS(GoTo)

enum class AddOption { KeepExisting, Overwrite };
Q_ENUM_NS(AddOption)

enum class FilterUpOptions { ReturnOuter, ReturnOuterNoSelf, ReturnInner };
Q_ENUM_NS(FilterUpOptions)

enum class WriteOutCheck {
    None = 0x0,
    UpdatedDomCompare = 0x1,
    UpdatedDomStable = 0x2,
    Reparse = 0x4,
    ReparseCompare = 0x8,
    ReparseStable = 0x10,
    DumpOnFailure = 0x20,
    All = 0x3F,
    Default = Reparse | ReparseCompare | ReparseStable
};
Q_ENUM_NS(WriteOutCheck)
Q_DECLARE_FLAGS(WriteOutChecks, WriteOutCheck)
Q_DECLARE_OPERATORS_FOR_FLAGS(WriteOutChecks)

enum class LocalSymbolsType {
    None = 0x0,
    QmlTypes = 0x1,
    Types = 0x3,
    Signals = 0x4,
    Methods = 0xC,
    Attributes = 0x10,
    Ids = 0x20,
    Components = 0x40,
    Namespaces = 0x80,
    Globals = 0x100,
    MethodParameters = 0x200,
    All = 0x3FF
};
Q_ENUM_NS(LocalSymbolsType)
Q_DECLARE_FLAGS(LocalSymbolsTypes, LocalSymbolsType)
Q_DECLARE_OPERATORS_FOR_FLAGS(LocalSymbolsTypes)

} // end namespace Dom
} // end namespace QQmlJS

QT_END_NAMESPACE

#endif // QQMLDOMCONSTANTS_P_H