1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef STYLEJSONFILE_H |
6 | #define STYLEJSONFILE_H |
7 | |
8 | #include <QObject> |
9 | #include <QHash> |
10 | #include <QString> |
11 | #include <QDebug> |
12 | |
13 | #include "common/common.h" |
14 | |
15 | /*! |
16 | * \brief The StyleJsonFile class |
17 | * 该类线程安全 |
18 | */ |
19 | class TextEdit; |
20 | class StyleJsonFilePrivate; |
21 | class StyleJsonFile : public QObject |
22 | { |
23 | Q_OBJECT |
24 | StyleJsonFilePrivate *const d; |
25 | public: |
26 | enum_def(Theme, QString) |
27 | { |
28 | enum_exp Dark = "Dark" ; |
29 | }; |
30 | |
31 | enum_def(Key_1, QString) |
32 | { |
33 | enum_exp Self = "Self" ; |
34 | enum_exp Namespace = "Namespace" ; |
35 | enum_exp Macro = "Macro" ; |
36 | enum_exp Type = "Type" ; |
37 | enum_exp Class = "Class" ; |
38 | enum_exp Variable = "Variable" ; |
39 | enum_exp Property = "Property" ; |
40 | enum_exp Text = "Text" ; |
41 | enum_exp Link = "Link" ; |
42 | enum_exp Selection = "Selection" ; |
43 | enum_exp LineNumber = "Line Number" ; |
44 | enum_exp Keyword = "Keyword" ; |
45 | enum_exp Punctuation = "Punctuation" ; |
46 | enum_exp Operators = "Operators" ; |
47 | enum_exp OverloadedOperators = "Overloaded Operators" ; |
48 | enum_exp Preprocessor = "Preprocessor" ; |
49 | enum_exp SearchResult = "Search Result" ; |
50 | enum_exp SearchScope = "Search Scope" ; |
51 | enum_exp Parentheses = "Parentheses" ; |
52 | enum_exp MismatchedParentheses = "Mismatched Parentheses" ; |
53 | enum_exp AutoComplete = "Auto Complete" ; |
54 | enum_exp CurrentLine = "Current Line" ; |
55 | enum_exp CurrentLineNumber = "Current Line Number" ; |
56 | enum_exp Occurrences = "Occurrences" ; |
57 | enum_exp UnusedOccurrences = "Unused Occurrences" ; |
58 | enum_exp RenamingOccurrences = "Renaming Occurrences" ; |
59 | enum_exp Number = "Number" ; |
60 | enum_exp String = "String" ; |
61 | enum_exp PrimitiveType = "Primitive Type" ; |
62 | enum_exp Local = "Local" ; |
63 | enum_exp Field = "Field" ; |
64 | enum_exp Global = "Global" ; |
65 | enum_exp Enumeration = "Enumeration" ; |
66 | enum_exp Function = "Function" ; |
67 | enum_exp FunctionDeclaration = "Function Declaration" ; |
68 | enum_exp FunctionDefinition = "Function Definition" ; |
69 | enum_exp VirtualFunction = "Virtual Function" ; |
70 | enum_exp = "Comment" ; |
71 | enum_exp Error = "Error" ; |
72 | enum_exp ErrorContext = "Error Context" ; |
73 | enum_exp Warning = "Warning" ; |
74 | enum_exp WarningContext = "Warning Context" ; |
75 | enum_exp Method = "Method" ; |
76 | enum_exp Parameter = "Parameter" ; |
77 | enum_exp Member = "Member" ; |
78 | }; |
79 | |
80 | enum_def(Key_2, QString) |
81 | { |
82 | enum_exp Background = "Background" ; |
83 | enum_exp Foreground = "Foreground" ; |
84 | enum_exp Cursor = "Cursor" ; |
85 | enum_exp FontSize = "FontSize" ; |
86 | enum_exp UnderLine = "UnderLine" ; |
87 | }; |
88 | |
89 | enum_def(Key_3, QString) |
90 | { |
91 | enum_exp Color = "Color" ; |
92 | enum_exp Style = "Style" ; |
93 | }; |
94 | |
95 | StyleJsonFile(TextEdit *edit); |
96 | TextEdit *edit(); |
97 | virtual ~StyleJsonFile(); |
98 | bool setLanguage(const QString &languageID); |
99 | QStringList themes() const; |
100 | bool setTheme(const QString &theme); |
101 | QJsonValue value(const QString &Key) const; |
102 | }; |
103 | |
104 | #endif // STYLEJSONFILE_H |
105 | |