blob: fd37a8e5b7429923217dbab388a6fd2f7c6e8758 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
// 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 "texteditor_global.h"
#include <coreplugin/dialogs/ioptionspage.h>
namespace ProjectExplorer { class Project; }
namespace TextEditor {
class TEXTEDITOR_EXPORT CommentsSettings
{
public:
enum class CommandPrefix { Auto, At, Backslash };
class Data {
public:
CommandPrefix commandPrefix = CommandPrefix::Auto;
bool enableDoxygen = true;
bool generateBrief = true;
bool leadingAsterisks = true;
};
static Data data() { return instance().m_data; }
static void setData(const Data &data);
static Utils::Key mainSettingsKey();
static Utils::Key enableDoxygenSettingsKey();
static Utils::Key generateBriefSettingsKey();
static Utils::Key leadingAsterisksSettingsKey();
static Utils::Key commandPrefixKey();
private:
CommentsSettings();
static CommentsSettings &instance();
void save() const;
void load();
Data m_data;
};
inline bool operator==(const CommentsSettings::Data &a, const CommentsSettings::Data &b)
{
return a.enableDoxygen == b.enableDoxygen
&& a.commandPrefix == b.commandPrefix
&& a.generateBrief == b.generateBrief
&& a.leadingAsterisks == b.leadingAsterisks;
}
inline bool operator!=(const CommentsSettings::Data &a, const CommentsSettings::Data &b)
{
return !(a == b);
}
class TEXTEDITOR_EXPORT CommentsSettingsWidget final : public Core::IOptionsPageWidget
{
Q_OBJECT
public:
CommentsSettingsWidget(const CommentsSettings::Data &settings);
~CommentsSettingsWidget();
CommentsSettings::Data settingsData() const;
signals:
void settingsChanged();
private:
void apply() override;
void initFromSettings(const CommentsSettings::Data &settings);
class Private;
Private * const d;
};
namespace Internal {
class CommentsSettingsPage : public Core::IOptionsPage
{
public:
CommentsSettingsPage();
};
} // namespace Internal
} // namespace TextEditor
|