| 1 | // Copyright (C) 2024 Intel Corporation. |
| 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 QTMOCCONSTANTS_H |
| 5 | #define QTMOCCONSTANTS_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 to be used by the code that |
| 12 | // moc generates. This file will not change quickly, but it over the long term, |
| 13 | // it will likely change or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/qflags.h> |
| 19 | #include <QtCore/qtconfigmacros.h> |
| 20 | #include <QtCore/qtypes.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | namespace QtMocConstants { |
| 25 | // revision 7 is Qt 5.0 everything lower is not supported |
| 26 | // revision 8 is Qt 5.12: It adds the enum name to QMetaEnum |
| 27 | // revision 9 is Qt 6.0: It adds the metatype of properties and methods |
| 28 | // revision 10 is Qt 6.2: The metatype of the metaobject is stored in the metatypes array |
| 29 | // and metamethods store a flag stating whether they are const |
| 30 | // revision 11 is Qt 6.5: The metatype for void is stored in the metatypes array |
| 31 | // revision 12 is Qt 6.6: It adds the metatype for enums |
| 32 | // revision 13 is Qt 6.9: Adds support for 64-bit QFlags and moves the method revision |
| 33 | enum { OutputRevision = 13 }; // Used by moc, qmetaobjectbuilder and qdbus |
| 34 | |
| 35 | enum PropertyFlags : uint { |
| 36 | Invalid = 0x00000000, |
| 37 | Readable = 0x00000001, |
| 38 | Writable = 0x00000002, |
| 39 | Resettable = 0x00000004, |
| 40 | EnumOrFlag = 0x00000008, |
| 41 | Alias = 0x00000010, |
| 42 | // Reserved for future usage = 0x00000020, |
| 43 | StdCppSet = 0x00000100, |
| 44 | Constant = 0x00000400, |
| 45 | Final = 0x00000800, |
| 46 | Designable = 0x00001000, |
| 47 | Scriptable = 0x00004000, |
| 48 | Stored = 0x00010000, |
| 49 | User = 0x00100000, |
| 50 | Required = 0x01000000, |
| 51 | Bindable = 0x02000000, |
| 52 | }; |
| 53 | inline constexpr PropertyFlags DefaultPropertyFlags { Readable | Designable | Scriptable | Stored }; |
| 54 | |
| 55 | enum MethodFlags : uint { |
| 56 | AccessPrivate = 0x00, |
| 57 | AccessProtected = 0x01, |
| 58 | AccessPublic = 0x02, |
| 59 | AccessMask = 0x03, // mask |
| 60 | |
| 61 | MethodMethod = 0x00, |
| 62 | MethodSignal = 0x04, |
| 63 | MethodSlot = 0x08, |
| 64 | MethodConstructor = 0x0c, |
| 65 | MethodTypeMask = 0x0c, |
| 66 | |
| 67 | MethodCompatibility = 0x10, |
| 68 | MethodCloned = 0x20, |
| 69 | MethodScriptable = 0x40, |
| 70 | MethodRevisioned = 0x80, |
| 71 | |
| 72 | MethodIsConst = 0x100, // no use case for volatile so far |
| 73 | }; |
| 74 | |
| 75 | enum MetaObjectFlag : uint { |
| 76 | DynamicMetaObject = 0x01, // is derived from QAbstractDynamicMetaObject |
| 77 | RequiresVariantMetaObject = 0x02, |
| 78 | PropertyAccessInStaticMetaCall = 0x04, // since Qt 5.5, property code is in the static metacall |
| 79 | AllocatedMetaObject = 0x08, // meta object was allocated in dynamic memory (and may be freed) |
| 80 | }; |
| 81 | |
| 82 | enum MetaDataFlags : uint { |
| 83 | IsUnresolvedType = 0x80000000, |
| 84 | TypeNameIndexMask = 0x7FFFFFFF, |
| 85 | IsUnresolvedSignal = 0x70000000, |
| 86 | }; |
| 87 | |
| 88 | enum EnumFlags : uint { |
| 89 | EnumIsFlag = 0x1, |
| 90 | EnumIsScoped = 0x2, |
| 91 | EnumIs64Bit = 0x40, |
| 92 | }; |
| 93 | |
| 94 | } // namespace QtMocConstants |
| 95 | |
| 96 | QT_END_NAMESPACE |
| 97 | |
| 98 | #endif // QTMOCCONSTANTS_H |
| 99 | |