19 #ifndef __KATE_CONFIG_H__
20 #define __KATE_CONFIG_H__
24 #include <ktexteditor/markinterface.h>
25 #include <kencodingprober.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;
131 void setProberType (KEncodingProber::ProberType proberType);
134 const QString &fallbackEncoding ()
const;
135 bool setFallbackEncoding (
const QString &encoding);
138 KEncodingProber::ProberType m_proberType;
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;
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);
452 int showScrollbars ()
const;
453 void setShowScrollbars (
int mode);
455 bool iconBar ()
const;
456 void setIconBar (
bool on);
458 bool foldingBar ()
const;
459 void setFoldingBar (
bool on);
461 bool lineModification()
const;
462 void setLineModification(
bool on);
464 int bookmarkSort ()
const;
465 void setBookmarkSort (
int mode);
467 int autoCenterLines()
const;
468 void setAutoCenterLines (
int lines);
471 IncMatchCase = 1 << 0,
472 IncHighlightAll = 1 << 1,
473 IncFromCursor = 1 << 2,
474 PowerMatchCase = 1 << 3,
475 PowerHighlightAll = 1 << 4,
476 PowerFromCursor = 1 << 5,
478 PowerModePlainText = 1 << 7,
479 PowerModeWholeWords = 1 << 8,
480 PowerModeEscapeSequences = 1 << 9,
481 PowerModeRegularExpression = 1 << 10,
482 PowerUsePlaceholders = 1 << 11
485 long searchFlags ()
const;
486 void setSearchFlags (
long flags);
488 int maxHistorySize()
const;
493 uint defaultMarkType ()
const;
494 void setDefaultMarkType (uint type);
496 bool allowMarkMenu ()
const;
497 void setAllowMarkMenu (
bool allow);
499 bool persistentSelection ()
const;
500 void setPersistentSelection (
bool on);
502 bool viInputMode ()
const;
503 void setViInputMode (
bool on);
505 bool viInputModeStealKeys ()
const;
506 void setViInputModeStealKeys (
bool on);
508 bool viRelativeLineNumbers()
const;
509 void setViRelativeLineNumbers(
bool on);
511 bool viInputModeEmulateCommandBar()
const;
512 void setViInputModeEmulateCommandBar(
bool on);
524 bool automaticCompletionInvocation ()
const;
525 void setAutomaticCompletionInvocation (
bool on);
527 bool wordCompletion ()
const;
528 void setWordCompletion (
bool on);
530 bool keywordCompletion ()
const;
531 void setKeywordCompletion (
bool on);
533 int wordCompletionMinimalWordLength ()
const;
534 void setWordCompletionMinimalWordLength (
int length);
536 bool wordCompletionRemoveTail ()
const;
537 void setWordCompletionRemoveTail (
bool on);
539 bool smartCopyCut()
const;
540 void setSmartCopyCut(
bool on);
542 bool scrollPastEnd()
const;
543 void setScrollPastEnd(
bool on);
545 bool foldFirstLine()
const;
546 void setFoldFirstLine(
bool on);
550 int m_dynWordWrapIndicators;
551 int m_dynWordWrapAlignIndent;
553 bool m_scrollBarMarks;
554 bool m_scrollBarMiniMap;
555 bool m_scrollBarMiniMapAll;
556 int m_scrollBarMiniMapWidth;
557 int m_showScrollbars;
560 bool m_lineModification;
562 int m_autoCenterLines;
564 int m_maxHistorySize;
567 uint m_defaultMarkType;
568 bool m_persistentSelection;
570 bool m_viInputModeStealKeys;
571 bool m_viRelativeLineNumbers;
572 bool m_viInputModeEmulateCommandBar;
573 bool m_automaticCompletionInvocation;
574 bool m_wordCompletion;
575 bool m_keywordCompletion;
576 int m_wordCompletionMinimalWordLength;
577 bool m_wordCompletionRemoveTail;
579 bool m_scrollPastEnd;
580 bool m_foldFirstLine;
582 bool m_dynWordWrapSet : 1;
583 bool m_dynWordWrapIndicatorsSet : 1;
584 bool m_dynWordWrapAlignIndentSet : 1;
585 bool m_lineNumbersSet : 1;
586 bool m_scrollBarMarksSet : 1;
587 bool m_scrollBarMiniMapSet : 1;
588 bool m_scrollBarMiniMapAllSet : 1;
589 bool m_scrollBarMiniMapWidthSet : 1;
590 bool m_showScrollbarsSet : 1;
591 bool m_iconBarSet : 1;
592 bool m_foldingBarSet : 1;
593 bool m_lineModificationSet : 1;
594 bool m_bookmarkSortSet : 1;
595 bool m_autoCenterLinesSet : 1;
596 bool m_searchFlagsSet : 1;
597 bool m_defaultMarkTypeSet : 1;
598 bool m_persistentSelectionSet : 1;
599 bool m_viInputModeSet : 1;
600 bool m_viInputModeStealKeysSet : 1;
601 bool m_viRelativeLineNumbersSet : 1;
602 bool m_viInputModeEmulateCommandBarSet : 1;
603 bool m_automaticCompletionInvocationSet : 1;
604 bool m_wordCompletionSet : 1;
605 bool m_keywordCompletionSet : 1;
606 bool m_wordCompletionMinimalWordLengthSet : 1;
607 bool m_smartCopyCutSet : 1;
608 bool m_scrollPastEndSet : 1;
609 bool m_allowMarkMenu : 1;
610 bool m_wordCompletionRemoveTailSet : 1;
611 bool m_foldFirstLineSet : 1;
642 inline bool isGlobal ()
const {
return (
this == global()); }
659 const QString &schema ()
const;
660 void setSchema (
const QString &schema);
669 const QFont& font()
const;
671 void setFont(
const QFont &font);
673 bool wordWrapMarker ()
const;
674 void setWordWrapMarker (
bool on);
676 const QColor& backgroundColor()
const;
677 void setBackgroundColor (
const QColor &col);
679 const QColor& selectionColor()
const;
680 void setSelectionColor (
const QColor &col);
682 const QColor& highlightedLineColor()
const;
683 void setHighlightedLineColor (
const QColor &col);
685 const QColor& lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01)
const;
686 void setLineMarkerColor (
const QColor &col, KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01);
688 const QColor& highlightedBracketColor()
const;
689 void setHighlightedBracketColor (
const QColor &col);
691 const QColor& wordWrapMarkerColor()
const;
692 void setWordWrapMarkerColor (
const QColor &col);
694 const QColor& tabMarkerColor()
const;
695 void setTabMarkerColor (
const QColor &col);
697 const QColor& indentationLineColor()
const;
698 void setIndentationLineColor (
const QColor &col);
700 const QColor& iconBarColor()
const;
701 void setIconBarColor (
const QColor &col);
703 const QColor& foldingColor()
const;
704 void setFoldingColor (
const QColor &col);
707 const QColor& lineNumberColor()
const;
708 void setLineNumberColor (
const QColor &col);
711 const QColor& separatorColor()
const;
712 void setSeparatorColor(
const QColor &col);
714 const QColor& spellingMistakeLineColor()
const;
715 void setSpellingMistakeLineColor (
const QColor &col);
717 bool showIndentationLines ()
const;
718 void setShowIndentationLines (
bool on);
720 bool showWholeBracketExpression ()
const;
721 void setShowWholeBracketExpression (
bool on);
723 bool animateBracketMatching ()
const;
724 void setAnimateBracketMatching (
bool on);
726 const QColor &templateBackgroundColor()
const;
727 const QColor &templateEditablePlaceholderColor()
const;
728 const QColor &templateFocusedEditablePlaceholderColor()
const;
729 const QColor &templateNotEditablePlaceholderColor()
const;
731 const QColor& modifiedLineColor()
const;
732 void setModifiedLineColor(
const QColor &col);
734 const QColor& savedLineColor()
const;
735 void setSavedLineColor(
const QColor &col);
737 const QColor& searchHighlightColor()
const;
738 void setSearchHighlightColor(
const QColor &col);
740 const QColor& replaceHighlightColor()
const;
741 void setReplaceHighlightColor(
const QColor &col);
747 void setSchemaInternal(
const QString &schema);
754 QColor m_highlightedLineColor;
755 QColor m_highlightedBracketColor;
756 QColor m_wordWrapMarkerColor;
758 QColor m_indentationLineColor;
763 QColor m_spellingMistakeLineColor;
766 QColor m_templateBackgroundColor;
767 QColor m_templateEditablePlaceholderColor;
768 QColor m_templateFocusedEditablePlaceholderColor;
769 QColor m_templateNotEditablePlaceholderColor;
771 QColor m_modifiedLineColor;
773 QColor m_searchHighlightColor;
774 QColor m_replaceHighlightColor;
776 bool m_wordWrapMarker;
777 bool m_showIndentationLines;
778 bool m_showWholeBracketExpression;
779 bool m_animateBracketMatching;
781 bool m_schemaSet : 1;
783 bool m_wordWrapMarkerSet : 1;
784 bool m_showIndentationLinesSet : 1;
785 bool m_showWholeBracketExpressionSet : 1;
786 bool m_backgroundColorSet : 1;
787 bool m_selectionColorSet : 1;
788 bool m_highlightedLineColorSet : 1;
789 bool m_highlightedBracketColorSet : 1;
790 bool m_wordWrapMarkerColorSet : 1;
791 bool m_tabMarkerColorSet : 1;
792 bool m_indentationLineColorSet : 1;
793 bool m_iconBarColorSet : 1;
794 bool m_foldingColorSet : 1;
795 bool m_lineNumberColorSet : 1;
796 bool m_separatorColorSet : 1;
797 bool m_spellingMistakeLineColorSet : 1;
798 bool m_templateColorsSet : 1;
799 bool m_modifiedLineColorSet : 1;
800 bool m_savedLineColorSet : 1;
801 bool m_searchHighlightColorSet : 1;
802 bool m_replaceHighlightColorSet : 1;
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()