aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/commands/puppettocreatorcommand.h
blob: 356e7f7c84d79b23eb2f0dfe8036bae12b0893f7 (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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <qmetatype.h>
#include <QDataStream>
#include <QVariant>

namespace QmlDesigner {

class PuppetToCreatorCommand
{
public:
    enum Type {
        Edit3DToolState,
        Render3DView,
        ActiveSceneChanged,
        RenderModelNodePreviewImage,
        Import3DSupport,
        ModelAtPos,
        None };

    PuppetToCreatorCommand(Type type, const QVariant &data);
    PuppetToCreatorCommand() = default;

    Type type() const { return m_type; }
    QVariant data() const { return m_data; }

private:
    Type m_type = None;
    QVariant m_data;

    friend QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);
};

QDataStream &operator<<(QDataStream &out, const PuppetToCreatorCommand &command);
QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);

} // namespace QmlDesigner

Q_DECLARE_METATYPE(QmlDesigner::PuppetToCreatorCommand)