Changeset View
Changeset View
Standalone View
Standalone View
src/utils/kateconfig.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | class KConfig; | 48 | class KConfig; | ||
49 | 49 | | |||
50 | class QTextCodec; | 50 | class QTextCodec; | ||
51 | 51 | | |||
52 | /** | 52 | /** | ||
53 | * Base Class for the Kate Config Classes | 53 | * Base Class for the Kate Config Classes | ||
54 | * Current childs are KateDocumentConfig/KateDocumentConfig/KateDocumentConfig | ||||
54 | */ | 55 | */ | ||
55 | class KTEXTEDITOR_EXPORT KateConfig | 56 | class KTEXTEDITOR_EXPORT KateConfig | ||
56 | { | 57 | { | ||
57 | public: | 58 | public: | ||
58 | /** | 59 | /** | ||
59 | * start some config changes | 60 | * Start some config changes. | ||
60 | * this method is needed to init some kind of transaction | 61 | * This method is needed to init some kind of transaction for config changes, | ||
61 | * for config changes, update will only be done once, at | 62 | * update will only be done once, at configEnd() call. | ||
62 | * configEnd() call | | |||
63 | */ | 63 | */ | ||
64 | void configStart(); | 64 | void configStart(); | ||
65 | 65 | | |||
66 | /** | 66 | /** | ||
67 | * end a config change transaction, update the concerned | 67 | * End a config change transaction, update the concerned | ||
68 | * documents/views/renderers | 68 | * KateDocumentConfig/KateDocumentConfig/KateDocumentConfig | ||
69 | */ | 69 | */ | ||
70 | void configEnd(); | 70 | void configEnd(); | ||
71 | 71 | | |||
72 | /** | 72 | /** | ||
73 | * global config? | 73 | * Is this a global config object? | ||
74 | * @return global config object? | 74 | * @return true when this is a global config object | ||
75 | */ | 75 | */ | ||
76 | bool isGlobal() const | 76 | bool isGlobal() const | ||
77 | { | 77 | { | ||
78 | return !m_parent; | 78 | return !m_parent; | ||
79 | } | 79 | } | ||
80 | 80 | | |||
81 | /** | 81 | /** | ||
82 | * All known config keys. | 82 | * All known config keys. | ||
Show All 13 Lines | |||||
96 | QVariant value(const int key) const; | 96 | QVariant value(const int key) const; | ||
97 | 97 | | |||
98 | /** | 98 | /** | ||
99 | * Set a config value. | 99 | * Set a config value. | ||
100 | * Will assert if key is invalid. | 100 | * Will assert if key is invalid. | ||
101 | * Might not alter the value if given value fails validation. | 101 | * Might not alter the value if given value fails validation. | ||
102 | * @param key config key, aka enum from KateConfig* classes | 102 | * @param key config key, aka enum from KateConfig* classes | ||
103 | * @param value value to set | 103 | * @param value value to set | ||
104 | * @return value set? | 104 | * @return true on success | ||
105 | */ | 105 | */ | ||
106 | bool setValue(const int key, const QVariant &value); | 106 | bool setValue(const int key, const QVariant &value); | ||
107 | 107 | | |||
108 | /** | 108 | /** | ||
109 | * Get a config value for the string key. | 109 | * Get a config value for the string key. | ||
110 | * @param key config key, aka commandName from KateConfig* classes | 110 | * @param key config key, aka commandName from KateConfig* classes | ||
111 | * @return value for the wanted key, will return invalid variant if key invalid | 111 | * @return value for the wanted key, will return invalid variant if key is not known | ||
112 | */ | 112 | */ | ||
113 | QVariant value(const QString &key) const; | 113 | QVariant value(const QString &key) const; | ||
114 | 114 | | |||
115 | /** | 115 | /** | ||
116 | * Set a config value. | 116 | * Set a config value. | ||
117 | * Will ignore set if key not valid | 117 | * Will do nothing if key is not known or the given value fails validation. | ||
118 | * Might not alter the value if given value fails validation. | | |||
119 | * @param key config key, aka commandName from KateConfig* classes | 118 | * @param key config key, aka commandName from KateConfig* classes | ||
120 | * @param value value to set | 119 | * @param value value to set | ||
121 | * @return value set? | 120 | * @return true on success | ||
122 | */ | 121 | */ | ||
123 | bool setValue(const QString &key, const QVariant &value); | 122 | bool setValue(const QString &key, const QVariant &value); | ||
124 | 123 | | |||
125 | protected: | 124 | protected: | ||
126 | /** | 125 | /** | ||
127 | * Construct a KateConfig. | 126 | * Construct a KateConfig. | ||
128 | * @param parent parent config object, if any | 127 | * @param parent parent config object, if any | ||
129 | */ | 128 | */ | ||
Show All 40 Lines | 140 | public: | |||
170 | 169 | | |||
171 | /** | 170 | /** | ||
172 | * Command name as used in e.g. ConfigInterface or modeline/command line | 171 | * Command name as used in e.g. ConfigInterface or modeline/command line | ||
173 | * e.g. tab-width | 172 | * e.g. tab-width | ||
174 | */ | 173 | */ | ||
175 | const QString commandName; | 174 | const QString commandName; | ||
176 | 175 | | |||
177 | /** | 176 | /** | ||
178 | * Default value if nothing configured | 177 | * Default value if nothing special was configured | ||
179 | */ | 178 | */ | ||
180 | const QVariant defaultValue; | 179 | const QVariant defaultValue; | ||
181 | 180 | | |||
182 | /** | 181 | /** | ||
183 | * concrete value, per default == defaultValue | 182 | * The concrete value, per default == defaultValue | ||
184 | */ | 183 | */ | ||
185 | QVariant value; | 184 | QVariant value; | ||
186 | 185 | | |||
187 | /** | 186 | /** | ||
188 | * a validator function, only if this returns true we accept a value for the entry | 187 | * An optional validator function, only when these returns true | ||
189 | * is ignored if not set | 188 | * we accept a given new value. | ||
189 | * Is no validator set, we accept any value. | ||||
190 | */ | 190 | */ | ||
191 | std::function<bool(const QVariant &)> validator; | 191 | std::function<bool(const QVariant &)> validator; | ||
192 | }; | 192 | }; | ||
193 | 193 | | |||
194 | /** | 194 | /** | ||
195 | * Read all config entries from given config group | 195 | * Read all config entries from given config group. | ||
196 | * @param config config group to read from | 196 | * @param config config group to read from | ||
197 | */ | 197 | */ | ||
198 | void readConfigEntries(const KConfigGroup &config); | 198 | void readConfigEntries(const KConfigGroup &config); | ||
199 | 199 | | |||
200 | /** | 200 | /** | ||
201 | * Write all config entries to given config group | 201 | * Write all config entries to given config group. | ||
202 | * @param config config group to write to | 202 | * @param config config group to write to | ||
203 | */ | 203 | */ | ||
204 | void writeConfigEntries(KConfigGroup &config) const; | 204 | void writeConfigEntries(KConfigGroup &config) const; | ||
205 | 205 | | |||
206 | /** | 206 | /** | ||
207 | * Register a new config entry. | 207 | * Register a new config entry. | ||
208 | * Used by the sub classes to register all there known ones. | 208 | * Used by the sub classes to register all there known ones. | ||
209 | * @param entry new entry to add | 209 | * @param entry new entry to add | ||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Line(s) | 924 | private: | |||
926 | 926 | | |||
927 | /** | 927 | /** | ||
928 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | 928 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | ||
929 | */ | 929 | */ | ||
930 | KateViewConfig(); | 930 | KateViewConfig(); | ||
931 | 931 | | |||
932 | public: | 932 | public: | ||
933 | /** | 933 | /** | ||
934 | * Construct a DocumentConfig | 934 | * Construct a ViewConfig | ||
935 | */ | 935 | */ | ||
936 | explicit KateViewConfig(KTextEditor::ViewPrivate *view); | 936 | explicit KateViewConfig(KTextEditor::ViewPrivate *view); | ||
937 | 937 | | |||
938 | /** | 938 | /** | ||
939 | * Cu DocumentConfig | 939 | * Cu ViewConfig | ||
940 | */ | 940 | */ | ||
941 | ~KateViewConfig() override; | 941 | ~KateViewConfig() override; | ||
942 | 942 | | |||
943 | inline static KateViewConfig *global() | 943 | inline static KateViewConfig *global() | ||
944 | { | 944 | { | ||
945 | return s_global; | 945 | return s_global; | ||
946 | } | 946 | } | ||
947 | 947 | | |||
948 | /** | ||||
949 | * All known config keys | ||||
950 | * Keep them sorted alphabetic for our convenience | ||||
951 | */ | ||||
952 | enum ConfigEntryTypes { | ||||
953 | BackspaceRemoveComposedCharacters, | ||||
954 | CharsToEncloseSelection, | ||||
955 | DynWordWrapAlignIndent, | ||||
956 | DynWordWrapIndicators, | ||||
957 | DynWrapAtStaticMarker, | ||||
958 | DynamicWordWrap, | ||||
959 | MaxHistorySize, | ||||
960 | ScrollBarMiniMapWidth, | ||||
961 | SearchFlags, | ||||
962 | ShowFoldingBar, | ||||
963 | ShowFoldingPreview, | ||||
964 | ShowIconBar, | ||||
dhaumann: Are training commas allowed meanwhile? | |||||
Yes. It's handy while still on work here, but can remove it when I'm done, if desired. loh.tar: Yes. It's handy while still on work here, but can remove it when I'm done, if desired.
Thanks… | |||||
965 | ShowLineModification, | ||||
966 | ShowLineNumbers, | ||||
967 | ShowScrollBarMarks, | ||||
968 | ShowScrollBarMiniMap, | ||||
969 | ShowScrollBarMiniMapAll, | ||||
970 | ShowScrollBarPreview, | ||||
971 | ShowScrollbars, | ||||
972 | ShowWordCount, | ||||
973 | }; | ||||
974 | | ||||
948 | public: | 975 | public: | ||
949 | /** | 976 | /** | ||
950 | * Read config from object | 977 | * Read config from object | ||
951 | */ | 978 | */ | ||
952 | void readConfig(const KConfigGroup &config); | 979 | void readConfig(const KConfigGroup &config); | ||
953 | 980 | | |||
954 | /** | 981 | /** | ||
955 | * Write config to object | 982 | * Write config to object | ||
956 | */ | 983 | */ | ||
957 | void writeConfig(KConfigGroup &config); | 984 | void writeConfig(KConfigGroup &config); | ||
958 | 985 | | |||
959 | protected: | 986 | protected: | ||
960 | void updateConfig() override; | 987 | void updateConfig() override; | ||
961 | 988 | | |||
962 | public: | 989 | public: | ||
963 | bool dynWordWrapSet() const | 990 | bool dynWordWrap() const | ||
964 | { | 991 | { | ||
965 | return m_dynWordWrapSet; | 992 | return value(DynamicWordWrap).toBool(); | ||
993 | } | ||||
994 | void setDynWordWrap(bool on) | ||||
995 | { | ||||
996 | setValue(DynamicWordWrap, on); | ||||
966 | } | 997 | } | ||
967 | bool dynWordWrap() const; | | |||
968 | void setDynWordWrap(bool wrap); | | |||
969 | 998 | | |||
970 | bool dynWrapAtStaticMarker() const; | 999 | bool dynWrapAtStaticMarker() const | ||
971 | void setDynWrapAtStaticMarker(bool on); | 1000 | { | ||
1001 | return value(DynWrapAtStaticMarker).toBool(); | ||||
1002 | } | ||||
972 | 1003 | | |||
973 | int dynWordWrapIndicators() const; | 1004 | int dynWordWrapIndicators() const | ||
974 | void setDynWordWrapIndicators(int mode); | 1005 | { | ||
1006 | return value(DynWordWrapIndicators).toInt(); | ||||
1007 | } | ||||
975 | 1008 | | |||
976 | int dynWordWrapAlignIndent() const; | 1009 | int dynWordWrapAlignIndent() const | ||
977 | void setDynWordWrapAlignIndent(int indent); | 1010 | { | ||
1011 | return value(DynWordWrapAlignIndent).toInt(); | ||||
1012 | } | ||||
978 | 1013 | | |||
979 | bool lineNumbers() const; | 1014 | bool lineNumbers() const | ||
980 | void setLineNumbers(bool on); | 1015 | { | ||
1016 | return value(ShowLineNumbers).toBool(); | ||||
1017 | } | ||||
981 | 1018 | | |||
982 | bool scrollBarMarks() const; | 1019 | bool scrollBarMarks() const | ||
983 | void setScrollBarMarks(bool on); | 1020 | { | ||
1021 | return value(ShowScrollBarMarks).toBool(); | ||||
1022 | } | ||||
984 | 1023 | | |||
985 | bool scrollBarPreview() const; | 1024 | bool scrollBarPreview() const | ||
986 | void setScrollBarPreview(bool on); | 1025 | { | ||
1026 | return value(ShowScrollBarPreview).toBool(); | ||||
1027 | } | ||||
987 | 1028 | | |||
988 | bool scrollBarMiniMap() const; | 1029 | bool scrollBarMiniMap() const | ||
989 | void setScrollBarMiniMap(bool on); | 1030 | { | ||
1031 | return value(ShowScrollBarMiniMap).toBool(); | ||||
1032 | } | ||||
990 | 1033 | | |||
991 | bool scrollBarMiniMapAll() const; | 1034 | bool scrollBarMiniMapAll() const | ||
992 | void setScrollBarMiniMapAll(bool on); | 1035 | { | ||
1036 | return value(ShowScrollBarMiniMapAll).toBool(); | ||||
1037 | } | ||||
993 | 1038 | | |||
994 | int scrollBarMiniMapWidth() const; | 1039 | int scrollBarMiniMapWidth() const | ||
995 | void setScrollBarMiniMapWidth(int width); | 1040 | { | ||
1041 | return value(ScrollBarMiniMapWidth).toInt(); | ||||
1042 | } | ||||
996 | 1043 | | |||
997 | /* Whether to show scrollbars */ | 1044 | /* Whether to show scrollbars */ | ||
998 | enum ScrollbarMode { | 1045 | enum ScrollbarMode { | ||
999 | AlwaysOn = 0, | 1046 | AlwaysOn = 0, | ||
1000 | ShowWhenNeeded, | 1047 | ShowWhenNeeded, | ||
1001 | AlwaysOff | 1048 | AlwaysOff | ||
1002 | }; | 1049 | }; | ||
1003 | 1050 | | |||
1004 | int showScrollbars() const; | 1051 | int showScrollbars() const | ||
1005 | void setShowScrollbars(int mode); | 1052 | { | ||
1053 | return value(ShowScrollbars).toInt(); | ||||
1054 | } | ||||
1006 | 1055 | | |||
1007 | bool iconBar() const; | 1056 | bool iconBar() const | ||
1008 | void setIconBar(bool on); | 1057 | { | ||
1058 | return value(ShowIconBar).toBool(); | ||||
1059 | } | ||||
1009 | 1060 | | |||
1010 | bool foldingBar() const; | 1061 | bool foldingBar() const | ||
1011 | void setFoldingBar(bool on); | 1062 | { | ||
1063 | return value(ShowFoldingBar).toBool(); | ||||
1064 | } | ||||
1012 | 1065 | | |||
1013 | bool foldingPreview() const; | 1066 | bool foldingPreview() const | ||
1014 | void setFoldingPreview(bool on); | 1067 | { | ||
1068 | return value(ShowFoldingPreview).toBool(); | ||||
1069 | } | ||||
1015 | 1070 | | |||
1016 | bool lineModification() const; | 1071 | bool lineModification() const | ||
1017 | void setLineModification(bool on); | 1072 | { | ||
1073 | return value(ShowLineModification).toBool(); | ||||
1074 | } | ||||
1018 | 1075 | | |||
1019 | int bookmarkSort() const; | 1076 | int bookmarkSort() const; | ||
1020 | void setBookmarkSort(int mode); | 1077 | void setBookmarkSort(int mode); | ||
1021 | 1078 | | |||
1022 | int autoCenterLines() const; | 1079 | int autoCenterLines() const; | ||
1023 | void setAutoCenterLines(int lines); | 1080 | void setAutoCenterLines(int lines); | ||
1024 | 1081 | | |||
1025 | enum SearchFlags { | 1082 | enum SearchFlags { | ||
1026 | IncMatchCase = 1 << 0, | 1083 | IncMatchCase = 1 << 0, | ||
1027 | IncHighlightAll = 1 << 1, | 1084 | IncHighlightAll = 1 << 1, | ||
1028 | IncFromCursor = 1 << 2, | 1085 | IncFromCursor = 1 << 2, | ||
1029 | PowerMatchCase = 1 << 3, | 1086 | PowerMatchCase = 1 << 3, | ||
1030 | PowerHighlightAll = 1 << 4, | 1087 | PowerHighlightAll = 1 << 4, | ||
1031 | PowerFromCursor = 1 << 5, | 1088 | PowerFromCursor = 1 << 5, | ||
1032 | // PowerSelectionOnly = 1 << 6, Better not save to file // Sebastian | 1089 | // PowerSelectionOnly = 1 << 6, Better not save to file // Sebastian | ||
1033 | PowerModePlainText = 1 << 7, | 1090 | PowerModePlainText = 1 << 7, | ||
1034 | PowerModeWholeWords = 1 << 8, | 1091 | PowerModeWholeWords = 1 << 8, | ||
1035 | PowerModeEscapeSequences = 1 << 9, | 1092 | PowerModeEscapeSequences = 1 << 9, | ||
1036 | PowerModeRegularExpression = 1 << 10, | 1093 | PowerModeRegularExpression = 1 << 10, | ||
1037 | PowerUsePlaceholders = 1 << 11 | 1094 | PowerUsePlaceholders = 1 << 11 | ||
1038 | }; | 1095 | }; | ||
1039 | 1096 | | |||
1040 | long searchFlags() const; | 1097 | uint searchFlags() const | ||
1041 | void setSearchFlags(long flags); | 1098 | { | ||
1099 | return value(SearchFlags).toUInt(); | ||||
1100 | } | ||||
1101 | void setSearchFlags(uint flags) | ||||
1102 | { | ||||
1103 | setValue(SearchFlags, flags); | ||||
1104 | } | ||||
1042 | 1105 | | |||
1043 | int maxHistorySize() const; | 1106 | int maxHistorySize() const | ||
1107 | { | ||||
1108 | return value(MaxHistorySize).toInt(); | ||||
1109 | } | ||||
1044 | 1110 | | |||
1045 | uint defaultMarkType() const; | 1111 | uint defaultMarkType() const; | ||
1046 | void setDefaultMarkType(uint type); | 1112 | void setDefaultMarkType(uint type); | ||
1047 | 1113 | | |||
1048 | bool allowMarkMenu() const; | 1114 | bool allowMarkMenu() const; | ||
1049 | void setAllowMarkMenu(bool allow); | 1115 | void setAllowMarkMenu(bool allow); | ||
1050 | 1116 | | |||
1051 | bool persistentSelection() const; | 1117 | bool persistentSelection() const; | ||
Show All 40 Lines | |||||
1092 | void setMousePasteAtCursorPosition(bool on); | 1158 | void setMousePasteAtCursorPosition(bool on); | ||
1093 | 1159 | | |||
1094 | bool scrollPastEnd() const; | 1160 | bool scrollPastEnd() const; | ||
1095 | void setScrollPastEnd(bool on); | 1161 | void setScrollPastEnd(bool on); | ||
1096 | 1162 | | |||
1097 | bool foldFirstLine() const; | 1163 | bool foldFirstLine() const; | ||
1098 | void setFoldFirstLine(bool on); | 1164 | void setFoldFirstLine(bool on); | ||
1099 | 1165 | | |||
1100 | bool showWordCount() const; | 1166 | bool showWordCount() const | ||
1101 | void setShowWordCount(bool on); | 1167 | { | ||
1168 | return value(ShowWordCount).toBool(); | ||||
1169 | } | ||||
1170 | void setShowWordCount(bool on) | ||||
1171 | { | ||||
1172 | setValue(ShowWordCount, on); | ||||
1173 | } | ||||
1102 | 1174 | | |||
1103 | bool showLineCount() const; | 1175 | bool showLineCount() const; | ||
1104 | void setShowLineCount(bool on); | 1176 | void setShowLineCount(bool on); | ||
1105 | 1177 | | |||
1106 | bool autoBrackets() const; | 1178 | bool autoBrackets() const; | ||
1107 | void setAutoBrackets(bool on); | 1179 | void setAutoBrackets(bool on); | ||
1108 | 1180 | | |||
1109 | bool backspaceRemoveComposed() const; | 1181 | bool backspaceRemoveComposed() const | ||
1110 | void setBackspaceRemoveComposed(bool on); | 1182 | { | ||
1183 | return value(BackspaceRemoveComposedCharacters).toBool(); | ||||
1184 | } | ||||
1111 | 1185 | | |||
1112 | private: | 1186 | private: | ||
1113 | bool m_dynWordWrap; | | |||
1114 | bool m_dynWrapAtStaticMarker; | | |||
1115 | int m_dynWordWrapIndicators; | | |||
1116 | int m_dynWordWrapAlignIndent; | | |||
1117 | bool m_lineNumbers; | | |||
1118 | bool m_scrollBarMarks; | | |||
1119 | bool m_scrollBarPreview; | | |||
1120 | bool m_scrollBarMiniMap; | | |||
1121 | bool m_scrollBarMiniMapAll; | | |||
1122 | int m_scrollBarMiniMapWidth; | | |||
1123 | int m_showScrollbars; | | |||
1124 | bool m_iconBar; | | |||
1125 | bool m_foldingBar; | | |||
1126 | bool m_foldingPreview; | | |||
1127 | bool m_lineModification; | | |||
1128 | int m_bookmarkSort; | 1187 | int m_bookmarkSort; | ||
1129 | int m_autoCenterLines; | 1188 | int m_autoCenterLines; | ||
1130 | long m_searchFlags; | | |||
1131 | int m_maxHistorySize; | | |||
1132 | uint m_defaultMarkType; | 1189 | uint m_defaultMarkType; | ||
1133 | bool m_persistentSelection; | 1190 | bool m_persistentSelection; | ||
1134 | KTextEditor::View::InputMode m_inputMode; | 1191 | KTextEditor::View::InputMode m_inputMode; | ||
1135 | bool m_viInputModeStealKeys; | 1192 | bool m_viInputModeStealKeys; | ||
1136 | bool m_viRelativeLineNumbers; | 1193 | bool m_viRelativeLineNumbers; | ||
1137 | bool m_automaticCompletionInvocation; | 1194 | bool m_automaticCompletionInvocation; | ||
1138 | bool m_wordCompletion; | 1195 | bool m_wordCompletion; | ||
1139 | bool m_keywordCompletion; | 1196 | bool m_keywordCompletion; | ||
1140 | int m_wordCompletionMinimalWordLength; | 1197 | int m_wordCompletionMinimalWordLength; | ||
1141 | bool m_wordCompletionRemoveTail; | 1198 | bool m_wordCompletionRemoveTail; | ||
1142 | bool m_smartCopyCut; | 1199 | bool m_smartCopyCut; | ||
1143 | bool m_mousePasteAtCursorPosition = false; | 1200 | bool m_mousePasteAtCursorPosition = false; | ||
1144 | bool m_scrollPastEnd; | 1201 | bool m_scrollPastEnd; | ||
1145 | bool m_foldFirstLine; | 1202 | bool m_foldFirstLine; | ||
1146 | bool m_showWordCount = false; | | |||
1147 | bool m_showLineCount = false; | 1203 | bool m_showLineCount = false; | ||
1148 | bool m_autoBrackets; | 1204 | bool m_autoBrackets; | ||
1149 | bool m_backspaceRemoveComposed; | 1205 | bool m_backspaceRemoveComposed; | ||
1150 | 1206 | | |||
1151 | bool m_dynWordWrapSet : 1; | | |||
1152 | bool m_dynWrapAtStaticMarkerSet : 1; | | |||
1153 | bool m_dynWordWrapIndicatorsSet : 1; | | |||
1154 | bool m_dynWordWrapAlignIndentSet : 1; | | |||
1155 | bool m_lineNumbersSet : 1; | | |||
1156 | bool m_scrollBarMarksSet : 1; | | |||
1157 | bool m_scrollBarPreviewSet : 1; | | |||
1158 | bool m_scrollBarMiniMapSet : 1; | | |||
1159 | bool m_scrollBarMiniMapAllSet : 1; | | |||
1160 | bool m_scrollBarMiniMapWidthSet : 1; | | |||
1161 | bool m_showScrollbarsSet : 1; | | |||
1162 | bool m_iconBarSet : 1; | | |||
1163 | bool m_foldingBarSet : 1; | | |||
1164 | bool m_foldingPreviewSet : 1; | | |||
1165 | bool m_lineModificationSet : 1; | | |||
1166 | bool m_bookmarkSortSet : 1; | 1207 | bool m_bookmarkSortSet : 1; | ||
1167 | bool m_autoCenterLinesSet : 1; | 1208 | bool m_autoCenterLinesSet : 1; | ||
1168 | bool m_searchFlagsSet : 1; | | |||
1169 | bool m_defaultMarkTypeSet : 1; | 1209 | bool m_defaultMarkTypeSet : 1; | ||
1170 | bool m_persistentSelectionSet : 1; | 1210 | bool m_persistentSelectionSet : 1; | ||
1171 | bool m_inputModeSet : 1; | 1211 | bool m_inputModeSet : 1; | ||
1172 | bool m_viInputModeStealKeysSet : 1; | 1212 | bool m_viInputModeStealKeysSet : 1; | ||
1173 | bool m_viRelativeLineNumbersSet : 1; | 1213 | bool m_viRelativeLineNumbersSet : 1; | ||
1174 | bool m_automaticCompletionInvocationSet : 1; | 1214 | bool m_automaticCompletionInvocationSet : 1; | ||
1175 | bool m_wordCompletionSet : 1; | 1215 | bool m_wordCompletionSet : 1; | ||
1176 | bool m_keywordCompletionSet : 1; | 1216 | bool m_keywordCompletionSet : 1; | ||
1177 | bool m_wordCompletionMinimalWordLengthSet : 1; | 1217 | bool m_wordCompletionMinimalWordLengthSet : 1; | ||
1178 | bool m_smartCopyCutSet : 1; | 1218 | bool m_smartCopyCutSet : 1; | ||
1179 | bool m_mousePasteAtCursorPositionSet : 1; | 1219 | bool m_mousePasteAtCursorPositionSet : 1; | ||
1180 | bool m_scrollPastEndSet : 1; | 1220 | bool m_scrollPastEndSet : 1; | ||
1181 | bool m_allowMarkMenu : 1; | 1221 | bool m_allowMarkMenu : 1; | ||
1182 | bool m_wordCompletionRemoveTailSet : 1; | 1222 | bool m_wordCompletionRemoveTailSet : 1; | ||
1183 | bool m_foldFirstLineSet : 1; | 1223 | bool m_foldFirstLineSet : 1; | ||
1184 | bool m_showWordCountSet : 1; | | |||
1185 | bool m_showLineCountSet : 1; | 1224 | bool m_showLineCountSet : 1; | ||
1186 | bool m_autoBracketsSet : 1; | 1225 | bool m_autoBracketsSet : 1; | ||
1187 | bool m_backspaceRemoveComposedSet : 1; | | |||
1188 | 1226 | | |||
1189 | private: | 1227 | private: | ||
1190 | static KateViewConfig *s_global; | 1228 | static KateViewConfig *s_global; | ||
1191 | KTextEditor::ViewPrivate *m_view = nullptr; | 1229 | KTextEditor::ViewPrivate *m_view = nullptr; | ||
1192 | }; | 1230 | }; | ||
1193 | 1231 | | |||
1194 | class KTEXTEDITOR_EXPORT KateRendererConfig : public KateConfig | 1232 | class KTEXTEDITOR_EXPORT KateRendererConfig : public KateConfig | ||
1195 | { | 1233 | { | ||
1196 | private: | 1234 | private: | ||
1197 | friend class KTextEditor::EditorPrivate; | 1235 | friend class KTextEditor::EditorPrivate; | ||
1198 | 1236 | | |||
1199 | /** | 1237 | /** | ||
1200 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | 1238 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | ||
1201 | */ | 1239 | */ | ||
1202 | KateRendererConfig(); | 1240 | KateRendererConfig(); | ||
1203 | 1241 | | |||
1204 | public: | 1242 | public: | ||
1205 | /** | 1243 | /** | ||
1206 | * Construct a DocumentConfig | 1244 | * Construct a RendererConfig | ||
1207 | */ | 1245 | */ | ||
1208 | explicit KateRendererConfig(KateRenderer *renderer); | 1246 | explicit KateRendererConfig(KateRenderer *renderer); | ||
1209 | 1247 | | |||
1210 | /** | 1248 | /** | ||
1211 | * Cu DocumentConfig | 1249 | * Cu RendererConfig | ||
1212 | */ | 1250 | */ | ||
1213 | ~KateRendererConfig() override; | 1251 | ~KateRendererConfig() override; | ||
1214 | 1252 | | |||
1215 | inline static KateRendererConfig *global() | 1253 | inline static KateRendererConfig *global() | ||
1216 | { | 1254 | { | ||
1217 | return s_global; | 1255 | return s_global; | ||
1218 | } | 1256 | } | ||
1219 | 1257 | | |||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |
Are training commas allowed meanwhile?