40 #include <QtCore/QTextCodec>
41 #include <QStringListModel>
45 : configSessionNumber (0), configIsRunning (false)
55 configSessionNumber++;
57 if (configSessionNumber > 1)
60 configIsRunning =
true;
65 if (configSessionNumber == 0)
68 configSessionNumber--;
70 if (configSessionNumber > 0)
73 configIsRunning =
false;
85 KateGlobalConfig::KateGlobalConfig ()
94 KateGlobalConfig::~KateGlobalConfig ()
127 return m_fallbackEncoding;
132 if (m_fallbackEncoding.isEmpty())
133 return QTextCodec::codecForName(
"ISO 8859-15");
142 if (encoding.isEmpty())
150 if (!found || !codec)
154 m_fallbackEncoding = codec->name();
159 KateDocumentConfig::KateDocumentConfig ()
160 : m_indentationWidth (2),
162 m_tabHandling (tabSmart),
165 m_tabWidthSet (true),
166 m_indentationWidthSet (true),
167 m_indentationModeSet (true),
168 m_wordWrapSet (true),
169 m_wordWrapAtSet (true),
170 m_pageUpDownMovesCursorSet (true),
171 m_keepExtraSpacesSet (false),
172 m_indentPastedTextSet (false),
173 m_backspaceIndentsSet (false),
174 m_smartHomeSet (false),
175 m_showTabsSet (false),
176 m_showSpacesSet (false),
177 m_replaceTabsDynSet (false),
178 m_removeSpacesSet (false),
179 m_newLineAtEofSet (false),
180 m_overwiteModeSet (false),
181 m_tabIndentsSet (false),
182 m_encodingSet (true),
185 m_allowEolDetectionSet (false),
186 m_allowSimpleModeSet (false),
187 m_backupFlagsSet (true),
188 m_searchDirConfigDepthSet (true),
189 m_backupPrefixSet (true),
190 m_backupSuffixSet (true),
191 m_swapFileNoSyncSet (true),
192 m_onTheFlySpellCheckSet (true),
193 m_lineLengthLimitSet (true),
204 : m_indentationWidth (2),
206 m_tabHandling (tabSmart),
209 m_tabWidthSet (true),
210 m_indentationWidthSet (true),
211 m_indentationModeSet (true),
212 m_wordWrapSet (true),
213 m_wordWrapAtSet (true),
214 m_pageUpDownMovesCursorSet (true),
215 m_keepExtraSpacesSet (false),
216 m_indentPastedTextSet (false),
217 m_backspaceIndentsSet (false),
218 m_smartHomeSet (false),
219 m_showTabsSet (false),
220 m_showSpacesSet (false),
221 m_replaceTabsDynSet (false),
222 m_removeSpacesSet (false),
223 m_newLineAtEofSet (false),
224 m_overwiteModeSet (false),
225 m_tabIndentsSet (false),
226 m_encodingSet (true),
229 m_allowEolDetectionSet (false),
230 m_allowSimpleModeSet (false),
231 m_backupFlagsSet (true),
232 m_searchDirConfigDepthSet (true),
233 m_backupPrefixSet (true),
234 m_backupSuffixSet (true),
235 m_swapFileNoSyncSet (true),
236 m_onTheFlySpellCheckSet (true),
237 m_lineLengthLimitSet (true),
245 : m_tabHandling (tabSmart),
247 m_tabWidthSet (false),
248 m_indentationWidthSet (false),
249 m_indentationModeSet (false),
250 m_wordWrapSet (false),
251 m_wordWrapAtSet (false),
252 m_pageUpDownMovesCursorSet (false),
253 m_keepExtraSpacesSet (false),
254 m_indentPastedTextSet (false),
255 m_backspaceIndentsSet (false),
256 m_smartHomeSet (false),
257 m_showTabsSet (false),
258 m_showSpacesSet (false),
259 m_replaceTabsDynSet (false),
260 m_removeSpacesSet (false),
261 m_newLineAtEofSet (false),
262 m_overwiteModeSet (false),
263 m_tabIndentsSet (false),
264 m_encodingSet (false),
267 m_allowEolDetectionSet (false),
268 m_allowSimpleModeSet (false),
269 m_backupFlagsSet (false),
270 m_searchDirConfigDepthSet (false),
271 m_backupPrefixSet (false),
272 m_backupSuffixSet (false),
273 m_swapFileNoSyncSet (false),
274 m_onTheFlySpellCheckSet (false),
275 m_lineLengthLimitSet (false),
416 if (m_tabWidthSet && m_tabWidth == tabWidth)
421 m_tabWidthSet =
true;
429 if (m_indentationWidthSet ||
isGlobal())
430 return m_indentationWidth;
437 if (indentationWidth < 1)
440 if (m_indentationWidthSet && m_indentationWidth == indentationWidth)
445 m_indentationWidthSet =
true;
453 if (m_indentationModeSet ||
isGlobal())
454 return m_indentationMode;
461 if (m_indentationModeSet && m_indentationMode == indentationMode)
466 m_indentationModeSet =
true;
477 return m_tabHandling;
501 if (m_wordWrapSet && m_wordWrap == on)
506 m_wordWrapSet =
true;
525 if (m_wordWrapAtSet && m_wordWrapAt == col)
530 m_wordWrapAtSet =
true;
538 if (m_pageUpDownMovesCursorSet ||
isGlobal())
539 return m_pageUpDownMovesCursor;
546 if (m_pageUpDownMovesCursorSet && m_pageUpDownMovesCursor == on)
551 m_pageUpDownMovesCursorSet =
true;
552 m_pageUpDownMovesCursor = on;
559 if (m_keepExtraSpacesSet && m_keepExtraSpaces == on)
564 m_keepExtraSpacesSet =
true;
565 m_keepExtraSpaces = on;
572 if (m_keepExtraSpacesSet ||
isGlobal())
573 return m_keepExtraSpaces;
580 if (m_indentPastedTextSet && m_indentPastedText == on)
585 m_indentPastedTextSet =
true;
586 m_indentPastedText = on;
593 if (m_indentPastedTextSet ||
isGlobal())
594 return m_indentPastedText;
601 if (m_backspaceIndentsSet && m_backspaceIndents == on)
606 m_backspaceIndentsSet =
true;
607 m_backspaceIndents = on;
614 if (m_backspaceIndentsSet ||
isGlobal())
615 return m_backspaceIndents;
622 if (m_smartHomeSet && m_smartHome == on)
627 m_smartHomeSet =
true;
643 if (m_showTabsSet && m_showTabs == on)
648 m_showTabsSet =
true;
664 if (m_showSpacesSet && m_showSpaces == on)
669 m_showSpacesSet =
true;
685 if (m_replaceTabsDynSet && m_replaceTabsDyn == on)
690 m_replaceTabsDynSet =
true;
691 m_replaceTabsDyn = on;
698 if (m_replaceTabsDynSet ||
isGlobal())
699 return m_replaceTabsDyn;
706 if (m_removeSpacesSet && m_removeSpaces == triState)
711 m_removeSpacesSet =
true;
712 m_removeSpaces = triState;
719 if (m_removeSpacesSet ||
isGlobal())
720 return m_removeSpaces;
727 if (m_newLineAtEofSet && m_newLineAtEof == on)
732 m_newLineAtEofSet =
true;
740 if (m_newLineAtEofSet ||
isGlobal())
741 return m_newLineAtEof;
748 if (m_overwiteModeSet && m_overwiteMode == on)
753 m_overwiteModeSet =
true;
761 if (m_overwiteModeSet ||
isGlobal())
762 return m_overwiteMode;
764 return s_global->
ovr();
769 if (m_tabIndentsSet && m_tabIndents == on)
774 m_tabIndentsSet =
true;
800 if (m_encoding.isEmpty() &&
isGlobal())
802 else if (m_encoding.isEmpty())
803 return s_global->
codec ();
808 return s_global->
codec ();
815 if (encoding.isEmpty())
817 codec = s_global->
codec();
823 if (!found || !codec)
827 m_encodingSet =
true;
828 m_encoding = codec->name();
839 return m_encodingSet;
847 return s_global->
eol();
864 if (m_eolSet && m_eol == mode)
877 if (m_bomSet && m_bom == bom)
893 return s_global->
bom();
898 if (m_allowEolDetectionSet ||
isGlobal())
899 return m_allowEolDetection;
906 if (m_allowEolDetectionSet && m_allowEolDetection == on)
911 m_allowEolDetectionSet =
true;
912 m_allowEolDetection = on;
919 if (m_allowSimpleModeSet ||
isGlobal())
920 return m_allowSimpleMode;
927 if (m_allowSimpleModeSet && m_allowSimpleMode == on)
932 m_allowSimpleModeSet =
true;
933 m_allowSimpleMode = on;
941 return m_backupFlags;
948 if (m_backupFlagsSet && m_backupFlags == flags)
953 m_backupFlagsSet =
true;
954 m_backupFlags = flags;
961 if (m_backupPrefixSet ||
isGlobal())
962 return m_backupPrefix;
969 if (m_backupSuffixSet ||
isGlobal())
970 return m_backupSuffix;
977 if (m_backupPrefixSet && m_backupPrefix == prefix)
982 m_backupPrefixSet =
true;
983 m_backupPrefix = prefix;
990 if (m_backupSuffixSet && m_backupSuffix == suffix)
995 m_backupSuffixSet =
true;
996 m_backupSuffix = suffix;
1003 if (m_swapFileNoSyncSet ||
isGlobal())
1004 return m_swapFileNoSync;
1011 if (m_swapFileNoSyncSet && m_swapFileNoSync == on)
1016 m_swapFileNoSyncSet =
true;
1017 m_swapFileNoSync = on;
1024 if (m_searchDirConfigDepthSet ||
isGlobal())
1025 return m_searchDirConfigDepth;
1032 if (m_searchDirConfigDepthSet && m_searchDirConfigDepth == depth)
1037 m_searchDirConfigDepthSet =
true;
1038 m_searchDirConfigDepth = depth;
1049 return configGroup.
readEntry(
"checkerEnabledByDefault",
false);
1051 if (m_onTheFlySpellCheckSet) {
1052 return m_onTheFlySpellCheck;
1060 if (m_onTheFlySpellCheckSet && m_onTheFlySpellCheck == on)
1065 m_onTheFlySpellCheckSet =
true;
1066 m_onTheFlySpellCheck = on;
1074 if (m_lineLengthLimitSet ||
isGlobal())
1075 return m_lineLengthLimit;
1082 if (m_lineLengthLimitSet && m_lineLengthLimit == lineLengthLimit)
1087 m_lineLengthLimitSet =
true;
1098 KateViewConfig::KateViewConfig ()
1100 m_dynWordWrapSet (true),
1101 m_dynWordWrapIndicatorsSet (true),
1102 m_dynWordWrapAlignIndentSet (true),
1103 m_lineNumbersSet (true),
1104 m_scrollBarMarksSet (true),
1105 m_scrollBarMiniMapSet (true),
1106 m_scrollBarMiniMapAllSet (true),
1107 m_scrollBarMiniMapWidthSet (true),
1108 m_iconBarSet (true),
1109 m_foldingBarSet (true),
1110 m_lineModificationSet (true),
1111 m_bookmarkSortSet (true),
1112 m_autoCenterLinesSet (true),
1113 m_searchFlagsSet (true),
1114 m_defaultMarkTypeSet (true),
1115 m_persistentSelectionSet (true),
1116 m_viInputModeSet (true),
1117 m_viInputModeStealKeysSet (true),
1118 m_viInputModeEmulateCommandBarSet(false),
1119 m_automaticCompletionInvocationSet (true),
1120 m_wordCompletionSet (true),
1121 m_wordCompletionMinimalWordLengthSet (true),
1122 m_smartCopyCutSet (true),
1123 m_scrollPastEndSet (true),
1124 m_allowMarkMenu (true),
1125 m_wordCompletionRemoveTailSet (false),
1137 m_searchFlags (PowerModePlainText),
1138 m_maxHistorySize (100),
1139 m_dynWordWrapSet (false),
1140 m_dynWordWrapIndicatorsSet (false),
1141 m_dynWordWrapAlignIndentSet (false),
1142 m_lineNumbersSet (false),
1143 m_scrollBarMarksSet (false),
1144 m_scrollBarMiniMapSet (false),
1145 m_scrollBarMiniMapAllSet (false),
1146 m_scrollBarMiniMapWidthSet (false),
1147 m_iconBarSet (false),
1148 m_foldingBarSet (false),
1149 m_lineModificationSet (false),
1150 m_bookmarkSortSet (false),
1151 m_autoCenterLinesSet (false),
1152 m_searchFlagsSet (false),
1153 m_defaultMarkTypeSet (false),
1154 m_persistentSelectionSet (false),
1155 m_viInputModeSet (false),
1156 m_viInputModeStealKeysSet (false),
1157 m_viInputModeEmulateCommandBarSet(false),
1158 m_automaticCompletionInvocationSet (false),
1159 m_wordCompletionSet (false),
1160 m_wordCompletionMinimalWordLengthSet (false),
1161 m_smartCopyCutSet (false),
1162 m_scrollPastEndSet (false),
1163 m_allowMarkMenu (true),
1164 m_wordCompletionRemoveTailSet (false),
1212 m_maxHistorySize = config.
readEntry(
"Maximum Search History Size", 100);
1233 m_patternHistoryModel.setStringList(patternHistory);
1237 m_replacementHistoryModel.setStringList(replacementHistory);
1271 config.
writeEntry(
"Maximum Search History Size", m_maxHistorySize);
1296 config.
writeEntry(KEY_PATTERN_HISTORY, m_patternHistoryModel.stringList());
1299 config.
writeEntry(KEY_REPLACEMENT_HISTORY, m_replacementHistoryModel.stringList());
1320 if (m_dynWordWrapSet ||
isGlobal())
1321 return m_dynWordWrap;
1328 if (m_dynWordWrapSet && m_dynWordWrap == wrap)
1333 m_dynWordWrapSet =
true;
1334 m_dynWordWrap = wrap;
1341 if (m_dynWordWrapIndicatorsSet ||
isGlobal())
1342 return m_dynWordWrapIndicators;
1349 if (m_dynWordWrapIndicatorsSet && m_dynWordWrapIndicators == mode)
1354 m_dynWordWrapIndicatorsSet =
true;
1355 m_dynWordWrapIndicators = qBound(0, mode, 80);
1362 if (m_dynWordWrapAlignIndentSet ||
isGlobal())
1363 return m_dynWordWrapAlignIndent;
1370 if (m_dynWordWrapAlignIndentSet && m_dynWordWrapAlignIndent == indent)
1375 m_dynWordWrapAlignIndentSet =
true;
1376 m_dynWordWrapAlignIndent = indent;
1383 if (m_lineNumbersSet ||
isGlobal())
1384 return m_lineNumbers;
1391 if (m_lineNumbersSet && m_lineNumbers == on)
1396 m_lineNumbersSet =
true;
1404 if (m_scrollBarMarksSet ||
isGlobal())
1405 return m_scrollBarMarks;
1412 if (m_scrollBarMarksSet && m_scrollBarMarks == on)
1417 m_scrollBarMarksSet =
true;
1418 m_scrollBarMarks = on;
1425 if (m_scrollBarMiniMapSet ||
isGlobal())
1426 return m_scrollBarMiniMap;
1433 if (m_scrollBarMiniMapSet && m_scrollBarMiniMap == on)
1438 m_scrollBarMiniMapSet =
true;
1439 m_scrollBarMiniMap = on;
1446 if (m_scrollBarMiniMapAllSet ||
isGlobal())
1447 return m_scrollBarMiniMapAll;
1454 if (m_scrollBarMiniMapAllSet && m_scrollBarMiniMapAll == on)
1459 m_scrollBarMiniMapAllSet =
true;
1460 m_scrollBarMiniMapAll = on;
1467 if (m_scrollBarMiniMapWidthSet ||
isGlobal())
1468 return m_scrollBarMiniMapWidth;
1475 if (m_scrollBarMiniMapWidthSet && m_scrollBarMiniMapWidth == width)
1480 m_scrollBarMiniMapWidthSet =
true;
1481 m_scrollBarMiniMapWidth = width;
1496 if (m_iconBarSet && m_iconBar == on)
1501 m_iconBarSet =
true;
1510 return m_foldingBar;
1517 if (m_foldingBarSet && m_foldingBar == on)
1522 m_foldingBarSet =
true;
1530 if (m_lineModificationSet ||
isGlobal())
1531 return m_lineModification;
1538 if (m_lineModificationSet && m_lineModification == on)
1543 m_lineModificationSet =
true;
1544 m_lineModification = on;
1551 if (m_bookmarkSortSet ||
isGlobal())
1552 return m_bookmarkSort;
1559 if (m_bookmarkSortSet && m_bookmarkSort == mode)
1564 m_bookmarkSortSet =
true;
1565 m_bookmarkSort = mode;
1572 if (m_autoCenterLinesSet ||
isGlobal())
1573 return m_autoCenterLines;
1583 if (m_autoCenterLinesSet && m_autoCenterLines == lines)
1588 m_autoCenterLinesSet =
true;
1589 m_autoCenterLines = lines;
1596 if (m_searchFlagsSet ||
isGlobal())
1597 return m_searchFlags;
1604 if (m_searchFlagsSet && m_searchFlags == flags)
1609 m_searchFlagsSet =
true;
1610 m_searchFlags = flags;
1619 return &m_patternHistoryModel;
1626 return m_maxHistorySize;
1633 return &m_replacementHistoryModel;
1640 if (m_defaultMarkTypeSet ||
isGlobal())
1641 return m_defaultMarkType;
1648 if (m_defaultMarkTypeSet && m_defaultMarkType == type)
1653 m_defaultMarkTypeSet =
true;
1654 m_defaultMarkType = type;
1661 return m_allowMarkMenu;
1666 m_allowMarkMenu = allow;
1671 if (m_persistentSelectionSet ||
isGlobal())
1672 return m_persistentSelection;
1679 if (m_persistentSelectionSet && m_persistentSelection == on)
1684 m_persistentSelectionSet =
true;
1685 m_persistentSelection = on;
1692 if (m_viInputModeSet ||
isGlobal())
1693 return m_viInputMode;
1700 if (m_viInputModeSet && m_viInputMode == on)
1705 m_viInputModeSet =
true;
1709 if (!on && m_view) {
1718 if (m_viInputModeStealKeysSet ||
isGlobal())
1719 return m_viInputModeStealKeys;
1726 if (m_viInputModeStealKeysSet && m_viInputModeStealKeys == on)
1730 m_viInputModeStealKeysSet =
true;
1731 m_viInputModeStealKeys = on;
1738 if (m_viInputModeEmulateCommandBarSet ||
isGlobal())
1739 return m_viInputModeEmulateCommandBar;
1746 if (m_viInputModeEmulateCommandBarSet && m_viInputModeEmulateCommandBar == on)
1750 m_viInputModeEmulateCommandBarSet =
true;
1751 m_viInputModeEmulateCommandBar = on;
1757 if (m_automaticCompletionInvocationSet ||
isGlobal())
1758 return m_automaticCompletionInvocation;
1765 if (m_automaticCompletionInvocationSet && m_automaticCompletionInvocation == on)
1769 m_automaticCompletionInvocationSet =
true;
1770 m_automaticCompletionInvocation = on;
1776 if (m_wordCompletionSet ||
isGlobal())
1777 return m_wordCompletion;
1784 if (m_wordCompletionSet && m_wordCompletion == on)
1788 m_wordCompletionSet =
true;
1789 m_wordCompletion = on;
1795 if (m_wordCompletionMinimalWordLengthSet ||
isGlobal())
1796 return m_wordCompletionMinimalWordLength;
1803 if (m_wordCompletionMinimalWordLengthSet && m_wordCompletionMinimalWordLength == length)
1808 m_wordCompletionMinimalWordLengthSet =
true;
1809 m_wordCompletionMinimalWordLength = length;
1816 if (m_wordCompletionRemoveTailSet ||
isGlobal())
1817 return m_wordCompletionRemoveTail;
1824 if (m_wordCompletionRemoveTailSet && m_wordCompletionRemoveTail == on)
1828 m_wordCompletionRemoveTailSet =
true;
1829 m_wordCompletionRemoveTail = on;
1835 if (m_smartCopyCutSet ||
isGlobal())
1836 return m_smartCopyCut;
1843 if (m_smartCopyCutSet && m_smartCopyCut == on)
1848 m_smartCopyCutSet =
true;
1849 m_smartCopyCut = on;
1856 if (m_scrollPastEndSet ||
isGlobal())
1857 return m_scrollPastEnd;
1864 if (m_scrollPastEndSet && m_scrollPastEnd == on)
1869 m_scrollPastEndSet =
true;
1870 m_scrollPastEnd = on;
1878 KateRendererConfig::KateRendererConfig ()
1879 : m_fontMetrics(
QFont()),
1880 m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
1883 m_wordWrapMarkerSet (true),
1884 m_showIndentationLinesSet (true),
1885 m_showWholeBracketExpressionSet (true),
1886 m_backgroundColorSet (true),
1887 m_selectionColorSet (true),
1888 m_highlightedLineColorSet (true),
1889 m_highlightedBracketColorSet (true),
1890 m_wordWrapMarkerColorSet (true),
1891 m_tabMarkerColorSet(true),
1892 m_indentationLineColorSet(true),
1893 m_iconBarColorSet(true),
1894 m_foldingColorSet(true),
1895 m_lineNumberColorSet (true),
1896 m_separatorColorSet (true),
1897 m_spellingMistakeLineColorSet (true),
1898 m_templateColorsSet(true),
1899 m_modifiedLineColorSet(true),
1900 m_savedLineColorSet(true),
1901 m_searchHighlightColorSet(true),
1902 m_replaceHighlightColorSet(true),
1903 m_lineMarkerColorSet (m_lineMarkerColor.size()),
1907 m_lineMarkerColorSet.fill (
true);
1917 : m_fontMetrics(
QFont()),
1918 m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
1919 m_schemaSet (false),
1921 m_wordWrapMarkerSet (false),
1922 m_showIndentationLinesSet (false),
1923 m_showWholeBracketExpressionSet (false),
1924 m_backgroundColorSet (false),
1925 m_selectionColorSet (false),
1926 m_highlightedLineColorSet (false),
1927 m_highlightedBracketColorSet (false),
1928 m_wordWrapMarkerColorSet (false),
1929 m_tabMarkerColorSet (false),
1930 m_indentationLineColorSet (false),
1931 m_iconBarColorSet (false),
1932 m_foldingColorSet (false),
1933 m_lineNumberColorSet (false),
1934 m_separatorColorSet (false),
1935 m_spellingMistakeLineColorSet (false),
1936 m_templateColorsSet(false),
1937 m_modifiedLineColorSet(false),
1938 m_savedLineColorSet(false),
1939 m_searchHighlightColorSet(false),
1940 m_replaceHighlightColorSet(false),
1941 m_lineMarkerColorSet (m_lineMarkerColor.size()),
1942 m_renderer (renderer)
1945 m_lineMarkerColorSet.fill (
false);
1999 return s_global->
schema();
2004 if (m_schemaSet && m_schema == schema)
2010 setSchemaInternal( schema );
2017 setSchemaInternal( m_schema );
2022 else if ( m_renderer && m_schemaSet )
2023 setSchemaInternal( m_schema );
2026 void KateRendererConfig::setSchemaInternal(
const QString &schema )
2037 QColor tmp0( schemeView.background().color() );
2038 QColor tmp1( schemeSelection.background().color() );
2045 QColor tmp6( schemeWindow.background().color() );
2046 QColor tmp7( schemeWindow.foreground().color() );
2054 m_backgroundColor = config.
readEntry(
"Color Background", tmp0);
2055 m_backgroundColorSet =
true;
2056 m_selectionColor = config.
readEntry(
"Color Selection", tmp1);
2057 m_selectionColorSet =
true;
2058 m_highlightedLineColor = config.
readEntry(
"Color Highlighted Line", tmp2);
2059 m_highlightedLineColorSet =
true;
2060 m_highlightedBracketColor = config.
readEntry(
"Color Highlighted Bracket", tmp3);
2061 m_highlightedBracketColorSet =
true;
2062 m_wordWrapMarkerColor = config.
readEntry(
"Color Word Wrap Marker", tmp4);
2063 m_wordWrapMarkerColorSet =
true;
2064 m_tabMarkerColor = config.
readEntry(
"Color Tab Marker", tmp5);
2065 m_tabMarkerColorSet =
true;
2066 m_indentationLineColor = config.
readEntry(
"Color Indentation Line", tmp5);
2067 m_indentationLineColorSet =
true;
2068 m_iconBarColor = config.
readEntry(
"Color Icon Bar", tmp6);
2069 m_iconBarColorSet =
true;
2070 m_foldingColor = config.
readEntry(
"Color Code Folding", tmp12);
2071 m_foldingColorSet =
true;
2072 m_lineNumberColor = config.
readEntry(
"Color Line Number", tmp7);
2073 m_lineNumberColorSet =
true;
2074 m_separatorColor = config.
readEntry(
"Color Separator", tmp13);
2075 m_separatorColorSet =
true;
2076 m_spellingMistakeLineColor = config.
readEntry(
"Color Spelling Mistake Line", tmp8);
2077 m_spellingMistakeLineColorSet =
true;
2079 m_modifiedLineColor = config.
readEntry(
"Color Modified Lines", tmp9);
2080 m_modifiedLineColorSet =
true;
2081 m_savedLineColor = config.
readEntry(
"Color Saved Lines", tmp10);
2082 m_savedLineColorSet =
true;
2083 m_searchHighlightColor = config.
readEntry(
"Color Search Highlight",
QColor(Qt::yellow));
2084 m_searchHighlightColorSet =
true;
2085 m_replaceHighlightColor = config.
readEntry(
"Color Replace Highlight",
QColor(Qt::green));
2086 m_replaceHighlightColorSet =
true;
2093 mark[2] = Qt::yellow;
2094 mark[3] = Qt::magenta;
2096 mark[5] = Qt::green;
2102 m_lineMarkerColorSet[index] =
true;
2103 m_lineMarkerColor[index] = col;
2109 m_fontMetrics = QFontMetricsF (m_font);
2112 QColor c = schemeWindow.background().color();
2113 m_templateBackgroundColor = config.
readEntry(
QString(
"Color Template Background"), c);
2116 m_templateFocusedEditablePlaceholderColor = config.
readEntry(
QString(
"Color Template Focused Editable Placeholder"), c);
2119 m_templateEditablePlaceholderColor = config.
readEntry(
QString(
"Color Template Editable Placeholder"), c);
2122 m_templateNotEditablePlaceholderColor = config.
readEntry(
QString(
"Color Template Not Editable Placeholder"), c);
2124 m_templateColorsSet=
true;
2132 return s_global->
font();
2138 return m_fontMetrics;
2145 if (m_fontSet && m_font == font)
2152 m_fontMetrics = QFontMetricsF (m_font);
2159 if (m_wordWrapMarkerSet ||
isGlobal())
2160 return m_wordWrapMarker;
2167 if (m_wordWrapMarkerSet && m_wordWrapMarker == on)
2172 m_wordWrapMarkerSet =
true;
2173 m_wordWrapMarker = on;
2180 if (m_backgroundColorSet ||
isGlobal())
2181 return m_backgroundColor;
2188 if (m_backgroundColorSet && m_backgroundColor == col)
2193 m_backgroundColorSet =
true;
2194 m_backgroundColor = col;
2201 if (m_selectionColorSet ||
isGlobal())
2202 return m_selectionColor;
2209 if (m_selectionColorSet && m_selectionColor == col)
2214 m_selectionColorSet =
true;
2215 m_selectionColor = col;
2222 if (m_highlightedLineColorSet ||
isGlobal())
2223 return m_highlightedLineColor;
2230 if (m_highlightedLineColorSet && m_highlightedLineColor == col)
2235 m_highlightedLineColorSet =
true;
2236 m_highlightedLineColor = col;
2244 if (type > 0) {
while((type >> index++) ^ 1) {} }
2253 if (m_lineMarkerColorSet[index] ||
isGlobal())
2254 return m_lineMarkerColor[index];
2261 int index =
static_cast<int>( log(static_cast<double>(type)) / log(2.0) );
2264 if (m_lineMarkerColorSet[index] && m_lineMarkerColor[index] == col)
2269 m_lineMarkerColorSet[index] =
true;
2270 m_lineMarkerColor[index] = col;
2277 if (m_highlightedBracketColorSet ||
isGlobal())
2278 return m_highlightedBracketColor;
2285 if (m_highlightedBracketColorSet && m_highlightedBracketColor == col)
2290 m_highlightedBracketColorSet =
true;
2291 m_highlightedBracketColor = col;
2298 if (m_wordWrapMarkerColorSet ||
isGlobal())
2299 return m_wordWrapMarkerColor;
2306 if (m_wordWrapMarkerColorSet && m_wordWrapMarkerColor == col)
2311 m_wordWrapMarkerColorSet =
true;
2312 m_wordWrapMarkerColor = col;
2319 if (m_tabMarkerColorSet ||
isGlobal())
2320 return m_tabMarkerColor;
2327 if (m_tabMarkerColorSet && m_tabMarkerColor == col)
2332 m_tabMarkerColorSet =
true;
2333 m_tabMarkerColor = col;
2340 if (m_indentationLineColorSet ||
isGlobal())
2341 return m_indentationLineColor;
2348 if (m_indentationLineColorSet && m_indentationLineColor == col)
2353 m_indentationLineColorSet =
true;
2354 m_indentationLineColor = col;
2361 if (m_iconBarColorSet ||
isGlobal())
2362 return m_iconBarColor;
2369 if (m_iconBarColorSet && m_iconBarColor == col)
2374 m_iconBarColorSet =
true;
2375 m_iconBarColor = col;
2382 if (m_foldingColorSet ||
isGlobal())
2383 return m_foldingColor;
2390 if (m_foldingColorSet && m_foldingColor == col)
2395 m_foldingColorSet =
true;
2396 m_foldingColor = col;
2403 if (m_templateColorsSet ||
isGlobal())
2404 return m_templateBackgroundColor;
2411 if (m_templateColorsSet ||
isGlobal())
2412 return m_templateEditablePlaceholderColor;
2419 if (m_templateColorsSet ||
isGlobal())
2420 return m_templateFocusedEditablePlaceholderColor;
2427 if (m_templateColorsSet ||
isGlobal())
2428 return m_templateNotEditablePlaceholderColor;
2435 if (m_lineNumberColorSet ||
isGlobal())
2436 return m_lineNumberColor;
2443 if (m_lineNumberColorSet && m_lineNumberColor == col)
2448 m_lineNumberColorSet =
true;
2449 m_lineNumberColor = col;
2456 if (m_separatorColorSet ||
isGlobal())
2457 return m_separatorColor;
2464 if (m_separatorColorSet && m_separatorColor == col)
2469 m_separatorColorSet =
true;
2470 m_separatorColor = col;
2477 if (m_spellingMistakeLineColorSet ||
isGlobal())
2478 return m_spellingMistakeLineColor;
2485 if (m_spellingMistakeLineColorSet && m_spellingMistakeLineColor == col)
2490 m_spellingMistakeLineColorSet =
true;
2491 m_spellingMistakeLineColor = col;
2498 if (m_modifiedLineColorSet ||
isGlobal())
2499 return m_modifiedLineColor;
2506 if (m_modifiedLineColorSet && m_modifiedLineColor == col)
2511 m_modifiedLineColorSet =
true;
2512 m_modifiedLineColor = col;
2519 if (m_savedLineColorSet ||
isGlobal())
2520 return m_savedLineColor;
2527 if (m_savedLineColorSet && m_savedLineColor == col)
2532 m_savedLineColorSet =
true;
2533 m_savedLineColor = col;
2540 if (m_searchHighlightColorSet ||
isGlobal())
2541 return m_searchHighlightColor;
2548 if (m_searchHighlightColorSet && m_searchHighlightColor == col)
2553 m_searchHighlightColorSet =
true;
2554 m_searchHighlightColor = col;
2561 if (m_replaceHighlightColorSet ||
isGlobal())
2562 return m_replaceHighlightColor;
2569 if (m_replaceHighlightColorSet && m_replaceHighlightColor == col)
2574 m_replaceHighlightColorSet =
true;
2575 m_replaceHighlightColor = col;
2583 if (m_showIndentationLinesSet ||
isGlobal())
2584 return m_showIndentationLines;
2591 if (m_showIndentationLinesSet && m_showIndentationLines == on)
2596 m_showIndentationLinesSet =
true;
2597 m_showIndentationLines = on;
2604 if (m_showWholeBracketExpressionSet ||
isGlobal())
2605 return m_showWholeBracketExpression;
2612 if (m_showWholeBracketExpressionSet && m_showWholeBracketExpression == on)
2617 m_showWholeBracketExpressionSet =
true;
2618 m_showWholeBracketExpression = on;
void setKeepExtraSpaces(bool on)
QTextCodec * codecForName(const QString &name) const
bool showWholeBracketExpression() const
void setWordCompletionRemoveTail(bool on)
void setSchema(const QString &schema)
const QString & backupPrefix() const
bool keepExtraSpaces() const
const QColor & selectionColor() const
void setIndentationMode(const QString &identationMode)
bool viInputModeEmulateCommandBar() const
bool wordWrapMarker() const
void setViInputModeStealKeys(bool on)
const QColor & highlightedBracketColor() const
QList< KateDocument * > & kateDocuments()
return a list of all registered docs
void setHighlightedBracketColor(const QColor &col)
virtual void updateConfig()=0
do the real update
KateRenderer * renderer()
const QColor & lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type=KTextEditor::MarkInterface::markType01) const
void setTabHandling(uint tabHandling)
bool smartCopyCut() const
bool scrollBarMarks() const
bool onTheFlySpellCheck() const
void setAllowEolDetection(bool on)
const QColor & replaceHighlightColor() const
void setNewLineAtEof(bool on)
void setFoldingColor(const QColor &col)
void setLineMarkerColor(const QColor &col, KTextEditor::MarkInterface::MarkTypes type=KTextEditor::MarkInterface::markType01)
void setViInputModeEmulateCommandBar(bool on)
bool scrollBarMiniMap() const
bool lineModification() const
int wordCompletionMinimalWordLength() const
void setBackupSuffix(const QString &suffix)
bool indentPastedText() const
void setScrollBarMiniMapAll(bool on)
void setLineModification(bool on)
void setTabIndents(bool on)
QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
void configEnd()
end a config change transaction, update the concerned documents/views/renderers
void setWordCompletion(bool on)
void writeConfig(KConfigGroup &config)
Write config to object.
const QColor & iconBarColor() const
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
void readConfig(const KConfigGroup &config)
Read config from object.
void setFont(const QFont &font)
static KateGlobal * self()
Kate Part Internal stuff ;)
void setSwapFileNoSync(bool on)
const QColor & wordWrapMarkerColor() const
void setSelectionColor(const QColor &col)
const QColor & foldingColor() const
void setSpellingMistakeLineColor(const QColor &col)
void setModifiedLineColor(const QColor &col)
QTextCodec * codec() const
void setScrollBarMarks(bool on)
KSharedConfigPtr config()
const QColor & indentationLineColor() const
const QColor & lineNumberColor() const
bool wordCompletionRemoveTail() const
void setDynWordWrapAlignIndent(int indent)
void configStart()
start some config changes this method is needed to init some kind of transaction for config changes...
void setScrollPastEnd(bool on)
int dynWordWrapAlignIndent() const
const QColor & modifiedLineColor() const
qreal luma(const QColor &)
bool scrollBarMiniMapAll() const
void setOnTheFlySpellCheck(bool on)
bool replaceTabsDyn() const
Handles all of the work of rendering the text (used for the views and printing)
QTextCodec * fallbackCodec() const
void setBackspaceIndents(bool on)
const QColor & templateBackgroundColor() const
void setViInputMode(bool on)
void setShowWholeBracketExpression(bool on)
const QString & backupSuffix() const
QTextCodec * codecForEncoding() const
void setAutoCenterLines(int lines)
KateRendererConfig * config() const
Configuration.
void setProberType(KEncodingProber::ProberType proberType)
const QColor & templateEditablePlaceholderColor() const
KateConfig()
Default Constructor.
void setWordWrapAt(int col)
void setDefaultEncoding(const QString &defaultEncoding)
bool viInputModeStealKeys() const
void setWordCompletionMinimalWordLength(int length)
void updateConfig()
do the real update
const QString & fallbackEncoding() const
~KateDocumentConfig()
Cu DocumentConfig.
bool persistentSelection() const
void setLineNumberColor(const QColor &col)
void setPersistentSelection(bool on)
QStringListModel * replacementHistoryModel()
QList< KateView * > & views()
return a list of all registered views
void setLineLengthLimit(int limit)
void setTabMarkerColor(const QColor &col)
KEncodingProber::ProberType proberType() const
void setBackgroundColor(const QColor &col)
void setSmartHome(bool on)
void updateConfig()
do the real update
void setDefaultMarkType(uint type)
QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
const QColor & tabMarkerColor() const
void setRemoveSpaces(int triState)
Remove trailing spaces on save.
void reloadSchema()
Reload the schema from the schema manager.
~KateRendererConfig()
Cu DocumentConfig.
bool allowEolDetection() const
bool wordCompletion() const
void setIndentationLineColor(const QColor &col)
void setShowTabs(bool on)
void setShowIndentationLines(bool on)
void writeConfig(KConfigGroup &config)
Write config to object.
const QString & encoding() const
void readConfig(const KConfigGroup &config)
Read config from object.
void setWordWrapMarker(bool on)
void setBackupPrefix(const QString &prefix)
void updateConfig()
do the real update
const QColor & highlightedLineColor() const
void setSearchDirConfigDepth(int depth)
void setAutomaticCompletionInvocation(bool on)
void writeConfig(KConfigGroup &config)
Write config to object.
bool allowMarkMenu() const
KateSchemaManager * schemaManager()
manager for the katepart schemas
void setUndoMergeAllEdits(bool merge)
void setFoldingBar(bool on)
void setAllowSimpleMode(bool on)
KConfigGroup schema(const QString &name)
return kconfiggroup for the given schema
const QString & indentationMode() const
void setSearchHighlightColor(const QColor &col)
int indentationWidth() const
void setWordWrap(bool on)
const QString & schema() const
int autoCenterLines() const
~KateViewConfig()
Cu DocumentConfig.
const QColor & separatorColor() const
void setSavedLineColor(const QColor &col)
bool swapFileNoSync() const
bool automaticCompletionInvocation() const
void updateConfig()
do the real update
const QFont & font() const
void setShowSpaces(bool on)
void setPageUpDownMovesCursor(bool on)
int scrollBarMiniMapWidth() const
const QColor & savedLineColor() const
void setBookmarkSort(int mode)
void setSmartCopyCut(bool on)
void readConfig(const KConfigGroup &config)
Read config from object.
bool scrollPastEnd() const
bool setFallbackEncoding(const QString &encoding)
const QColor & searchHighlightColor() const
static int reservedMarkersCount()
bool isSetEncoding() const
void setReplaceTabsDyn(bool on)
const QColor & backgroundColor() const
bool pageUpDownMovesCursor() const
void setWordWrapMarkerColor(const QColor &col)
bool showIndentationLines() const
void writeConfig(KConfigGroup &config)
Write config to object.
void setLineNumbers(bool on)
void setIconBarColor(const QColor &col)
KateDocument * doc()
accessor to katedocument pointer
bool tabIndentsEnabled() const
const QColor & templateNotEditablePlaceholderColor() const
uint defaultMarkType() const
int dynWordWrapIndicators() const
void setScrollBarMiniMapWidth(int width)
const QFontMetricsF & fontMetrics() const
void setIndentPastedText(bool on)
int lineLengthLimit() const
void setReplaceHighlightColor(const QColor &col)
int maxHistorySize() const
static const char *const KEY_REPLACEMENT_HISTORY
void setAllowMarkMenu(bool allow)
virtual ~KateConfig()
Virtual Destructor.
void setDynWordWrap(bool wrap)
bool backspaceIndents() const
void setTabWidth(int tabWidth)
static const char *const KEY_PATTERN_HISTORY
T readEntry(const QString &key, const T &aDefault) const
int searchDirConfigDepth() const
Should Kate Part search for dir wide config file and if, how depth?
void setSeparatorColor(const QColor &col)
void setIndentationWidth(int indentationWidth)
static const char *const KEY_SEARCH_REPLACE_FLAGS
bool allowSimpleMode() const
void setHighlightedLineColor(const QColor &col)
QStringListModel * patternHistoryModel()
void readConfig(const KConfigGroup &config)
Read config from object.
void setScrollBarMiniMap(bool on)
const QColor & spellingMistakeLineColor() const
void setDynWordWrapIndicators(int mode)
void setSearchFlags(long flags)
bool setEncoding(const QString &encoding)
const QColor & templateFocusedEditablePlaceholderColor() const
bool newLineAtEof() const
void setBackupFlags(uint flags)
indents in leading space, otherwise inserts tab