aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljstools/qmljscodestylesettingspage.h
blob: 5defa7e89bb983ed1ceb727e613466a13695c0f8 (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
43
44
45
46
47
48
49
50
51
52
53
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "qmljscodestylesettings.h"

#include <coreplugin/dialogs/ioptionspage.h>
#include <texteditor/icodestylepreferencesfactory.h>

namespace TextEditor {
    class FontSettings;
    class SimpleCodeStylePreferencesWidget;
    class SnippetEditorWidget;
}

namespace QmlJSTools {
class QmlJSCodeStylePreferencesWidget;
class QmlJSCodeStyleSettings;

namespace Internal {

class QmlJSCodeStylePreferencesWidget : public TextEditor::CodeStyleEditorWidget
{
    Q_OBJECT

public:
    explicit QmlJSCodeStylePreferencesWidget(const TextEditor::ICodeStylePreferencesFactory *factory,
                                             QWidget *parent = nullptr);

    void setPreferences(QmlJSCodeStylePreferences* preferences);

private:
    void decorateEditor(const TextEditor::FontSettings &fontSettings);
    void setVisualizeWhitespace(bool on);
    void slotSettingsChanged();
    void updatePreview();

    QmlJSCodeStylePreferences *m_preferences = nullptr;
    TextEditor::SimpleCodeStylePreferencesWidget *m_tabPreferencesWidget;
    QmlJSTools::QmlJSCodeStylePreferencesWidget *m_codeStylePreferencesWidget;
    TextEditor::SnippetEditorWidget *m_previewTextEdit;
};


class QmlJSCodeStyleSettingsPage : public Core::IOptionsPage
{
public:
    QmlJSCodeStyleSettingsPage();
};

} // namespace Internal
} // namespace QmlJSTools