19 #ifndef __KATE_CONFIG_H__
20 #define __KATE_CONFIG_H__
27 #include <QtCore/QBitRef>
28 #include <QtGui/QColor>
29 #include <QtCore/QObject>
30 #include <QtCore/QVector>
31 #include <QtGui/QFontMetricsF>
32 #include <QStringListModel>
85 uint configSessionNumber;
133 QTextCodec *fallbackCodec ()
const;
134 const QString &fallbackEncoding ()
const;
135 bool setFallbackEncoding (
const QString &encoding);
167 inline bool isGlobal ()
const {
return (
this == global()); }
184 int tabWidth ()
const;
185 void setTabWidth (
int tabWidth);
187 int indentationWidth ()
const;
188 void setIndentationWidth (
int indentationWidth);
190 const QString &indentationMode ()
const;
191 void setIndentationMode (
const QString &identationMode);
200 uint tabHandling ()
const;
201 void setTabHandling (uint tabHandling);
203 bool wordWrap ()
const;
204 void setWordWrap (
bool on);
206 int wordWrapAt ()
const;
207 void setWordWrapAt (
int col);
209 bool pageUpDownMovesCursor ()
const;
210 void setPageUpDownMovesCursor (
bool on);
212 void setKeepExtraSpaces (
bool on);
213 bool keepExtraSpaces ()
const;
215 void setIndentPastedText (
bool on);
216 bool indentPastedText ()
const;
218 void setBackspaceIndents (
bool on);
219 bool backspaceIndents ()
const;
221 void setSmartHome (
bool on);
222 bool smartHome ()
const;
224 void setShowTabs (
bool on);
225 bool showTabs()
const;
227 void setShowSpaces (
bool on);
228 bool showSpaces()
const;
230 void setReplaceTabsDyn (
bool on);
231 bool replaceTabsDyn()
const;
239 void setRemoveSpaces (
int triState);
240 int removeSpaces ()
const;
242 void setNewLineAtEof (
bool on);
243 bool newLineAtEof ()
const;
245 void setOvr (
bool on);
248 void setTabIndents (
bool on);
249 bool tabIndentsEnabled ()
const;
251 QTextCodec *codec ()
const;
252 const QString &encoding ()
const;
253 bool setEncoding (
const QString &encoding);
254 bool isSetEncoding ()
const;
266 void setEol (
int mode);
269 void setBom(
bool bom);
271 bool allowEolDetection ()
const;
272 void setAllowEolDetection (
bool on);
274 bool allowSimpleMode ()
const;
275 void setAllowSimpleMode (
bool on);
283 uint backupFlags ()
const;
284 void setBackupFlags (uint flags);
286 const QString &backupPrefix ()
const;
287 void setBackupPrefix (
const QString &prefix);
289 const QString &backupSuffix ()
const;
290 void setBackupSuffix (
const QString &suffix);
292 bool swapFileNoSync()
const;
293 void setSwapFileNoSync(
bool on);
300 int searchDirConfigDepth ()
const;
302 void setSearchDirConfigDepth (
int depth);
304 bool onTheFlySpellCheck()
const;
305 void setOnTheFlySpellCheck(
bool on);
307 int lineLengthLimit()
const;
308 void setLineLengthLimit(
int limit);
313 int m_indentationWidth;
319 bool m_pageUpDownMovesCursor;
320 bool m_allowEolDetection;
321 bool m_allowSimpleMode;
325 int m_searchDirConfigDepth;
329 bool m_swapFileNoSync;
330 bool m_onTheFlySpellCheck;
331 int m_lineLengthLimit;
333 bool m_tabWidthSet : 1;
334 bool m_indentationWidthSet : 1;
335 bool m_indentationModeSet : 1;
336 bool m_wordWrapSet : 1;
337 bool m_wordWrapAtSet : 1;
338 bool m_pageUpDownMovesCursorSet : 1;
340 bool m_keepExtraSpacesSet : 1;
341 bool m_keepExtraSpaces : 1;
342 bool m_indentPastedTextSet : 1;
343 bool m_indentPastedText : 1;
344 bool m_backspaceIndentsSet : 1;
345 bool m_backspaceIndents : 1;
346 bool m_smartHomeSet : 1;
347 bool m_smartHome : 1;
348 bool m_showTabsSet : 1;
350 bool m_showSpacesSet : 1;
351 bool m_showSpaces : 1;
352 bool m_replaceTabsDynSet : 1;
353 bool m_replaceTabsDyn : 1;
354 bool m_removeSpacesSet : 1;
355 uint m_removeSpaces : 2;
356 bool m_newLineAtEofSet : 1;
357 bool m_newLineAtEof : 1;
358 bool m_overwiteModeSet : 1;
359 bool m_overwiteMode : 1;
360 bool m_tabIndentsSet : 1;
361 bool m_tabIndents : 1;
363 bool m_encodingSet : 1;
366 bool m_allowEolDetectionSet : 1;
367 bool m_allowSimpleModeSet : 1;
368 bool m_backupFlagsSet : 1;
369 bool m_searchDirConfigDepthSet : 1;
370 bool m_backupPrefixSet : 1;
371 bool m_backupSuffixSet : 1;
372 bool m_swapFileNoSyncSet : 1;
373 bool m_onTheFlySpellCheckSet : 1;
374 bool m_lineLengthLimitSet : 1;
404 inline bool isGlobal ()
const {
return (
this == global()); }
421 bool dynWordWrap ()
const;
422 void setDynWordWrap (
bool wrap);
424 int dynWordWrapIndicators ()
const;
425 void setDynWordWrapIndicators (
int mode);
427 int dynWordWrapAlignIndent ()
const;
428 void setDynWordWrapAlignIndent (
int indent);
430 bool lineNumbers ()
const;
431 void setLineNumbers (
bool on);
433 bool scrollBarMarks ()
const;
434 void setScrollBarMarks (
bool on);
436 bool scrollBarMiniMap ()
const;
437 void setScrollBarMiniMap (
bool on);
439 bool scrollBarMiniMapAll ()
const;
440 void setScrollBarMiniMapAll (
bool on);
442 int scrollBarMiniMapWidth ()
const;
443 void setScrollBarMiniMapWidth (
int width);
445 bool iconBar ()
const;
446 void setIconBar (
bool on);
448 bool foldingBar ()
const;
449 void setFoldingBar (
bool on);
451 bool lineModification()
const;
452 void setLineModification(
bool on);
454 int bookmarkSort ()
const;
455 void setBookmarkSort (
int mode);
457 int autoCenterLines()
const;
458 void setAutoCenterLines (
int lines);
461 IncMatchCase = 1 << 0,
462 IncHighlightAll = 1 << 1,
463 IncFromCursor = 1 << 2,
464 PowerMatchCase = 1 << 3,
465 PowerHighlightAll = 1 << 4,
466 PowerFromCursor = 1 << 5,
468 PowerModePlainText = 1 << 7,
469 PowerModeWholeWords = 1 << 8,
470 PowerModeEscapeSequences = 1 << 9,
471 PowerModeRegularExpression = 1 << 10,
472 PowerUsePlaceholders = 1 << 11
475 long searchFlags ()
const;
476 void setSearchFlags (
long flags);
478 int maxHistorySize()
const;
480 QStringListModel *patternHistoryModel();
481 QStringListModel *replacementHistoryModel();
483 uint defaultMarkType ()
const;
484 void setDefaultMarkType (uint type);
486 bool allowMarkMenu ()
const;
487 void setAllowMarkMenu (
bool allow);
489 bool persistentSelection ()
const;
490 void setPersistentSelection (
bool on);
492 bool viInputMode ()
const;
493 void setViInputMode (
bool on);
495 bool viInputModeStealKeys ()
const;
496 void setViInputModeStealKeys (
bool on);
498 bool viInputModeEmulateCommandBar()
const;
499 void setViInputModeEmulateCommandBar(
bool on);
511 bool automaticCompletionInvocation ()
const;
512 void setAutomaticCompletionInvocation (
bool on);
514 bool wordCompletion ()
const;
515 void setWordCompletion (
bool on);
517 int wordCompletionMinimalWordLength ()
const;
518 void setWordCompletionMinimalWordLength (
int length);
520 bool wordCompletionRemoveTail ()
const;
521 void setWordCompletionRemoveTail (
bool on);
523 bool smartCopyCut()
const;
524 void setSmartCopyCut(
bool on);
526 bool scrollPastEnd()
const;
527 void setScrollPastEnd(
bool on);
531 int m_dynWordWrapIndicators;
532 int m_dynWordWrapAlignIndent;
534 bool m_scrollBarMarks;
535 bool m_scrollBarMiniMap;
536 bool m_scrollBarMiniMapAll;
537 int m_scrollBarMiniMapWidth;
540 bool m_lineModification;
542 int m_autoCenterLines;
544 int m_maxHistorySize;
545 QStringListModel m_patternHistoryModel;
546 QStringListModel m_replacementHistoryModel;
547 uint m_defaultMarkType;
548 bool m_persistentSelection;
550 bool m_viInputModeStealKeys;
551 bool m_viInputModeEmulateCommandBar;
552 bool m_automaticCompletionInvocation;
553 bool m_wordCompletion;
554 int m_wordCompletionMinimalWordLength;
555 bool m_wordCompletionRemoveTail;
557 bool m_scrollPastEnd;
559 bool m_dynWordWrapSet : 1;
560 bool m_dynWordWrapIndicatorsSet : 1;
561 bool m_dynWordWrapAlignIndentSet : 1;
562 bool m_lineNumbersSet : 1;
563 bool m_scrollBarMarksSet : 1;
564 bool m_scrollBarMiniMapSet : 1;
565 bool m_scrollBarMiniMapAllSet : 1;
566 bool m_scrollBarMiniMapWidthSet : 1;
567 bool m_iconBarSet : 1;
568 bool m_foldingBarSet : 1;
569 bool m_lineModificationSet : 1;
570 bool m_bookmarkSortSet : 1;
571 bool m_autoCenterLinesSet : 1;
572 bool m_searchFlagsSet : 1;
573 bool m_defaultMarkTypeSet : 1;
574 bool m_persistentSelectionSet : 1;
575 bool m_viInputModeSet : 1;
576 bool m_viInputModeStealKeysSet : 1;
577 bool m_viInputModeEmulateCommandBarSet : 1;
578 bool m_automaticCompletionInvocationSet : 1;
579 bool m_wordCompletionSet : 1;
580 bool m_wordCompletionMinimalWordLengthSet : 1;
581 bool m_smartCopyCutSet : 1;
582 bool m_scrollPastEndSet : 1;
583 bool m_allowMarkMenu : 1;
584 bool m_wordCompletionRemoveTailSet : 1;
615 inline bool isGlobal ()
const {
return (
this == global()); }
632 const QString &schema ()
const;
633 void setSchema (
const QString &schema);
642 const QFont& font()
const;
643 const QFontMetricsF& fontMetrics()
const;
644 void setFont(
const QFont &font);
646 bool wordWrapMarker ()
const;
647 void setWordWrapMarker (
bool on);
649 const QColor& backgroundColor()
const;
650 void setBackgroundColor (
const QColor &col);
652 const QColor& selectionColor()
const;
653 void setSelectionColor (
const QColor &col);
655 const QColor& highlightedLineColor()
const;
656 void setHighlightedLineColor (
const QColor &col);
661 const QColor& highlightedBracketColor()
const;
662 void setHighlightedBracketColor (
const QColor &col);
664 const QColor& wordWrapMarkerColor()
const;
665 void setWordWrapMarkerColor (
const QColor &col);
667 const QColor& tabMarkerColor()
const;
668 void setTabMarkerColor (
const QColor &col);
670 const QColor& indentationLineColor()
const;
671 void setIndentationLineColor (
const QColor &col);
673 const QColor& iconBarColor()
const;
674 void setIconBarColor (
const QColor &col);
676 const QColor& foldingColor()
const;
677 void setFoldingColor (
const QColor &col);
680 const QColor& lineNumberColor()
const;
681 void setLineNumberColor (
const QColor &col);
684 const QColor& separatorColor()
const;
685 void setSeparatorColor(
const QColor &col);
687 const QColor& spellingMistakeLineColor()
const;
688 void setSpellingMistakeLineColor (
const QColor &col);
690 bool showIndentationLines ()
const;
691 void setShowIndentationLines (
bool on);
693 bool showWholeBracketExpression ()
const;
694 void setShowWholeBracketExpression (
bool on);
696 const QColor &templateBackgroundColor()
const;
697 const QColor &templateEditablePlaceholderColor()
const;
698 const QColor &templateFocusedEditablePlaceholderColor()
const;
699 const QColor &templateNotEditablePlaceholderColor()
const;
701 const QColor& modifiedLineColor()
const;
702 void setModifiedLineColor(
const QColor &col);
704 const QColor& savedLineColor()
const;
705 void setSavedLineColor(
const QColor &col);
707 const QColor& searchHighlightColor()
const;
708 void setSearchHighlightColor(
const QColor &col);
710 const QColor& replaceHighlightColor()
const;
711 void setReplaceHighlightColor(
const QColor &col);
717 void setSchemaInternal(
const QString &schema);
721 QFontMetricsF m_fontMetrics;
722 bool m_wordWrapMarker;
723 bool m_showIndentationLines;
724 bool m_showWholeBracketExpression;
727 QColor m_highlightedLineColor;
728 QColor m_highlightedBracketColor;
729 QColor m_wordWrapMarkerColor;
731 QColor m_indentationLineColor;
736 QColor m_spellingMistakeLineColor;
737 QVector<QColor> m_lineMarkerColor;
739 QColor m_templateBackgroundColor;
740 QColor m_templateEditablePlaceholderColor;
741 QColor m_templateFocusedEditablePlaceholderColor;
742 QColor m_templateNotEditablePlaceholderColor;
744 QColor m_modifiedLineColor;
746 QColor m_searchHighlightColor;
747 QColor m_replaceHighlightColor;
749 bool m_schemaSet : 1;
751 bool m_wordWrapMarkerSet : 1;
752 bool m_showIndentationLinesSet : 1;
753 bool m_showWholeBracketExpressionSet : 1;
754 bool m_backgroundColorSet : 1;
755 bool m_selectionColorSet : 1;
756 bool m_highlightedLineColorSet : 1;
757 bool m_highlightedBracketColorSet : 1;
758 bool m_wordWrapMarkerColorSet : 1;
759 bool m_tabMarkerColorSet : 1;
760 bool m_indentationLineColorSet : 1;
761 bool m_iconBarColorSet : 1;
762 bool m_foldingColorSet : 1;
763 bool m_lineNumberColorSet : 1;
764 bool m_separatorColorSet : 1;
765 bool m_spellingMistakeLineColorSet : 1;
766 bool m_templateColorsSet : 1;
767 bool m_modifiedLineColorSet : 1;
768 bool m_savedLineColorSet : 1;
769 bool m_searchHighlightColorSet : 1;
770 bool m_replaceHighlightColorSet : 1;
771 QBitArray m_lineMarkerColorSet;
void writeConfig(KConfig *config=0)
Write editor configuration to given config object.
Base Class for the Kate Config Classes.
virtual void updateConfig()=0
do the real update
void configEnd()
end a config change transaction, update the concerned documents/views/renderers
#define KATEPART_TESTS_EXPORT
void configStart()
start some config changes this method is needed to init some kind of transaction for config changes...
Handles all of the work of rendering the text (used for the views and printing)
KateConfig()
Default Constructor.
friend class KateDocumentConfig
static KateRendererConfig * global()
KEncodingProber::ProberType proberType() const
static KateGlobalConfig * global()
void readConfig(KConfig *config=0)
Configuration management.
KateGlobal One instance of this class is hold alive during a kate part session, as long as any factor...
static KateDocumentConfig * global()
virtual ~KateConfig()
Virtual Destructor.
static KateViewConfig * global()