summaryrefslogtreecommitdiff
path: root/src/plugins/beautifier/beautifierabstracttool.h
blob: 00454b60de82bff3f17b318283896370fd97e6fb (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 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <texteditor/command.h>

#include <QObject>

namespace Core {
class IDocument;
class IEditor;
}

namespace Beautifier::Internal  {

class BeautifierAbstractTool : public QObject
{
public:
    BeautifierAbstractTool() = default;

    virtual QString id() const = 0;
    virtual void updateActions(Core::IEditor *editor) = 0;

    /**
     * Returns the tool's command to format an entire file.
     *
     * @note    The received command may be invalid.
     */
    virtual TextEditor::Command command() const = 0;

    virtual bool isApplicable(const Core::IDocument *document) const = 0;
};

} // Beautifier::Internal