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 | AllowMarkMenu, | ||||
954 | AutoBrackets, | ||||
955 | AutoCenterLines, | ||||
956 | AutomaticCompletionInvocation, | ||||
957 | BackspaceRemoveComposedCharacters, | ||||
958 | BookmarkSorting, | ||||
959 | CharsToEncloseSelection, | ||||
960 | DefaultMarkType, | ||||
961 | DynWordWrapAlignIndent, | ||||
962 | DynWordWrapIndicators, | ||||
963 | DynWrapAtStaticMarker, | ||||
964 | DynamicWordWrap, | ||||
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 | FoldFirstLine, | ||||
966 | InputMode, | ||||
967 | KeywordCompletion, | ||||
968 | MaxHistorySize, | ||||
969 | MousePasteAtCursorPosition, | ||||
970 | PersistentSelection, | ||||
971 | ScrollBarMiniMapWidth, | ||||
972 | ScrollPastEnd, | ||||
973 | SearchFlags, | ||||
974 | ShowFoldingBar, | ||||
975 | ShowFoldingPreview, | ||||
976 | ShowIconBar, | ||||
977 | ShowLineCount, | ||||
978 | ShowLineModification, | ||||
979 | ShowLineNumbers, | ||||
980 | ShowScrollBarMarks, | ||||
981 | ShowScrollBarMiniMap, | ||||
982 | ShowScrollBarMiniMapAll, | ||||
983 | ShowScrollBarPreview, | ||||
984 | ShowScrollbars, | ||||
985 | ShowWordCount, | ||||
986 | SmartCopyCut, | ||||
987 | ViInputModeStealKeys, | ||||
988 | ViRelativeLineNumbers, | ||||
989 | WordCompletion, | ||||
990 | WordCompletionMinimalWordLength, | ||||
991 | WordCompletionRemoveTail, | ||||
992 | }; | ||||
993 | | ||||
948 | public: | 994 | public: | ||
949 | /** | 995 | /** | ||
950 | * Read config from object | 996 | * Read config from object | ||
951 | */ | 997 | */ | ||
952 | void readConfig(const KConfigGroup &config); | 998 | void readConfig(const KConfigGroup &config); | ||
953 | 999 | | |||
954 | /** | 1000 | /** | ||
955 | * Write config to object | 1001 | * Write config to object | ||
956 | */ | 1002 | */ | ||
957 | void writeConfig(KConfigGroup &config); | 1003 | void writeConfig(KConfigGroup &config); | ||
958 | 1004 | | |||
959 | protected: | 1005 | protected: | ||
960 | void updateConfig() override; | 1006 | void updateConfig() override; | ||
961 | 1007 | | |||
962 | public: | 1008 | public: | ||
963 | bool dynWordWrapSet() const | 1009 | bool dynWordWrap() const | ||
1010 | { | ||||
1011 | return value(DynamicWordWrap).toBool(); | ||||
1012 | } | ||||
1013 | void setDynWordWrap(bool on) | ||||
964 | { | 1014 | { | ||
965 | return m_dynWordWrapSet; | 1015 | setValue(DynamicWordWrap, on); | ||
966 | } | 1016 | } | ||
967 | bool dynWordWrap() const; | | |||
968 | void setDynWordWrap(bool wrap); | | |||
969 | 1017 | | |||
970 | bool dynWrapAtStaticMarker() const; | 1018 | bool dynWrapAtStaticMarker() const | ||
971 | void setDynWrapAtStaticMarker(bool on); | 1019 | { | ||
1020 | return value(DynWrapAtStaticMarker).toBool(); | ||||
1021 | } | ||||
972 | 1022 | | |||
973 | int dynWordWrapIndicators() const; | 1023 | int dynWordWrapIndicators() const | ||
974 | void setDynWordWrapIndicators(int mode); | 1024 | { | ||
1025 | return value(DynWordWrapIndicators).toInt(); | ||||
1026 | } | ||||
975 | 1027 | | |||
976 | int dynWordWrapAlignIndent() const; | 1028 | int dynWordWrapAlignIndent() const | ||
977 | void setDynWordWrapAlignIndent(int indent); | 1029 | { | ||
1030 | return value(DynWordWrapAlignIndent).toInt(); | ||||
1031 | } | ||||
978 | 1032 | | |||
979 | bool lineNumbers() const; | 1033 | bool lineNumbers() const | ||
980 | void setLineNumbers(bool on); | 1034 | { | ||
1035 | return value(ShowLineNumbers).toBool(); | ||||
1036 | } | ||||
981 | 1037 | | |||
982 | bool scrollBarMarks() const; | 1038 | bool scrollBarMarks() const | ||
983 | void setScrollBarMarks(bool on); | 1039 | { | ||
1040 | return value(ShowScrollBarMarks).toBool(); | ||||
1041 | } | ||||
984 | 1042 | | |||
985 | bool scrollBarPreview() const; | 1043 | bool scrollBarPreview() const | ||
986 | void setScrollBarPreview(bool on); | 1044 | { | ||
1045 | return value(ShowScrollBarPreview).toBool(); | ||||
1046 | } | ||||
987 | 1047 | | |||
988 | bool scrollBarMiniMap() const; | 1048 | bool scrollBarMiniMap() const | ||
989 | void setScrollBarMiniMap(bool on); | 1049 | { | ||
1050 | return value(ShowScrollBarMiniMap).toBool(); | ||||
1051 | } | ||||
990 | 1052 | | |||
991 | bool scrollBarMiniMapAll() const; | 1053 | bool scrollBarMiniMapAll() const | ||
992 | void setScrollBarMiniMapAll(bool on); | 1054 | { | ||
1055 | return value(ShowScrollBarMiniMapAll).toBool(); | ||||
1056 | } | ||||
993 | 1057 | | |||
994 | int scrollBarMiniMapWidth() const; | 1058 | int scrollBarMiniMapWidth() const | ||
995 | void setScrollBarMiniMapWidth(int width); | 1059 | { | ||
1060 | return value(ScrollBarMiniMapWidth).toInt(); | ||||
1061 | } | ||||
996 | 1062 | | |||
997 | /* Whether to show scrollbars */ | 1063 | /* Whether to show scrollbars */ | ||
998 | enum ScrollbarMode { | 1064 | enum ScrollbarMode { | ||
999 | AlwaysOn = 0, | 1065 | AlwaysOn = 0, | ||
1000 | ShowWhenNeeded, | 1066 | ShowWhenNeeded, | ||
1001 | AlwaysOff | 1067 | AlwaysOff | ||
1002 | }; | 1068 | }; | ||
1003 | 1069 | | |||
1004 | int showScrollbars() const; | 1070 | int showScrollbars() const | ||
1005 | void setShowScrollbars(int mode); | 1071 | { | ||
1072 | return value(ShowScrollbars).toInt(); | ||||
1073 | } | ||||
1006 | 1074 | | |||
1007 | bool iconBar() const; | 1075 | bool iconBar() const | ||
1008 | void setIconBar(bool on); | 1076 | { | ||
1077 | return value(ShowIconBar).toBool(); | ||||
1078 | } | ||||
1009 | 1079 | | |||
1010 | bool foldingBar() const; | 1080 | bool foldingBar() const | ||
1011 | void setFoldingBar(bool on); | 1081 | { | ||
1082 | return value(ShowFoldingBar).toBool(); | ||||
1083 | } | ||||
1012 | 1084 | | |||
1013 | bool foldingPreview() const; | 1085 | bool foldingPreview() const | ||
1014 | void setFoldingPreview(bool on); | 1086 | { | ||
1087 | return value(ShowFoldingPreview).toBool(); | ||||
1088 | } | ||||
1015 | 1089 | | |||
1016 | bool lineModification() const; | 1090 | bool lineModification() const | ||
1017 | void setLineModification(bool on); | 1091 | { | ||
1092 | return value(ShowLineModification).toBool(); | ||||
1093 | } | ||||
1018 | 1094 | | |||
1019 | int bookmarkSort() const; | 1095 | int bookmarkSort() const | ||
1020 | void setBookmarkSort(int mode); | 1096 | { | ||
1097 | return value(BookmarkSorting).toInt(); | ||||
1098 | } | ||||
1021 | 1099 | | |||
1022 | int autoCenterLines() const; | 1100 | int autoCenterLines() const | ||
1023 | void setAutoCenterLines(int lines); | 1101 | { | ||
1102 | return value(AutoCenterLines).toInt(); | ||||
1103 | } | ||||
1024 | 1104 | | |||
1025 | enum SearchFlags { | 1105 | enum SearchFlags { | ||
1026 | IncMatchCase = 1 << 0, | 1106 | IncMatchCase = 1 << 0, | ||
1027 | IncHighlightAll = 1 << 1, | 1107 | IncHighlightAll = 1 << 1, | ||
1028 | IncFromCursor = 1 << 2, | 1108 | IncFromCursor = 1 << 2, | ||
1029 | PowerMatchCase = 1 << 3, | 1109 | PowerMatchCase = 1 << 3, | ||
1030 | PowerHighlightAll = 1 << 4, | 1110 | PowerHighlightAll = 1 << 4, | ||
1031 | PowerFromCursor = 1 << 5, | 1111 | PowerFromCursor = 1 << 5, | ||
1032 | // PowerSelectionOnly = 1 << 6, Better not save to file // Sebastian | 1112 | // PowerSelectionOnly = 1 << 6, Better not save to file // Sebastian | ||
1033 | PowerModePlainText = 1 << 7, | 1113 | PowerModePlainText = 1 << 7, | ||
1034 | PowerModeWholeWords = 1 << 8, | 1114 | PowerModeWholeWords = 1 << 8, | ||
1035 | PowerModeEscapeSequences = 1 << 9, | 1115 | PowerModeEscapeSequences = 1 << 9, | ||
1036 | PowerModeRegularExpression = 1 << 10, | 1116 | PowerModeRegularExpression = 1 << 10, | ||
1037 | PowerUsePlaceholders = 1 << 11 | 1117 | PowerUsePlaceholders = 1 << 11 | ||
1038 | }; | 1118 | }; | ||
1039 | 1119 | | |||
1040 | long searchFlags() const; | 1120 | uint searchFlags() const | ||
1041 | void setSearchFlags(long flags); | 1121 | { | ||
1122 | return value(SearchFlags).toUInt(); | ||||
1123 | } | ||||
1124 | void setSearchFlags(uint flags) | ||||
1125 | { | ||||
1126 | setValue(SearchFlags, flags); | ||||
1127 | } | ||||
1042 | 1128 | | |||
1043 | int maxHistorySize() const; | 1129 | int maxHistorySize() const | ||
1130 | { | ||||
1131 | return value(MaxHistorySize).toInt(); | ||||
1132 | } | ||||
1044 | 1133 | | |||
1045 | uint defaultMarkType() const; | 1134 | uint defaultMarkType() const | ||
1046 | void setDefaultMarkType(uint type); | 1135 | { | ||
1136 | return value(DefaultMarkType).toUInt(); | ||||
1137 | } | ||||
1047 | 1138 | | |||
1048 | bool allowMarkMenu() const; | 1139 | bool allowMarkMenu() const | ||
1049 | void setAllowMarkMenu(bool allow); | 1140 | { | ||
1141 | return value(AllowMarkMenu).toBool(); | ||||
1142 | } | ||||
1050 | 1143 | | |||
1051 | bool persistentSelection() const; | 1144 | bool persistentSelection() const | ||
1052 | void setPersistentSelection(bool on); | 1145 | { | ||
1146 | return value(PersistentSelection).toBool(); | ||||
1147 | } | ||||
1053 | 1148 | | |||
1054 | KTextEditor::View::InputMode inputMode() const; | 1149 | KTextEditor::View::InputMode inputMode() const | ||
1055 | void setInputMode(KTextEditor::View::InputMode mode); | 1150 | { | ||
1056 | void setInputModeRaw(int rawmode); | 1151 | return static_cast<KTextEditor::View::InputMode>(value(InputMode).toUInt()); | ||
1152 | } | ||||
1057 | 1153 | | |||
1058 | bool viInputModeStealKeys() const; | 1154 | bool viInputModeStealKeys() const | ||
1059 | void setViInputModeStealKeys(bool on); | 1155 | { | ||
1156 | return value(ViInputModeStealKeys).toBool(); | ||||
1157 | } | ||||
1060 | 1158 | | |||
1061 | bool viRelativeLineNumbers() const; | 1159 | bool viRelativeLineNumbers() const | ||
1062 | void setViRelativeLineNumbers(bool on); | 1160 | { | ||
1161 | return value(ViRelativeLineNumbers).toBool(); | ||||
1162 | } | ||||
1063 | 1163 | | |||
1064 | // Do we still need the enum and related functions below? | 1164 | // Do we still need the enum and related functions below? | ||
1065 | enum TextToSearch { | 1165 | enum TextToSearch { | ||
1066 | Nowhere = 0, | 1166 | Nowhere = 0, | ||
1067 | SelectionOnly = 1, | 1167 | SelectionOnly = 1, | ||
1068 | SelectionWord = 2, | 1168 | SelectionWord = 2, | ||
1069 | WordOnly = 3, | 1169 | WordOnly = 3, | ||
1070 | WordSelection = 4 | 1170 | WordSelection = 4 | ||
1071 | }; | 1171 | }; | ||
1072 | 1172 | | |||
1073 | bool automaticCompletionInvocation() const; | 1173 | bool automaticCompletionInvocation() const | ||
1074 | void setAutomaticCompletionInvocation(bool on); | 1174 | { | ||
1075 | 1175 | return value(AutomaticCompletionInvocation).toBool(); | |||
1076 | bool wordCompletion() const; | 1176 | } | ||
1077 | void setWordCompletion(bool on); | | |||
1078 | 1177 | | |||
1079 | bool keywordCompletion () const; | 1178 | bool wordCompletion() const | ||
1080 | void setKeywordCompletion (bool on); | 1179 | { | ||
1180 | return value(WordCompletion).toBool(); | ||||
1181 | } | ||||
1081 | 1182 | | |||
1082 | int wordCompletionMinimalWordLength() const; | 1183 | bool keywordCompletion () const | ||
1083 | void setWordCompletionMinimalWordLength(int length); | 1184 | { | ||
1185 | return value(KeywordCompletion).toBool(); | ||||
1186 | } | ||||
1084 | 1187 | | |||
1085 | bool wordCompletionRemoveTail() const; | 1188 | int wordCompletionMinimalWordLength() const | ||
1086 | void setWordCompletionRemoveTail(bool on); | 1189 | { | ||
1190 | return value(WordCompletionMinimalWordLength).toInt(); | ||||
1191 | } | ||||
1087 | 1192 | | |||
1088 | bool smartCopyCut() const; | 1193 | bool wordCompletionRemoveTail() const | ||
1089 | void setSmartCopyCut(bool on); | 1194 | { | ||
1195 | return value(WordCompletionRemoveTail).toBool(); | ||||
1196 | } | ||||
1090 | 1197 | | |||
1091 | bool mousePasteAtCursorPosition() const; | 1198 | bool smartCopyCut() const | ||
1092 | void setMousePasteAtCursorPosition(bool on); | 1199 | { | ||
1200 | return value(SmartCopyCut).toBool(); | ||||
1201 | } | ||||
1093 | 1202 | | |||
1094 | bool scrollPastEnd() const; | 1203 | bool mousePasteAtCursorPosition() const | ||
1095 | void setScrollPastEnd(bool on); | 1204 | { | ||
1205 | return value(MousePasteAtCursorPosition).toBool(); | ||||
1206 | } | ||||
1096 | 1207 | | |||
1097 | bool foldFirstLine() const; | 1208 | bool scrollPastEnd() const | ||
1098 | void setFoldFirstLine(bool on); | 1209 | { | ||
1210 | return value(ScrollPastEnd).toBool(); | ||||
1211 | } | ||||
1099 | 1212 | | |||
1100 | bool showWordCount() const; | 1213 | bool foldFirstLine() const | ||
1101 | void setShowWordCount(bool on); | 1214 | { | ||
1215 | return value(FoldFirstLine).toBool(); | ||||
1216 | } | ||||
1102 | 1217 | | |||
1103 | bool showLineCount() const; | 1218 | bool showWordCount() const | ||
1104 | void setShowLineCount(bool on); | 1219 | { | ||
1220 | return value(ShowWordCount).toBool(); | ||||
1221 | } | ||||
1222 | void setShowWordCount(bool on) | ||||
1223 | { | ||||
1224 | setValue(ShowWordCount, on); | ||||
1225 | } | ||||
1105 | 1226 | | |||
1106 | bool autoBrackets() const; | 1227 | bool showLineCount() const | ||
1107 | void setAutoBrackets(bool on); | 1228 | { | ||
1229 | return value(ShowLineCount).toBool(); | ||||
1230 | } | ||||
1108 | 1231 | | |||
1109 | bool backspaceRemoveComposed() const; | 1232 | bool autoBrackets() const | ||
1110 | void setBackspaceRemoveComposed(bool on); | 1233 | { | ||
1234 | return value(AutoBrackets).toBool(); | ||||
1235 | } | ||||
1111 | 1236 | | |||
1112 | private: | 1237 | bool backspaceRemoveComposed() const | ||
1113 | bool m_dynWordWrap; | 1238 | { | ||
1114 | bool m_dynWrapAtStaticMarker; | 1239 | return value(BackspaceRemoveComposedCharacters).toBool(); | ||
1115 | int m_dynWordWrapIndicators; | 1240 | } | ||
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; | | |||
1129 | int m_autoCenterLines; | | |||
1130 | long m_searchFlags; | | |||
1131 | int m_maxHistorySize; | | |||
1132 | uint m_defaultMarkType; | | |||
1133 | bool m_persistentSelection; | | |||
1134 | KTextEditor::View::InputMode m_inputMode; | | |||
1135 | bool m_viInputModeStealKeys; | | |||
1136 | bool m_viRelativeLineNumbers; | | |||
1137 | bool m_automaticCompletionInvocation; | | |||
1138 | bool m_wordCompletion; | | |||
1139 | bool m_keywordCompletion; | | |||
1140 | int m_wordCompletionMinimalWordLength; | | |||
1141 | bool m_wordCompletionRemoveTail; | | |||
1142 | bool m_smartCopyCut; | | |||
1143 | bool m_mousePasteAtCursorPosition = false; | | |||
1144 | bool m_scrollPastEnd; | | |||
1145 | bool m_foldFirstLine; | | |||
1146 | bool m_showWordCount = false; | | |||
1147 | bool m_showLineCount = false; | | |||
1148 | bool m_autoBrackets; | | |||
1149 | bool m_backspaceRemoveComposed; | | |||
1150 | | ||||
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; | | |||
1167 | bool m_autoCenterLinesSet : 1; | | |||
1168 | bool m_searchFlagsSet : 1; | | |||
1169 | bool m_defaultMarkTypeSet : 1; | | |||
1170 | bool m_persistentSelectionSet : 1; | | |||
1171 | bool m_inputModeSet : 1; | | |||
1172 | bool m_viInputModeStealKeysSet : 1; | | |||
1173 | bool m_viRelativeLineNumbersSet : 1; | | |||
1174 | bool m_automaticCompletionInvocationSet : 1; | | |||
1175 | bool m_wordCompletionSet : 1; | | |||
1176 | bool m_keywordCompletionSet : 1; | | |||
1177 | bool m_wordCompletionMinimalWordLengthSet : 1; | | |||
1178 | bool m_smartCopyCutSet : 1; | | |||
1179 | bool m_mousePasteAtCursorPositionSet : 1; | | |||
1180 | bool m_scrollPastEndSet : 1; | | |||
1181 | bool m_allowMarkMenu : 1; | | |||
1182 | bool m_wordCompletionRemoveTailSet : 1; | | |||
1183 | bool m_foldFirstLineSet : 1; | | |||
1184 | bool m_showWordCountSet : 1; | | |||
1185 | bool m_showLineCountSet : 1; | | |||
1186 | bool m_autoBracketsSet : 1; | | |||
1187 | bool m_backspaceRemoveComposedSet : 1; | | |||
1188 | 1241 | | |||
1189 | private: | 1242 | private: | ||
1190 | static KateViewConfig *s_global; | 1243 | static KateViewConfig *s_global; | ||
1191 | KTextEditor::ViewPrivate *m_view = nullptr; | 1244 | KTextEditor::ViewPrivate *m_view = nullptr; | ||
1192 | }; | 1245 | }; | ||
1193 | 1246 | | |||
1194 | class KTEXTEDITOR_EXPORT KateRendererConfig : public KateConfig | 1247 | class KTEXTEDITOR_EXPORT KateRendererConfig : public KateConfig | ||
1195 | { | 1248 | { | ||
1196 | private: | 1249 | private: | ||
1197 | friend class KTextEditor::EditorPrivate; | 1250 | friend class KTextEditor::EditorPrivate; | ||
1198 | 1251 | | |||
1199 | /** | 1252 | /** | ||
1200 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | 1253 | * only used in KTextEditor::EditorPrivate for the static global fallback !!! | ||
1201 | */ | 1254 | */ | ||
1202 | KateRendererConfig(); | 1255 | KateRendererConfig(); | ||
1203 | 1256 | | |||
1204 | public: | 1257 | public: | ||
1205 | /** | 1258 | /** | ||
1206 | * Construct a DocumentConfig | 1259 | * Construct a RendererConfig | ||
1207 | */ | 1260 | */ | ||
1208 | explicit KateRendererConfig(KateRenderer *renderer); | 1261 | explicit KateRendererConfig(KateRenderer *renderer); | ||
1209 | 1262 | | |||
1210 | /** | 1263 | /** | ||
1211 | * Cu DocumentConfig | 1264 | * Cu RendererConfig | ||
1212 | */ | 1265 | */ | ||
1213 | ~KateRendererConfig() override; | 1266 | ~KateRendererConfig() override; | ||
1214 | 1267 | | |||
1215 | inline static KateRendererConfig *global() | 1268 | inline static KateRendererConfig *global() | ||
1216 | { | 1269 | { | ||
1217 | return s_global; | 1270 | return s_global; | ||
1218 | } | 1271 | } | ||
1219 | 1272 | | |||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |
Are training commas allowed meanwhile?