1 | // Copyright (C) 2023 basysKom GmbH, opensource@basyskom.com |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #pragma once |
5 | |
6 | #include "xmlelement.h" |
7 | |
8 | #include <QtCore/qlist.h> |
9 | |
10 | class Field; |
11 | |
12 | class StructuredType : public XmlElement |
13 | { |
14 | public: |
15 | StructuredType(const QString &name, const QString &baseType); |
16 | ~StructuredType(); |
17 | |
18 | QString baseType() const; |
19 | void setBaseType(const QString &baseType); |
20 | |
21 | void addField(Field *field); |
22 | |
23 | void print() const override; |
24 | void accept(Visitor *visitor) override; |
25 | |
26 | QList<Field *> fields() const; |
27 | void setFields(const QList<Field *> &fields); |
28 | |
29 | bool containsBitMask() const; |
30 | void setContainsBitMask(bool containsBitMask); |
31 | |
32 | bool isBuiltInType() const; |
33 | void setIsBuiltInType(bool isBuiltInType); |
34 | |
35 | bool hasSwitchfield() const; |
36 | void setHasSwitchfield(bool hasSwitchfield); |
37 | |
38 | bool hasUnion() const; |
39 | void setHasUnion(bool hasUnion); |
40 | |
41 | QString targetNamespace() const; |
42 | void setTargetNamespace(const QString &targetNamespace); |
43 | |
44 | bool recursive() const; |
45 | void setRecursive(bool recursive); |
46 | |
47 | private: |
48 | bool m_containsBitMask{false}; |
49 | bool m_isBuiltInType{false}; |
50 | bool m_hasSwitchfield{false}; |
51 | bool m_hasUnion{false}; |
52 | bool m_recursive{false}; |
53 | QString m_baseType; |
54 | QString m_targetNamespace; |
55 | QList<Field *> m_fields; |
56 | }; |
57 |