aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h
blob: 9621202cc1862f184e66e862e8739cd05e74356e (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
// Copyright (C) 2016 Tim Sander <tim@krieglstein.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <projectexplorer/buildstep.h>

#include <QPlainTextEdit>
#include <QVariantMap>

namespace BareMetal {
namespace Internal {

// BareMetalGdbCommandsDeployStep

class BareMetalGdbCommandsDeployStep final : public ProjectExplorer::BuildStep
{
    Q_OBJECT

public:
    explicit BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl);

    bool fromMap(const QVariantMap &map) final;
    QVariantMap toMap() const final;

    ProjectExplorer::BuildStepConfigWidget *createConfigWidget() final;

    static Core::Id stepId();
    static QString displayName();

    void updateGdbCommands(const QString &newCommands);
    QString gdbCommands() const;

private:
    bool init() final;
    void doRun() final;

    QString m_gdbCommands;
};

// BareMetalGdbCommandsDeployStepWidget

class BareMetalGdbCommandsDeployStepWidget final
        : public ProjectExplorer::BuildStepConfigWidget
{
    Q_OBJECT

public:
    explicit BareMetalGdbCommandsDeployStepWidget(BareMetalGdbCommandsDeployStep &step);
    void update();

private:
    QString displayName() const;
    QString summaryText() const;

    BareMetalGdbCommandsDeployStep &m_step;
    QPlainTextEdit *m_commands = nullptr;
};

} // namespace Internal
} // namespace BareMetal