aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljstools/qmlformatsettings.h
blob: 3ecb021620cced2d23850b14293c218f4797fd03 (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
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "qmljstools_global.h"

#include <utils/filepath.h>

#include <QVersionNumber>

namespace QmlJSTools {

class QmlFormatProcess;

class QMLJSTOOLS_EXPORT QmlFormatSettings : public QObject
{
    Q_OBJECT

public:
    Utils::FilePath latestQmlFormatPath() const;
    QVersionNumber latestQmlFormatVersion() const;
    void evaluateLatestQmlFormat();

    static QmlFormatSettings &instance();
    static Utils::FilePath currentQmlFormatIniFile(const Utils::FilePath &path);
    static Utils::FilePath globalQmlFormatIniFile();

signals:
    void qmlformatIniCreated(Utils::FilePath iniFile);

private:
    QmlFormatSettings();
    ~QmlFormatSettings();

    void generateQmlFormatIniContent();

    Utils::FilePath m_latestQmlFormat;
    QVersionNumber m_latestVersion;
};

} // namespace QmlJSTools