aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/mockup/qmldesigner/designercore/include/propertymetainfo.h
blob: c1bfa846d797756bea94adab456ef12dbcf315f7 (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
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <qmldesignercorelib_global.h>

#include <QSharedPointer>
#include <QString>

#include <vector>

namespace QmlDesigner {

class PropertyMetaInfo
{
public:
    PropertyMetaInfo() = default;
    PropertyMetaInfo(QSharedPointer<class NodeMetaInfoPrivate>, const PropertyName &) {}
    ~PropertyMetaInfo() {}

    const TypeName &propertyTypeName() const
    {
        static TypeName foo;
        return foo;
    }
    class NodeMetaInfo propertyNodeMetaInfo() const;

    bool isWritable() const { return {}; }
    bool isListProperty() const { return {}; }
    bool isEnumType() const { return {}; }
    bool isPrivate() const { return {}; }
    bool isPointer() const { return {}; }
    QVariant castedValue(const QVariant &) const { return {}; }
    PropertyName name() const & { return {}; }

    template<typename... TypeName>
    bool hasPropertyTypeName(const TypeName &...typeName) const
    {
        auto propertyTypeName_ = propertyTypeName();
        return ((propertyTypeName_ == typeName) && ...);
    }

    bool propertyTypeNameIsUrl() const { return hasPropertyTypeName("QUrl", "url"); }
};

using PropertyMetaInfos = std::vector<PropertyMetaInfo>;

} // namespace QmlDesigner