aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetaargument.h
blob: 38402e3699f0cac733934b4c80973549f7b35e3b (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
// 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 ABSTRACTMETAARGUMENT_H
#define ABSTRACTMETAARGUMENT_H

#include <QtCore/QSharedDataPointer>

QT_FORWARD_DECLARE_CLASS(QDebug)

class AbstractMetaType;
class AbstractMetaArgumentData;
class Documentation;

class AbstractMetaArgument
{
public:
    AbstractMetaArgument();
    ~AbstractMetaArgument();
    AbstractMetaArgument(const AbstractMetaArgument &);
    AbstractMetaArgument &operator=(const AbstractMetaArgument &);
    AbstractMetaArgument(AbstractMetaArgument &&) noexcept;
    AbstractMetaArgument &operator=(AbstractMetaArgument &&) noexcept;

    const AbstractMetaType &type() const;
    void setType(const AbstractMetaType &type);
    void setModifiedType(const AbstractMetaType &type);
    const AbstractMetaType &modifiedType() const;
    bool isTypeModified() const;

    bool isModifiedRemoved() const;
    void setModifiedRemoved(bool v);

    QString name() const;
    void setName(const QString &name, bool realName = true);
    bool hasName() const;

    void setDocumentation(const Documentation& doc);
    Documentation documentation() const;

    QString defaultValueExpression() const;
    void setDefaultValueExpression(const QString &expr);

    QString originalDefaultValueExpression() const;
    void setOriginalDefaultValueExpression(const QString &expr);

    bool hasDefaultValueExpression() const;
    bool hasOriginalDefaultValueExpression() const;
    bool hasUnmodifiedDefaultValueExpression() const;
    bool hasModifiedDefaultValueExpression() const;

    QString toString() const;

    int argumentIndex() const;
    void setArgumentIndex(int argIndex);

private:
    QSharedDataPointer<AbstractMetaArgumentData> d;
};

#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const AbstractMetaArgument &aa);
QDebug operator<<(QDebug d, const AbstractMetaArgument *aa);
#endif

#endif // ABSTRACTMETAARGUMENT_H