| 1 | // Copyright (C) 2025 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #ifndef QMLENUMNODE_H |
| 5 | #define QMLENUMNODE_H |
| 6 | |
| 7 | #include "aggregate.h" |
| 8 | #include "enumnode.h" |
| 9 | #include "nativeenum.h" |
| 10 | |
| 11 | #include <QtCore/qglobal.h> |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class QmlEnumNode : public EnumNode, public NativeEnumInterface |
| 16 | { |
| 17 | public: |
| 18 | QmlEnumNode(Aggregate *parent, const QString &name) : |
| 19 | EnumNode(NodeType::QmlEnum, parent, name) |
| 20 | { |
| 21 | setGenus(Genus::QML); |
| 22 | // Set the default prefix for enumerators |
| 23 | m_nativeEnum.setPrefix(parent->name()); |
| 24 | } |
| 25 | |
| 26 | NativeEnum *nativeEnum() override { return &m_nativeEnum; } |
| 27 | const NativeEnum *nativeEnum() const override { return &m_nativeEnum; } |
| 28 | |
| 29 | private: |
| 30 | NativeEnum m_nativeEnum; |
| 31 | }; |
| 32 | |
| 33 | QT_END_NAMESPACE |
| 34 | |
| 35 | #endif // QMLENUMNODE_H |
| 36 | |
| 37 |
