aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectcommentssettings.h
blob: 850078d7b7f507a56c081dfd50f93ada9c63f22b (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <texteditor/commentssettings.h>

namespace ProjectExplorer {
class Project;

namespace Internal {

class ProjectCommentsSettings
{
public:
    // Passing a null ptr is allowed and yields the global settings, so you can use
    // this class transparently for both cases.
    ProjectCommentsSettings(Project *project);

    TextEditor::CommentsSettings::Data settings() const;
    void setSettings(const TextEditor::CommentsSettings::Data &settings);
    bool useGlobalSettings() const { return m_useGlobalSettings; }
    void setUseGlobalSettings(bool useGlobal);

private:
    void loadSettings();
    void saveSettings();

    ProjectExplorer::Project * const m_project;
    TextEditor::CommentsSettings::Data m_customSettings;
    bool m_useGlobalSettings = true;
};

void setupCommentsSettingsProjectPanel();

} // namespace Internal
} // namespace ProjectExplorer