aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/macros/actionmacrohandler.h
blob: f1346ce465358a4dd960e4021890cd70d6e57a2b (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
// 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 "imacrohandler.h"

#include <coreplugin/actionmanager/actionmanager.h>

#include <QSet>

namespace Macros {
namespace Internal {

class ActionMacroHandler : public IMacroHandler
{
    Q_OBJECT

public:
    ActionMacroHandler();

    bool canExecuteEvent(const MacroEvent &macroEvent) override;
    bool executeEvent(const MacroEvent &macroEvent) override;

private:
    void registerCommand(Utils::Id id);
    Core::Command *command(const QString &id);
    void addCommand(Utils::Id id);

private:
    QSet<Utils::Id> m_commandIds;
};

} // namespace Internal
} // namespace Macros