aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/effectcomposer/effectnode.h
blob: 649ef40ab45cccc554a8a32149c8e525e78138e1 (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QObject>
#include <QSet>
#include <QUrl>

namespace EffectComposer {

class EffectNode : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString nodeName MEMBER m_name CONSTANT)
    Q_PROPERTY(QString nodeDescription MEMBER m_description CONSTANT)
    Q_PROPERTY(QUrl nodeIcon MEMBER m_iconPath CONSTANT)
    Q_PROPERTY(QString nodeQenPath MEMBER m_qenPath CONSTANT)
    Q_PROPERTY(bool canBeAdded MEMBER m_canBeAdded NOTIFY canBeAddedChanged)
    Q_PROPERTY(bool canBeRemoved MEMBER m_canBeRemoved CONSTANT)

public:
    EffectNode(const QString &qenPath, bool isBuiltIn);

    QString name() const;
    QString description() const;
    QString qenPath() const;
    QHash<QString, QString> defaultImagesHash() const { return m_defaultImagesHash; }
    bool isCustom() const { return m_isCustom; }

    void setCanBeAdded(bool enabled);

    bool hasUniform(const QString &name);

signals:
    void canBeAddedChanged();

private:
    QString m_name;
    QString m_description;
    QString m_qenPath;
    QUrl m_iconPath;
    bool m_isCustom = false;
    bool m_canBeAdded = true;
    bool m_canBeRemoved = false;
    QSet<QString> m_uniformNames;
    QHash<QString, QString> m_defaultImagesHash;
};

} // namespace EffectComposer