2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
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
|
2011-07-06 10:38:53 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-02-03 15:48:14 +01:00
|
|
|
|
|
|
|
|
#include "texteditor_global.h"
|
|
|
|
|
|
2019-01-16 09:37:54 +01:00
|
|
|
#include "indenter.h"
|
|
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
#include <utils/id.h>
|
2020-06-17 09:14:47 +02:00
|
|
|
|
2019-01-22 14:16:30 +01:00
|
|
|
#include <QWidget>
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2022-03-17 12:01:17 +01:00
|
|
|
namespace ProjectExplorer { class Project; }
|
|
|
|
|
|
2011-02-03 15:48:14 +01:00
|
|
|
namespace TextEditor {
|
|
|
|
|
|
2011-08-16 10:45:23 +02:00
|
|
|
class ICodeStylePreferences;
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2019-01-22 14:16:30 +01:00
|
|
|
class TEXTEDITOR_EXPORT CodeStyleEditorWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
CodeStyleEditorWidget(QWidget *parent = nullptr)
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
{}
|
|
|
|
|
virtual void apply() {}
|
2022-08-01 17:28:42 +02:00
|
|
|
virtual void finish() {}
|
2019-01-22 14:16:30 +01:00
|
|
|
};
|
|
|
|
|
|
2020-01-28 17:34:35 +01:00
|
|
|
class TEXTEDITOR_EXPORT ICodeStylePreferencesFactory
|
2011-02-03 15:48:14 +01:00
|
|
|
{
|
2020-01-28 17:34:35 +01:00
|
|
|
ICodeStylePreferencesFactory(const ICodeStylePreferencesFactory &) = delete;
|
|
|
|
|
ICodeStylePreferencesFactory &operator=(const ICodeStylePreferencesFactory &) = delete;
|
|
|
|
|
|
2011-02-03 15:48:14 +01:00
|
|
|
public:
|
2020-01-28 17:34:35 +01:00
|
|
|
ICodeStylePreferencesFactory();
|
2020-01-29 09:22:33 +01:00
|
|
|
virtual ~ICodeStylePreferencesFactory() = default;
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2019-01-22 14:16:30 +01:00
|
|
|
virtual CodeStyleEditorWidget *createCodeStyleEditor(ICodeStylePreferences *codeStyle,
|
2022-03-17 12:01:17 +01:00
|
|
|
ProjectExplorer::Project *project = nullptr,
|
2019-01-22 14:16:30 +01:00
|
|
|
QWidget *parent = nullptr);
|
2023-04-04 14:28:27 +02:00
|
|
|
virtual CodeStyleEditorWidget *createAdditionalGlobalSettings(ICodeStylePreferences *codeStyle,
|
|
|
|
|
ProjectExplorer::Project *project
|
|
|
|
|
= nullptr,
|
|
|
|
|
QWidget *parent = nullptr);
|
2020-06-26 13:59:38 +02:00
|
|
|
virtual Utils::Id languageId() = 0;
|
2011-02-03 15:48:14 +01:00
|
|
|
virtual QString displayName() = 0;
|
2011-08-16 10:45:23 +02:00
|
|
|
virtual ICodeStylePreferences *createCodeStyle() const = 0;
|
2022-05-10 12:13:36 +02:00
|
|
|
virtual CodeStyleEditorWidget *createEditor(ICodeStylePreferences *preferences,
|
|
|
|
|
ProjectExplorer::Project *project = nullptr,
|
|
|
|
|
QWidget *parent = nullptr) const = 0;
|
2019-01-16 09:37:54 +01:00
|
|
|
virtual TextEditor::Indenter *createIndenter(QTextDocument *doc) const = 0;
|
2018-02-06 15:59:05 +01:00
|
|
|
virtual QString snippetProviderGroupId() const = 0;
|
2011-08-16 10:45:23 +02:00
|
|
|
virtual QString previewText() const = 0;
|
2011-02-03 15:48:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace TextEditor
|