aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/beautifier/artisticstyle/artisticstyle.h
blob: 710f070e049b27911cb91c0319e09d7e77bfd38a (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
// Copyright (C) 2016 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "../beautifierabstracttool.h"

#include "artisticstyleoptionspage.h"
#include "artisticstylesettings.h"

namespace Beautifier {
namespace Internal {

class ArtisticStyle : public BeautifierAbstractTool
{
    Q_OBJECT

public:
    ArtisticStyle();

    QString id() const override;
    void updateActions(Core::IEditor *editor) override;
    TextEditor::Command command() const override;
    bool isApplicable(const Core::IDocument *document) const override;

private:
    void formatFile();
    QString configurationFile() const;
    TextEditor::Command command(const QString &cfgFile) const;

    QAction *m_formatFile = nullptr;
    ArtisticStyleSettings m_settings;
    ArtisticStyleOptionsPage m_page{&m_settings};
};

} // namespace Internal
} // namespace Beautifier