diff options
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetaenum.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetaenum.h | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetaenum.h b/sources/shiboken6/ApiExtractor/abstractmetaenum.h index 2cf949f15..03d7a3082 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetaenum.h +++ b/sources/shiboken6/ApiExtractor/abstractmetaenum.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt for Python. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef ABSTRACTMETAENUM_H #define ABSTRACTMETAENUM_H @@ -32,6 +7,7 @@ #include "abstractmetalang_typedefs.h" #include "enclosingclassmixin.h" #include "parser/codemodel_enums.h" +#include "typesystem_typedefs.h" #include <QtCore/QSharedDataPointer> #include <QtCore/QString> @@ -52,8 +28,8 @@ public: AbstractMetaEnumValue(); AbstractMetaEnumValue(const AbstractMetaEnumValue &); AbstractMetaEnumValue &operator=(const AbstractMetaEnumValue &); - AbstractMetaEnumValue(AbstractMetaEnumValue &&); - AbstractMetaEnumValue &operator=(AbstractMetaEnumValue &&); + AbstractMetaEnumValue(AbstractMetaEnumValue &&) noexcept; + AbstractMetaEnumValue &operator=(AbstractMetaEnumValue &&) noexcept; ~AbstractMetaEnumValue(); EnumValue value() const; @@ -65,9 +41,14 @@ public: QString name() const; void setName(const QString &name); + bool isDeprecated() const; + void setDeprecated(bool deprecated); + Documentation documentation() const; void setDocumentation(const Documentation& doc); + int usedBits() const; + private: QSharedDataPointer<AbstractMetaEnumValueData> d; }; @@ -78,11 +59,12 @@ public: AbstractMetaEnum(); AbstractMetaEnum(const AbstractMetaEnum &); AbstractMetaEnum &operator=(const AbstractMetaEnum &); - AbstractMetaEnum(AbstractMetaEnum &&); - AbstractMetaEnum &operator=(AbstractMetaEnum &&); + AbstractMetaEnum(AbstractMetaEnum &&) noexcept; + AbstractMetaEnum &operator=(AbstractMetaEnum &&) noexcept; ~AbstractMetaEnum(); const AbstractMetaEnumValueList &values() const; + AbstractMetaEnumValueList nonRejectedValues() const; void addEnumValue(const AbstractMetaEnumValue &enumValue); std::optional<AbstractMetaEnumValue> findEnumValue(QStringView value) const; @@ -95,6 +77,11 @@ public: bool isPrivate() const { return access() == Access::Private; } bool isProtected() const { return access() == Access::Protected; } + bool isDeprecated() const; + void setDeprecated(bool deprecated); + bool hasDeprecatedValues() const; + AbstractMetaEnumValueList deprecatedValues() const; + const Documentation &documentation() const; void setDocumentation(const Documentation& doc); @@ -113,12 +100,18 @@ public: bool hasQEnumsDeclaration() const; void setHasQEnumsDeclaration(bool on); - EnumTypeEntry *typeEntry() const; - void setTypeEntry(EnumTypeEntry *entry); + EnumTypeEntryCPtr typeEntry() const; + void setTypeEntry(const EnumTypeEntryCPtr &entry); bool isSigned() const; void setSigned(bool s); + QString underlyingType() const; + void setUnderlyingType(const QString &underlyingType); + + static QString intTypeForSize(int usedBits, bool isSigned); + int usedBits() const; + private: QSharedDataPointer<AbstractMetaEnumData> d; }; |