aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/macros/macroevent.h
blob: 85389f5e38de589dabd191262ca5e525b690f7e6 (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
// Copyright (C) 2016 Nicolas Arnaud-Cormos
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/id.h>

#include <QMap>
#include <QVariant>

QT_BEGIN_NAMESPACE
class QDataStream;
QT_END_NAMESPACE

namespace Macros {
namespace Internal {

class MacroEvent
{
public:
    MacroEvent() = default;

    Utils::Id id() const;
    void setId(Utils::Id id);

    QVariant value(quint8 id) const;
    void setValue(quint8 id, const QVariant &value);

    void load(QDataStream &stream);
    void save(QDataStream &stream) const;

private:
    Utils::Id m_id;
    QMap<quint8, QVariant> m_values;
};

} // namespace Internal
} // namespace Macros