2022-11-21 00:10:25 +01:00
|
|
|
// Copyright (C) 2016 Lorenz Haas
|
|
|
|
|
// Copyright (C) 2022 Xavier BESSON
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-11-21 00:10:25 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QList>
|
2022-12-12 14:51:33 +01:00
|
|
|
#include <QObject>
|
2022-11-21 00:10:25 +01:00
|
|
|
#include <QVersionNumber>
|
|
|
|
|
|
|
|
|
|
namespace Core { class IDocument; }
|
2022-12-12 14:51:33 +01:00
|
|
|
namespace Utils { class FilePath; }
|
2022-11-21 00:10:25 +01:00
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class VersionUpdater;
|
|
|
|
|
|
|
|
|
|
class CMakeFormatterSettings : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit CMakeFormatterSettings(QObject* parent = nullptr);
|
|
|
|
|
static CMakeFormatterSettings *instance();
|
|
|
|
|
|
|
|
|
|
void read();
|
|
|
|
|
void save();
|
|
|
|
|
|
|
|
|
|
Utils::FilePath command() const;
|
|
|
|
|
void setCommand(const QString &cmd);
|
|
|
|
|
|
|
|
|
|
bool autoFormatOnSave() const;
|
|
|
|
|
void setAutoFormatOnSave(bool autoFormatOnSave);
|
|
|
|
|
|
2022-12-12 14:51:33 +01:00
|
|
|
QStringList autoFormatMime() const;
|
2022-11-21 00:10:25 +01:00
|
|
|
QString autoFormatMimeAsString() const;
|
2022-12-12 14:51:33 +01:00
|
|
|
void setAutoFormatMime(const QStringList &autoFormatMime);
|
2022-11-21 00:10:25 +01:00
|
|
|
void setAutoFormatMime(const QString &mimeList);
|
|
|
|
|
|
|
|
|
|
bool autoFormatOnlyCurrentProject() const;
|
|
|
|
|
void setAutoFormatOnlyCurrentProject(bool autoFormatOnlyCurrentProject);
|
|
|
|
|
|
|
|
|
|
bool isApplicable(const Core::IDocument *document) const;
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void supportedMimeTypesChanged();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_command;
|
|
|
|
|
|
|
|
|
|
bool m_autoFormatOnSave = false;
|
|
|
|
|
bool m_autoFormatOnlyCurrentProject = true;
|
|
|
|
|
QString m_autoFormatTool;
|
2022-12-12 14:51:33 +01:00
|
|
|
QStringList m_autoFormatMime;
|
2022-11-21 00:10:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|