Cppcheck
codeeditstyledialog.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2023 Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef CODEEDITSTYLEDIALOG_H
20 #define CODEEDITSTYLEDIALOG_H
21 
22 #include "codeeditorstyle.h"
23 
24 #include <QColor>
25 #include <QDialog>
26 #include <QFont>
27 #include <QObject>
28 #include <QString>
29 
30 class CodeEditor;
31 class SelectColorButton;
33 class QPushButton;
34 class QWidget;
35 
36 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
37 class QStringList;
38 #endif
39 
40 class StyleEditDialog : public QDialog {
41  Q_OBJECT
42 public:
43  explicit StyleEditDialog(const CodeEditorStyle& newStyle,
44  QWidget *parent = nullptr);
45 
47 
48 private:
49  void updateControls();
50  void updateStyle();
51 
52 public slots:
53  void resetStyle();
54  void setStyleDefaultLight();
55  void setStyleDefaultDark();
56  void colorChangedWidgetFG(const QColor& newColor);
57  void colorChangedWidgetBG(const QColor& newColor);
58  void colorChangedHighlightBG(const QColor& newColor);
59  void colorChangedLineNumFG(const QColor& newColor);
60  void colorChangedLineNumBG(const QColor& newColor);
61  void colorChangedKeywordFG(const QColor& newColor);
62  void weightChangedKeyword(QFont::Weight newWeight);
63  void colorChangedClassFG(const QColor& newColor);
64  void weightChangedClass(QFont::Weight newWeight);
65  void colorChangedQuoteFG(const QColor& newColor);
66  void weightChangedQuote(QFont::Weight newWeight);
67  void colorChangedCommentFG(const QColor& newColor);
68  void weightChangedComment(QFont::Weight newWeight);
69  void colorChangedSymbolFG(const QColor& newColor);
70  void colorChangedSymbolBG(const QColor& newColor);
71  void weightChangedSymbol(QFont::Weight newWeight);
72 
73 private:
76 
78 
95 
96  QPushButton *mBtnDefaultLight;
97  QPushButton *mBtnDefaultDark;
98 
99  static const QString mSampleDocument;
100  static const QStringList mErrSymbolsList;
101  static const int mErrLineNum;
102 };
103 
104 #endif //CODEEDITSTYLEDIALOG_H
105 
CodeEditor * mSampleEditor
void colorChangedLineNumFG(const QColor &newColor)
SelectFontWeightCombo * mCBCommentWeight
SelectColorButton * mBtnLineNumBG
void colorChangedCommentFG(const QColor &newColor)
void colorChangedSymbolBG(const QColor &newColor)
static const QStringList mErrSymbolsList
SelectColorButton * mBtnQuoteFG
void colorChangedLineNumBG(const QColor &newColor)
void weightChangedClass(QFont::Weight newWeight)
void weightChangedComment(QFont::Weight newWeight)
QPushButton * mBtnDefaultLight
void colorChangedQuoteFG(const QColor &newColor)
SelectColorButton * mBtnKeywordFG
void weightChangedSymbol(QFont::Weight newWeight)
void colorChangedWidgetFG(const QColor &newColor)
SelectColorButton * mBtnLineNumFG
void colorChangedClassFG(const QColor &newColor)
void weightChangedKeyword(QFont::Weight newWeight)
CodeEditorStyle mStyleOutgoing
SelectColorButton * mBtnClassFG
static const int mErrLineNum
void weightChangedQuote(QFont::Weight newWeight)
SelectFontWeightCombo * mCBClassWeight
SelectColorButton * mBtnSymbolBG
void colorChangedWidgetBG(const QColor &newColor)
StyleEditDialog(const CodeEditorStyle &newStyle, QWidget *parent=nullptr)
SelectColorButton * mBtnSymbolFG
SelectColorButton * mBtnHighlightBG
void colorChangedHighlightBG(const QColor &newColor)
SelectFontWeightCombo * mCBQuoteWeight
SelectFontWeightCombo * mCBKeywordWeight
SelectColorButton * mBtnWidgetColorBG
QPushButton * mBtnDefaultDark
void colorChangedKeywordFG(const QColor &newColor)
SelectColorButton * mBtnCommentFG
SelectFontWeightCombo * mCBSymbolWeight
void colorChangedSymbolFG(const QColor &newColor)
static const QString mSampleDocument
SelectColorButton * mBtnWidgetColorFG
CodeEditorStyle mStyleIncoming
CodeEditorStyle getStyle()