• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • utils
kateconfig.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2007, 2008 Matthew Woehlke <mw_triad@users.sourceforge.net>
3  Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "kateconfig.h"
21 
22 #include "kateglobal.h"
23 #include "katedefaultcolors.h"
24 #include "katerenderer.h"
25 #include "kateview.h"
26 #include "katedocument.h"
27 #include "kateschema.h"
28 
29 #include <math.h>
30 
31 #include <kconfig.h>
32 #include <kconfiggroup.h>
33 #include <kglobalsettings.h>
34 #include <kcolorscheme.h>
35 #include <kcolorutils.h>
36 #include <kcharsets.h>
37 #include <klocale.h>
38 #include <kcomponentdata.h>
39 #include <kdebug.h>
40 
41 #include <QtCore/QTextCodec>
42 #include <QStringListModel>
43 
44 //BEGIN KateConfig
45 KateConfig::KateConfig ()
46  : configSessionNumber (0), configIsRunning (false)
47 {
48 }
49 
50 KateConfig::~KateConfig ()
51 {
52 }
53 
54 void KateConfig::configStart ()
55 {
56  configSessionNumber++;
57 
58  if (configSessionNumber > 1)
59  return;
60 
61  configIsRunning = true;
62 }
63 
64 void KateConfig::configEnd ()
65 {
66  if (configSessionNumber == 0)
67  return;
68 
69  configSessionNumber--;
70 
71  if (configSessionNumber > 0)
72  return;
73 
74  configIsRunning = false;
75 
76  updateConfig ();
77 }
78 //END
79 
80 //BEGIN KateDocumentConfig
81 KateGlobalConfig *KateGlobalConfig::s_global = 0;
82 KateDocumentConfig *KateDocumentConfig::s_global = 0;
83 KateViewConfig *KateViewConfig::s_global = 0;
84 KateRendererConfig *KateRendererConfig::s_global = 0;
85 
86 KateGlobalConfig::KateGlobalConfig ()
87 {
88  s_global = this;
89 
90  // init with defaults from config or really hardcoded ones
91  KConfigGroup cg( KGlobal::config(), "Kate Part Defaults");
92  readConfig (cg);
93 }
94 
95 KateGlobalConfig::~KateGlobalConfig ()
96 {
97 }
98 
99 namespace
100 {
101  const char * const KEY_PROBER_TYPE = "Encoding Prober Type";
102  const char * const KEY_FALLBACK_ENCODING = "Fallback Encoding";
103 }
104 
105 void KateGlobalConfig::readConfig (const KConfigGroup &config)
106 {
107  configStart ();
108 
109  setProberType ((KEncodingProber::ProberType)config.readEntry(KEY_PROBER_TYPE, (int)KEncodingProber::Universal));
110  setFallbackEncoding (config.readEntry(KEY_FALLBACK_ENCODING, ""));
111 
112  configEnd ();
113 }
114 
115 void KateGlobalConfig::writeConfig (KConfigGroup &config)
116 {
117  config.writeEntry(KEY_PROBER_TYPE, (int)proberType());
118  config.writeEntry(KEY_FALLBACK_ENCODING, fallbackEncoding());
119 }
120 
121 void KateGlobalConfig::updateConfig ()
122 {
123 }
124 
125 void KateGlobalConfig::setProberType (KEncodingProber::ProberType proberType)
126 {
127  configStart ();
128  m_proberType = proberType;
129  configEnd ();
130 }
131 
132 const QString &KateGlobalConfig::fallbackEncoding () const
133 {
134  return m_fallbackEncoding;
135 }
136 
137 QTextCodec *KateGlobalConfig::fallbackCodec () const
138 {
139  if (m_fallbackEncoding.isEmpty())
140  return QTextCodec::codecForName("ISO 8859-15");
141 
142  return KGlobal::charsets()->codecForName (m_fallbackEncoding);
143 }
144 
145 bool KateGlobalConfig::setFallbackEncoding (const QString &encoding)
146 {
147  QTextCodec *codec;
148  bool found = false;
149  if (encoding.isEmpty())
150  {
151  codec = s_global->fallbackCodec();
152  found = true;
153  }
154  else
155  codec = KGlobal::charsets()->codecForName (encoding, found);
156 
157  if (!found || !codec)
158  return false;
159 
160  configStart ();
161  m_fallbackEncoding = codec->name();
162  configEnd ();
163  return true;
164 }
165 
166 KateDocumentConfig::KateDocumentConfig ()
167  : m_indentationWidth (2),
168  m_tabWidth (8),
169  m_tabHandling (tabSmart),
170  m_configFlags (0),
171  m_wordWrapAt (80),
172  m_tabWidthSet (false),
173  m_indentationWidthSet (false),
174  m_indentationModeSet (false),
175  m_wordWrapSet (false),
176  m_wordWrapAtSet (false),
177  m_pageUpDownMovesCursorSet (false),
178  m_keepExtraSpacesSet (false),
179  m_indentPastedTextSet (false),
180  m_backspaceIndentsSet (false),
181  m_smartHomeSet (false),
182  m_showTabsSet (false),
183  m_showSpacesSet (false),
184  m_replaceTabsDynSet (false),
185  m_removeSpacesSet (false),
186  m_newLineAtEofSet (false),
187  m_overwiteModeSet (false),
188  m_tabIndentsSet (false),
189  m_encodingSet (false),
190  m_eolSet (false),
191  m_bomSet (false),
192  m_allowEolDetectionSet (false),
193  m_allowSimpleModeSet (false),
194  m_backupFlagsSet (false),
195  m_searchDirConfigDepthSet (false),
196  m_backupPrefixSet (false),
197  m_backupSuffixSet (false),
198  m_swapFileNoSyncSet (false),
199  m_onTheFlySpellCheckSet (false),
200  m_lineLengthLimitSet (false),
201  m_doc (0)
202 {
203  s_global = this;
204 
205  // init with defaults from config or really hardcoded ones
206  KConfigGroup cg( KGlobal::config(), "Kate Document Defaults");
207  readConfig (cg);
208 }
209 
210 KateDocumentConfig::KateDocumentConfig (const KConfigGroup &cg)
211  : m_indentationWidth (2),
212  m_tabWidth (8),
213  m_tabHandling (tabSmart),
214  m_configFlags (0),
215  m_wordWrapAt (80),
216  m_tabWidthSet (false),
217  m_indentationWidthSet (false),
218  m_indentationModeSet (false),
219  m_wordWrapSet (false),
220  m_wordWrapAtSet (false),
221  m_pageUpDownMovesCursorSet (false),
222  m_keepExtraSpacesSet (false),
223  m_indentPastedTextSet (false),
224  m_backspaceIndentsSet (false),
225  m_smartHomeSet (false),
226  m_showTabsSet (false),
227  m_showSpacesSet (false),
228  m_replaceTabsDynSet (false),
229  m_removeSpacesSet (false),
230  m_newLineAtEofSet (false),
231  m_overwiteModeSet (false),
232  m_tabIndentsSet (false),
233  m_encodingSet (false),
234  m_eolSet (false),
235  m_bomSet (false),
236  m_allowEolDetectionSet (false),
237  m_allowSimpleModeSet (false),
238  m_backupFlagsSet (false),
239  m_searchDirConfigDepthSet (false),
240  m_backupPrefixSet (false),
241  m_backupSuffixSet (false),
242  m_swapFileNoSyncSet (false),
243  m_onTheFlySpellCheckSet (false),
244  m_lineLengthLimitSet (false),
245  m_doc (0)
246 {
247  // init with defaults from config or really hardcoded ones
248  readConfig (cg);
249 }
250 
251 KateDocumentConfig::KateDocumentConfig (KateDocument *doc)
252  : m_tabHandling (tabSmart),
253  m_configFlags (0),
254  m_tabWidthSet (false),
255  m_indentationWidthSet (false),
256  m_indentationModeSet (false),
257  m_wordWrapSet (false),
258  m_wordWrapAtSet (false),
259  m_pageUpDownMovesCursorSet (false),
260  m_keepExtraSpacesSet (false),
261  m_indentPastedTextSet (false),
262  m_backspaceIndentsSet (false),
263  m_smartHomeSet (false),
264  m_showTabsSet (false),
265  m_showSpacesSet (false),
266  m_replaceTabsDynSet (false),
267  m_removeSpacesSet (false),
268  m_newLineAtEofSet (false),
269  m_overwiteModeSet (false),
270  m_tabIndentsSet (false),
271  m_encodingSet (false),
272  m_eolSet (false),
273  m_bomSet (false),
274  m_allowEolDetectionSet (false),
275  m_allowSimpleModeSet (false),
276  m_backupFlagsSet (false),
277  m_searchDirConfigDepthSet (false),
278  m_backupPrefixSet (false),
279  m_backupSuffixSet (false),
280  m_swapFileNoSyncSet (false),
281  m_onTheFlySpellCheckSet (false),
282  m_lineLengthLimitSet (false),
283  m_doc (doc)
284 {
285 }
286 
287 KateDocumentConfig::~KateDocumentConfig ()
288 {
289 }
290 
291 namespace
292 {
293  const char * const KEY_TAB_WIDTH = "Tab Width";
294  const char * const KEY_INDENTATION_WIDTH = "Indentation Width";
295  const char * const KEY_INDENTATION_MODE = "Indentation Mode";
296  const char * const KEY_TAB_HANDLING = "Tab Handling";
297  const char * const KEY_WORD_WRAP = "Word Wrap";
298  const char * const KEY_WORD_WRAP_AT = "Word Wrap Column";
299  const char * const KEY_PAGEUP_DOWN_MOVES_CURSOR = "PageUp/PageDown Moves Cursor";
300  const char * const KEY_SMART_HOME = "Smart Home";
301  const char * const KEY_SHOW_TABS = "Show Tabs";
302  const char * const KEY_TAB_INDENTS = "Indent On Tab";
303  const char * const KEY_KEEP_EXTRA_SPACES = "Keep Extra Spaces";
304  const char * const KEY_INDENT_PASTED_TEXT = "Indent On Text Paste";
305  const char * const KEY_BACKSPACE_INDENTS = "Indent On Backspace";
306  const char * const KEY_SHOW_SPACES = "Show Spaces";
307  const char * const KEY_REPLACE_TABS_DYN = "ReplaceTabsDyn";
308  const char * const KEY_REMOVE_SPACES = "Remove Spaces";
309  const char * const KEY_NEWLINE_AT_EOF = "Newline At EOF";
310  const char * const KEY_OVR = "Overwrite Mode";
311  const char * const KEY_ENCODING = "Encoding";
312  const char * const KEY_EOL = "End of Line";
313  const char * const KEY_ALLOW_EOL_DETECTION = "Allow End of Line Detection";
314  const char * const KEY_BOM = "BOM";
315  const char * const KEY_ALLOW_SIMPLE_MODE = "Allow Simple Mode";
316  const char * const KEY_BACKUP_FLAGS = "Backup Flags";
317  const char * const KEY_SEARCH_DIR_CONFIG_DEPTH = "Search Dir Config Depth";
318  const char * const KEY_BACKUP_PREFIX = "Backup Prefix";
319  const char * const KEY_BACKUP_SUFFIX = "Backup Suffix";
320  const char * const KEY_SWAP_FILE_NO_SYNC = "No sync";
321  const char * const KEY_ON_THE_FLY_SPELLCHECK = "On-The-Fly Spellcheck";
322  const char * const KEY_LINE_LENGTH_LIMIT = "Line Length Limit";
323 }
324 
325 void KateDocumentConfig::readConfig (const KConfigGroup &config)
326 {
327  configStart ();
328 
329  setTabWidth (config.readEntry(KEY_TAB_WIDTH, 8));
330 
331  setIndentationWidth (config.readEntry(KEY_INDENTATION_WIDTH, 2));
332 
333  setIndentationMode (config.readEntry(KEY_INDENTATION_MODE, "normal"));
334 
335  setTabHandling (config.readEntry(KEY_TAB_HANDLING, int(KateDocumentConfig::tabSmart)));
336 
337  setWordWrap (config.readEntry(KEY_WORD_WRAP, false));
338  setWordWrapAt (config.readEntry(KEY_WORD_WRAP_AT, 80));
339  setPageUpDownMovesCursor (config.readEntry(KEY_PAGEUP_DOWN_MOVES_CURSOR, false));
340 
341  setSmartHome (config.readEntry(KEY_SMART_HOME, true));
342  setShowTabs (config.readEntry(KEY_SHOW_TABS, true));
343  setTabIndents (config.readEntry(KEY_TAB_INDENTS, true));
344  setKeepExtraSpaces (config.readEntry(KEY_KEEP_EXTRA_SPACES, false));
345  setIndentPastedText (config.readEntry(KEY_INDENT_PASTED_TEXT, false));
346  setBackspaceIndents (config.readEntry(KEY_BACKSPACE_INDENTS, false));
347  setShowSpaces (config.readEntry(KEY_SHOW_SPACES, false));
348  setReplaceTabsDyn (config.readEntry(KEY_REPLACE_TABS_DYN, false));
349  setRemoveSpaces (config.readEntry(KEY_REMOVE_SPACES, 0));
350  setNewLineAtEof (config.readEntry(KEY_NEWLINE_AT_EOF, false));
351  setOvr (config.readEntry(KEY_OVR, false));
352 
353  setEncoding (config.readEntry(KEY_ENCODING, ""));
354 
355  setEol (config.readEntry(KEY_EOL, 0));
356  setAllowEolDetection (config.readEntry(KEY_ALLOW_EOL_DETECTION, true));
357 
358  setBom (config.readEntry(KEY_BOM,false));
359 
360  setAllowSimpleMode (config.readEntry(KEY_ALLOW_SIMPLE_MODE, true));
361 
362  setBackupFlags (config.readEntry(KEY_BACKUP_FLAGS, 0));
363 
364  setSearchDirConfigDepth (config.readEntry(KEY_SEARCH_DIR_CONFIG_DEPTH, 9));
365 
366  setBackupPrefix (config.readEntry(KEY_BACKUP_PREFIX, QString ("")));
367 
368  setBackupSuffix (config.readEntry(KEY_BACKUP_SUFFIX, QString ("~")));
369 
370  setSwapFileNoSync (config.readEntry(KEY_SWAP_FILE_NO_SYNC, false));
371 
372  setOnTheFlySpellCheck(config.readEntry(KEY_ON_THE_FLY_SPELLCHECK, false));
373 
374  setLineLengthLimit(config.readEntry(KEY_LINE_LENGTH_LIMIT, 4096));
375 
376  configEnd ();
377 }
378 
379 void KateDocumentConfig::writeConfig (KConfigGroup &config)
380 {
381  config.writeEntry(KEY_TAB_WIDTH, tabWidth());
382 
383  config.writeEntry(KEY_INDENTATION_WIDTH, indentationWidth());
384  config.writeEntry(KEY_INDENTATION_MODE, indentationMode());
385 
386  config.writeEntry(KEY_TAB_HANDLING, tabHandling());
387 
388  config.writeEntry(KEY_WORD_WRAP, wordWrap());
389  config.writeEntry(KEY_WORD_WRAP_AT, wordWrapAt());
390 
391  config.writeEntry(KEY_PAGEUP_DOWN_MOVES_CURSOR, pageUpDownMovesCursor());
392 
393  config.writeEntry(KEY_SMART_HOME, smartHome());
394  config.writeEntry(KEY_SHOW_TABS, showTabs());
395  config.writeEntry(KEY_TAB_INDENTS, tabIndentsEnabled());
396  config.writeEntry(KEY_KEEP_EXTRA_SPACES, keepExtraSpaces());
397  config.writeEntry(KEY_INDENT_PASTED_TEXT, indentPastedText());
398  config.writeEntry(KEY_BACKSPACE_INDENTS, backspaceIndents());
399  config.writeEntry(KEY_SHOW_SPACES, showSpaces());
400  config.writeEntry(KEY_REPLACE_TABS_DYN, replaceTabsDyn());
401  config.writeEntry(KEY_REMOVE_SPACES, removeSpaces());
402  config.writeEntry(KEY_NEWLINE_AT_EOF, newLineAtEof());
403  config.writeEntry(KEY_OVR, ovr());
404 
405  config.writeEntry(KEY_ENCODING, encoding());
406 
407  config.writeEntry(KEY_EOL, eol());
408  config.writeEntry(KEY_ALLOW_EOL_DETECTION, allowEolDetection());
409 
410  config.writeEntry(KEY_BOM,bom());
411 
412  config.writeEntry(KEY_ALLOW_SIMPLE_MODE, allowSimpleMode());
413 
414  config.writeEntry(KEY_BACKUP_FLAGS, backupFlags());
415 
416  config.writeEntry(KEY_SEARCH_DIR_CONFIG_DEPTH, searchDirConfigDepth());
417 
418  config.writeEntry(KEY_BACKUP_PREFIX, backupPrefix());
419 
420  config.writeEntry(KEY_BACKUP_SUFFIX, backupSuffix());
421 
422  config.writeEntry(KEY_SWAP_FILE_NO_SYNC, swapFileNoSync());
423 
424  config.writeEntry(KEY_ON_THE_FLY_SPELLCHECK, onTheFlySpellCheck());
425 
426  config.writeEntry(KEY_LINE_LENGTH_LIMIT, lineLengthLimit());
427 }
428 
429 void KateDocumentConfig::updateConfig ()
430 {
431  if (m_doc)
432  {
433  m_doc->updateConfig ();
434  return;
435  }
436 
437  if (isGlobal())
438  {
439  for (int z=0; z < KateGlobal::self()->kateDocuments().size(); ++z)
440  (KateGlobal::self()->kateDocuments())[z]->updateConfig ();
441  }
442 }
443 
444 int KateDocumentConfig::tabWidth () const
445 {
446  if (m_tabWidthSet || isGlobal())
447  return m_tabWidth;
448 
449  return s_global->tabWidth();
450 }
451 
452 void KateDocumentConfig::setTabWidth (int tabWidth)
453 {
454  if (tabWidth < 1)
455  return;
456 
457  if (m_tabWidthSet && m_tabWidth == tabWidth)
458  return;
459 
460  configStart ();
461 
462  m_tabWidthSet = true;
463  m_tabWidth = tabWidth;
464 
465  configEnd ();
466 }
467 
468 int KateDocumentConfig::indentationWidth () const
469 {
470  if (m_indentationWidthSet || isGlobal())
471  return m_indentationWidth;
472 
473  return s_global->indentationWidth();
474 }
475 
476 void KateDocumentConfig::setIndentationWidth (int indentationWidth)
477 {
478  if (indentationWidth < 1)
479  return;
480 
481  if (m_indentationWidthSet && m_indentationWidth == indentationWidth)
482  return;
483 
484  configStart ();
485 
486  m_indentationWidthSet = true;
487  m_indentationWidth = indentationWidth;
488 
489  configEnd ();
490 }
491 
492 const QString &KateDocumentConfig::indentationMode () const
493 {
494  if (m_indentationModeSet || isGlobal())
495  return m_indentationMode;
496 
497  return s_global->indentationMode();
498 }
499 
500 void KateDocumentConfig::setIndentationMode (const QString &indentationMode)
501 {
502  if (m_indentationModeSet && m_indentationMode == indentationMode)
503  return;
504 
505  configStart ();
506 
507  m_indentationModeSet = true;
508  m_indentationMode = indentationMode;
509 
510  configEnd ();
511 }
512 
513 uint KateDocumentConfig::tabHandling () const
514 {
515  // This setting is purly a user preference,
516  // hence, there exists only the global setting.
517  if (isGlobal())
518  return m_tabHandling;
519 
520  return s_global->tabHandling();
521 }
522 
523 void KateDocumentConfig::setTabHandling (uint tabHandling)
524 {
525  configStart ();
526 
527  m_tabHandling = tabHandling;
528 
529  configEnd ();
530 }
531 
532 bool KateDocumentConfig::wordWrap () const
533 {
534  if (m_wordWrapSet || isGlobal())
535  return m_wordWrap;
536 
537  return s_global->wordWrap();
538 }
539 
540 void KateDocumentConfig::setWordWrap (bool on)
541 {
542  if (m_wordWrapSet && m_wordWrap == on)
543  return;
544 
545  configStart ();
546 
547  m_wordWrapSet = true;
548  m_wordWrap = on;
549 
550  configEnd ();
551 }
552 
553 int KateDocumentConfig::wordWrapAt () const
554 {
555  if (m_wordWrapAtSet || isGlobal())
556  return m_wordWrapAt;
557 
558  return s_global->wordWrapAt();
559 }
560 
561 void KateDocumentConfig::setWordWrapAt (int col)
562 {
563  if (col < 1)
564  return;
565 
566  if (m_wordWrapAtSet && m_wordWrapAt == col)
567  return;
568 
569  configStart ();
570 
571  m_wordWrapAtSet = true;
572  m_wordWrapAt = col;
573 
574  configEnd ();
575 }
576 
577 bool KateDocumentConfig::pageUpDownMovesCursor () const
578 {
579  if (m_pageUpDownMovesCursorSet || isGlobal())
580  return m_pageUpDownMovesCursor;
581 
582  return s_global->pageUpDownMovesCursor();
583 }
584 
585 void KateDocumentConfig::setPageUpDownMovesCursor (bool on)
586 {
587  if (m_pageUpDownMovesCursorSet && m_pageUpDownMovesCursor == on)
588  return;
589 
590  configStart ();
591 
592  m_pageUpDownMovesCursorSet = true;
593  m_pageUpDownMovesCursor = on;
594 
595  configEnd ();
596 }
597 
598 void KateDocumentConfig::setKeepExtraSpaces(bool on)
599 {
600  if (m_keepExtraSpacesSet && m_keepExtraSpaces == on)
601  return;
602 
603  configStart ();
604 
605  m_keepExtraSpacesSet = true;
606  m_keepExtraSpaces = on;
607 
608  configEnd ();
609 }
610 
611 bool KateDocumentConfig::keepExtraSpaces() const
612 {
613  if (m_keepExtraSpacesSet || isGlobal())
614  return m_keepExtraSpaces;
615 
616  return s_global->keepExtraSpaces();
617 }
618 
619 void KateDocumentConfig::setIndentPastedText(bool on)
620 {
621  if (m_indentPastedTextSet && m_indentPastedText == on)
622  return;
623 
624  configStart ();
625 
626  m_indentPastedTextSet = true;
627  m_indentPastedText = on;
628 
629  configEnd ();
630 }
631 
632 bool KateDocumentConfig::indentPastedText() const
633 {
634  if (m_indentPastedTextSet || isGlobal())
635  return m_indentPastedText;
636 
637  return s_global->indentPastedText();
638 }
639 
640 void KateDocumentConfig::setBackspaceIndents(bool on)
641 {
642  if (m_backspaceIndentsSet && m_backspaceIndents == on)
643  return;
644 
645  configStart ();
646 
647  m_backspaceIndentsSet = true;
648  m_backspaceIndents = on;
649 
650  configEnd ();
651 }
652 
653 bool KateDocumentConfig::backspaceIndents() const
654 {
655  if (m_backspaceIndentsSet || isGlobal())
656  return m_backspaceIndents;
657 
658  return s_global->backspaceIndents();
659 }
660 
661 void KateDocumentConfig::setSmartHome(bool on)
662 {
663  if (m_smartHomeSet && m_smartHome == on)
664  return;
665 
666  configStart ();
667 
668  m_smartHomeSet = true;
669  m_smartHome = on;
670 
671  configEnd ();
672 }
673 
674 bool KateDocumentConfig::smartHome() const
675 {
676  if (m_smartHomeSet || isGlobal())
677  return m_smartHome;
678 
679  return s_global->smartHome();
680 }
681 
682 void KateDocumentConfig::setShowTabs(bool on)
683 {
684  if (m_showTabsSet && m_showTabs == on)
685  return;
686 
687  configStart ();
688 
689  m_showTabsSet = true;
690  m_showTabs = on;
691 
692  configEnd ();
693 }
694 
695 bool KateDocumentConfig::showTabs() const
696 {
697  if (m_showTabsSet || isGlobal())
698  return m_showTabs;
699 
700  return s_global->showTabs();
701 }
702 
703 void KateDocumentConfig::setShowSpaces(bool on)
704 {
705  if (m_showSpacesSet && m_showSpaces == on)
706  return;
707 
708  configStart ();
709 
710  m_showSpacesSet = true;
711  m_showSpaces = on;
712 
713  configEnd ();
714 }
715 
716 bool KateDocumentConfig::showSpaces() const
717 {
718  if (m_showSpacesSet || isGlobal())
719  return m_showSpaces;
720 
721  return s_global->showSpaces();
722 }
723 
724 void KateDocumentConfig::setReplaceTabsDyn(bool on)
725 {
726  if (m_replaceTabsDynSet && m_replaceTabsDyn == on)
727  return;
728 
729  configStart ();
730 
731  m_replaceTabsDynSet = true;
732  m_replaceTabsDyn = on;
733 
734  configEnd ();
735 }
736 
737 bool KateDocumentConfig::replaceTabsDyn() const
738 {
739  if (m_replaceTabsDynSet || isGlobal())
740  return m_replaceTabsDyn;
741 
742  return s_global->replaceTabsDyn();
743 }
744 
745 void KateDocumentConfig::setRemoveSpaces(int triState)
746 {
747  if (m_removeSpacesSet && m_removeSpaces == triState)
748  return;
749 
750  configStart ();
751 
752  m_removeSpacesSet = true;
753  m_removeSpaces = triState;
754 
755  configEnd ();
756 }
757 
758 int KateDocumentConfig::removeSpaces() const
759 {
760  if (m_removeSpacesSet || isGlobal())
761  return m_removeSpaces;
762 
763  return s_global->removeSpaces();
764 }
765 
766 void KateDocumentConfig::setNewLineAtEof (bool on)
767 {
768  if (m_newLineAtEofSet && m_newLineAtEof == on)
769  return;
770 
771  configStart ();
772 
773  m_newLineAtEofSet = true;
774  m_newLineAtEof = on;
775 
776  configEnd ();
777 }
778 
779 bool KateDocumentConfig::newLineAtEof () const
780 {
781  if (m_newLineAtEofSet || isGlobal())
782  return m_newLineAtEof;
783 
784  return s_global->newLineAtEof();
785 }
786 
787 void KateDocumentConfig::setOvr(bool on)
788 {
789  if (m_overwiteModeSet && m_overwiteMode == on)
790  return;
791 
792  configStart ();
793 
794  m_overwiteModeSet = true;
795  m_overwiteMode = on;
796 
797  configEnd ();
798 }
799 
800 bool KateDocumentConfig::ovr() const
801 {
802  if (m_overwiteModeSet || isGlobal())
803  return m_overwiteMode;
804 
805  return s_global->ovr();
806 }
807 
808 void KateDocumentConfig::setTabIndents(bool on)
809 {
810  if (m_tabIndentsSet && m_tabIndents == on)
811  return;
812 
813  configStart ();
814 
815  m_tabIndentsSet = true;
816  m_tabIndents = on;
817 
818  configEnd ();
819 }
820 
821 bool KateDocumentConfig::tabIndentsEnabled() const
822 {
823  if (m_tabIndentsSet || isGlobal())
824  return m_tabIndents;
825 
826  return s_global->tabIndentsEnabled();
827 }
828 
829 const QString &KateDocumentConfig::encoding () const
830 {
831  if (m_encodingSet || isGlobal())
832  return m_encoding;
833 
834  return s_global->encoding();
835 }
836 
837 QTextCodec *KateDocumentConfig::codec () const
838 {
839  if (m_encodingSet || isGlobal())
840  {
841  if (m_encoding.isEmpty() && isGlobal())
842  return KGlobal::locale()->codecForEncoding();
843  else if (m_encoding.isEmpty())
844  return s_global->codec ();
845  else
846  return KGlobal::charsets()->codecForName (m_encoding);
847  }
848 
849  return s_global->codec ();
850 }
851 
852 bool KateDocumentConfig::setEncoding (const QString &encoding)
853 {
854  QTextCodec *codec;
855  bool found = false;
856  if (encoding.isEmpty())
857  {
858  codec = s_global->codec();
859  found=true;
860  }
861  else
862  codec = KGlobal::charsets()->codecForName (encoding, found);
863 
864  if (!found || !codec)
865  return false;
866 
867  configStart ();
868  m_encodingSet = true;
869  m_encoding = codec->name();
870 
871  if (isGlobal())
872  KateGlobal::self()->setDefaultEncoding (m_encoding);
873 
874  configEnd ();
875  return true;
876 }
877 
878 bool KateDocumentConfig::isSetEncoding () const
879 {
880  return m_encodingSet;
881 }
882 
883 int KateDocumentConfig::eol () const
884 {
885  if (m_eolSet || isGlobal())
886  return m_eol;
887 
888  return s_global->eol();
889 }
890 
891 QString KateDocumentConfig::eolString ()
892 {
893  if (eol() == KateDocumentConfig::eolUnix)
894  return QString ("\n");
895  else if (eol() == KateDocumentConfig::eolDos)
896  return QString ("\r\n");
897  else if (eol() == KateDocumentConfig::eolMac)
898  return QString ("\r");
899 
900  return QString ("\n");
901 }
902 
903 void KateDocumentConfig::setEol (int mode)
904 {
905  if (m_eolSet && m_eol == mode)
906  return;
907 
908  configStart ();
909 
910  m_eolSet = true;
911  m_eol = mode;
912 
913  configEnd ();
914 }
915 
916 void KateDocumentConfig::setBom (bool bom)
917 {
918  if (m_bomSet && m_bom == bom)
919  return;
920 
921  configStart ();
922 
923  m_bomSet = true;
924  m_bom = bom;
925 
926  configEnd ();
927 }
928 
929 bool KateDocumentConfig::bom() const
930 {
931  if (m_bomSet || isGlobal())
932  return m_bom;
933 
934  return s_global->bom();
935 }
936 
937 bool KateDocumentConfig::allowEolDetection () const
938 {
939  if (m_allowEolDetectionSet || isGlobal())
940  return m_allowEolDetection;
941 
942  return s_global->allowEolDetection();
943 }
944 
945 void KateDocumentConfig::setAllowEolDetection (bool on)
946 {
947  if (m_allowEolDetectionSet && m_allowEolDetection == on)
948  return;
949 
950  configStart ();
951 
952  m_allowEolDetectionSet = true;
953  m_allowEolDetection = on;
954 
955  configEnd ();
956 }
957 
958 bool KateDocumentConfig::allowSimpleMode () const
959 {
960  if (m_allowSimpleModeSet || isGlobal())
961  return m_allowSimpleMode;
962 
963  return s_global->allowSimpleMode();
964 }
965 
966 void KateDocumentConfig::setAllowSimpleMode (bool on)
967 {
968  if (m_allowSimpleModeSet && m_allowSimpleMode == on)
969  return;
970 
971  configStart ();
972 
973  m_allowSimpleModeSet = true;
974  m_allowSimpleMode = on;
975 
976  configEnd ();
977 }
978 
979 uint KateDocumentConfig::backupFlags () const
980 {
981  if (m_backupFlagsSet || isGlobal())
982  return m_backupFlags;
983 
984  return s_global->backupFlags();
985 }
986 
987 void KateDocumentConfig::setBackupFlags (uint flags)
988 {
989  if (m_backupFlagsSet && m_backupFlags == flags)
990  return;
991 
992  configStart ();
993 
994  m_backupFlagsSet = true;
995  m_backupFlags = flags;
996 
997  configEnd ();
998 }
999 
1000 const QString &KateDocumentConfig::backupPrefix () const
1001 {
1002  if (m_backupPrefixSet || isGlobal())
1003  return m_backupPrefix;
1004 
1005  return s_global->backupPrefix();
1006 }
1007 
1008 const QString &KateDocumentConfig::backupSuffix () const
1009 {
1010  if (m_backupSuffixSet || isGlobal())
1011  return m_backupSuffix;
1012 
1013  return s_global->backupSuffix();
1014 }
1015 
1016 void KateDocumentConfig::setBackupPrefix (const QString &prefix)
1017 {
1018  if (m_backupPrefixSet && m_backupPrefix == prefix)
1019  return;
1020 
1021  configStart ();
1022 
1023  m_backupPrefixSet = true;
1024  m_backupPrefix = prefix;
1025 
1026  configEnd ();
1027 }
1028 
1029 void KateDocumentConfig::setBackupSuffix (const QString &suffix)
1030 {
1031  if (m_backupSuffixSet && m_backupSuffix == suffix)
1032  return;
1033 
1034  configStart ();
1035 
1036  m_backupSuffixSet = true;
1037  m_backupSuffix = suffix;
1038 
1039  configEnd ();
1040 }
1041 
1042 bool KateDocumentConfig::swapFileNoSync() const
1043 {
1044  if (m_swapFileNoSyncSet || isGlobal())
1045  return m_swapFileNoSync;
1046 
1047  return s_global->swapFileNoSync();
1048 }
1049 
1050 void KateDocumentConfig::setSwapFileNoSync(bool on)
1051 {
1052  if (m_swapFileNoSyncSet && m_swapFileNoSync == on)
1053  return;
1054 
1055  configStart();
1056 
1057  m_swapFileNoSyncSet = true;
1058  m_swapFileNoSync = on;
1059 
1060  configEnd();
1061 }
1062 
1063 int KateDocumentConfig::searchDirConfigDepth () const
1064 {
1065  if (m_searchDirConfigDepthSet || isGlobal())
1066  return m_searchDirConfigDepth;
1067 
1068  return s_global->searchDirConfigDepth ();
1069 }
1070 
1071 void KateDocumentConfig::setSearchDirConfigDepth (int depth)
1072 {
1073  if (m_searchDirConfigDepthSet && m_searchDirConfigDepth == depth)
1074  return;
1075 
1076  configStart ();
1077 
1078  m_searchDirConfigDepthSet = true;
1079  m_searchDirConfigDepth = depth;
1080 
1081  configEnd ();
1082 }
1083 
1084 bool KateDocumentConfig::onTheFlySpellCheck() const
1085 {
1086  if(isGlobal()) {
1087  // WARNING: this is slightly hackish, but it's currently the only way to
1088  // do it, see also the KTextEdit class
1089  KConfigGroup configGroup(KGlobal::config(), "Spelling");
1090  return configGroup.readEntry("checkerEnabledByDefault", false);
1091  }
1092  if (m_onTheFlySpellCheckSet) {
1093  return m_onTheFlySpellCheck;
1094  }
1095 
1096  return s_global->onTheFlySpellCheck();
1097 }
1098 
1099 void KateDocumentConfig::setOnTheFlySpellCheck(bool on)
1100 {
1101  if (m_onTheFlySpellCheckSet && m_onTheFlySpellCheck == on)
1102  return;
1103 
1104  configStart ();
1105 
1106  m_onTheFlySpellCheckSet = true;
1107  m_onTheFlySpellCheck = on;
1108 
1109  configEnd ();
1110 }
1111 
1112 
1113 int KateDocumentConfig::lineLengthLimit() const
1114 {
1115  if (m_lineLengthLimitSet || isGlobal())
1116  return m_lineLengthLimit;
1117 
1118  return s_global->lineLengthLimit();
1119 }
1120 
1121 void KateDocumentConfig::setLineLengthLimit(int lineLengthLimit)
1122 {
1123  if (m_lineLengthLimitSet && m_lineLengthLimit == lineLengthLimit)
1124  return;
1125 
1126  configStart();
1127 
1128  m_lineLengthLimitSet = true;
1129  m_lineLengthLimit = lineLengthLimit;
1130 
1131  configEnd();
1132 }
1133 
1134 
1135 
1136 //END
1137 
1138 //BEGIN KateViewConfig
1139 KateViewConfig::KateViewConfig ()
1140  :
1141  m_dynWordWrapSet (false),
1142  m_dynWordWrapIndicatorsSet (false),
1143  m_dynWordWrapAlignIndentSet (false),
1144  m_lineNumbersSet (false),
1145  m_scrollBarMarksSet (false),
1146  m_scrollBarMiniMapSet (false),
1147  m_scrollBarMiniMapAllSet (false),
1148  m_scrollBarMiniMapWidthSet (false),
1149  m_showScrollbarsSet (false),
1150  m_iconBarSet (false),
1151  m_foldingBarSet (false),
1152  m_lineModificationSet (false),
1153  m_bookmarkSortSet (false),
1154  m_autoCenterLinesSet (false),
1155  m_searchFlagsSet (false),
1156  m_defaultMarkTypeSet (false),
1157  m_persistentSelectionSet (false),
1158  m_viInputModeSet (false),
1159  m_viInputModeStealKeysSet (false),
1160  m_viRelativeLineNumbersSet (false),
1161  m_viInputModeEmulateCommandBarSet(false),
1162  m_automaticCompletionInvocationSet (false),
1163  m_wordCompletionSet (false),
1164  m_keywordCompletionSet (false),
1165  m_wordCompletionMinimalWordLengthSet (false),
1166  m_smartCopyCutSet (false),
1167  m_scrollPastEndSet (false),
1168  m_allowMarkMenu (true),
1169  m_wordCompletionRemoveTailSet (false),
1170  m_foldFirstLineSet (false),
1171  m_view (0)
1172 {
1173  s_global = this;
1174 
1175  // init with defaults from config or really hardcoded ones
1176  KConfigGroup config( KGlobal::config(), "Kate View Defaults");
1177  readConfig (config);
1178 }
1179 
1180 KateViewConfig::KateViewConfig (KateView *view)
1181  :
1182  m_searchFlags (PowerModePlainText),
1183  m_maxHistorySize (100),
1184  m_dynWordWrapSet (false),
1185  m_dynWordWrapIndicatorsSet (false),
1186  m_dynWordWrapAlignIndentSet (false),
1187  m_lineNumbersSet (false),
1188  m_scrollBarMarksSet (false),
1189  m_scrollBarMiniMapSet (false),
1190  m_scrollBarMiniMapAllSet (false),
1191  m_scrollBarMiniMapWidthSet (false),
1192  m_showScrollbarsSet (false),
1193  m_iconBarSet (false),
1194  m_foldingBarSet (false),
1195  m_lineModificationSet (false),
1196  m_bookmarkSortSet (false),
1197  m_autoCenterLinesSet (false),
1198  m_searchFlagsSet (false),
1199  m_defaultMarkTypeSet (false),
1200  m_persistentSelectionSet (false),
1201  m_viInputModeSet (false),
1202  m_viInputModeStealKeysSet (false),
1203  m_viRelativeLineNumbersSet (false),
1204  m_viInputModeEmulateCommandBarSet(false),
1205  m_automaticCompletionInvocationSet (false),
1206  m_wordCompletionSet (false),
1207  m_keywordCompletionSet (false),
1208  m_wordCompletionMinimalWordLengthSet (false),
1209  m_smartCopyCutSet (false),
1210  m_scrollPastEndSet (false),
1211  m_allowMarkMenu (true),
1212  m_wordCompletionRemoveTailSet (false),
1213  m_foldFirstLineSet (false),
1214  m_view (view)
1215 {
1216 }
1217 
1218 KateViewConfig::~KateViewConfig ()
1219 {
1220 }
1221 
1222 namespace
1223 {
1224  const char * const KEY_SEARCH_REPLACE_FLAGS = "Search/Replace Flags";
1225  const char * const KEY_PATTERN_HISTORY = "Search Pattern History";
1226  const char * const KEY_REPLACEMENT_HISTORY = "Replacement Text History";
1227  const char * const KEY_DYN_WORD_WRAP = "Dynamic Word Wrap";
1228  const char * const KEY_DYN_WORD_WRAP_INDICATORS = "Dynamic Word Wrap Indicators";
1229  const char * const KEY_DYN_WORD_WRAP_ALIGN_INDENT = "Dynamic Word Wrap Align Indent";
1230  const char * const KEY_LINE_NUMBERS = "Line Numbers";
1231  const char * const KEY_SCROLL_BAR_MARKS = "Scroll Bar Marks";
1232  const char * const KEY_SCROLL_BAR_MINI_MAP = "Scroll Bar Mini Map";
1233  const char * const KEY_SCROLL_BAR_MINI_MAP_ALL = "Scroll Bar Mini Map All";
1234  const char * const KEY_SCROLL_BAR_MINI_MAP_WIDTH = "Scroll Bar Mini Map Width";
1235  const char * const KEY_SHOW_SCROLLBARS = "Show Scrollbars";
1236  const char * const KEY_ICON_BAR = "Icon Bar";
1237  const char * const KEY_FOLDING_BAR = "Folding Bar";
1238  const char * const KEY_LINE_MODIFICATION = "Line Modification";
1239  const char * const KEY_BOOKMARK_SORT = "Bookmark Menu Sorting";
1240  const char * const KEY_AUTO_CENTER_LINES = "Auto Center Lines";
1241  const char * const KEY_MAX_HISTORY_SIZE = "Maximum Search History Size";
1242  const char * const KEY_DEFAULT_MARK_TYPE = "Default Mark Type";
1243  const char * const KEY_ALLOW_MARK_MENU = "Allow Mark Menu";
1244  const char * const KEY_PERSISTENT_SELECTION = "Persistent Selection";
1245  const char * const KEY_VI_INPUT_MODE = "Vi Input Mode";
1246  const char * const KEY_VI_INPUT_MODE_STEAL_KEYS = "Vi Input Mode Steal Keys";
1247  const char * const KEY_VI_RELATIVE_LINE_NUMBERS = "Vi Relative Line Numbers";
1248  const char * const KEY_VI_INPUT_MODE_EMULATE_COMMAND_BAR = "Vi Input Mode Emulate Command Bar";
1249  const char * const KEY_AUTOMATIC_COMPLETION_INVOCATION = "Auto Completion";
1250  const char * const KEY_WORD_COMPLETION = "Word Completion";
1251  const char * const KEY_KEYWORD_COMPLETION = "Keyword Completion";
1252  const char * const KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH = "Word Completion Minimal Word Length";
1253  const char * const KEY_WORD_COMPLETION_REMOVE_TAIL = "Word Completion Remove Tail";
1254  const char * const KEY_SMART_COPY_CUT = "Smart Copy Cut";
1255  const char * const KEY_SCROLL_PAST_END = "Scroll Past End";
1256  const char * const KEY_FOLD_FIRST_LINE = "Fold First Line";
1257 }
1258 
1259 void KateViewConfig::readConfig ( const KConfigGroup &config)
1260 {
1261  configStart ();
1262 
1263  // default off again, until this is usable for large size documents
1264  setDynWordWrap (config.readEntry( KEY_DYN_WORD_WRAP, false ));
1265  setDynWordWrapIndicators (config.readEntry( KEY_DYN_WORD_WRAP_INDICATORS, 1 ));
1266  setDynWordWrapAlignIndent (config.readEntry( KEY_DYN_WORD_WRAP_ALIGN_INDENT, 80 ));
1267 
1268  setLineNumbers (config.readEntry( KEY_LINE_NUMBERS, false));
1269 
1270  setScrollBarMarks (config.readEntry( KEY_SCROLL_BAR_MARKS, false));
1271 
1272  setScrollBarMiniMap (config.readEntry( KEY_SCROLL_BAR_MINI_MAP, false));
1273 
1274  setScrollBarMiniMapAll (config.readEntry( KEY_SCROLL_BAR_MINI_MAP_ALL, false));
1275 
1276  setScrollBarMiniMapWidth (config.readEntry( KEY_SCROLL_BAR_MINI_MAP_WIDTH, 60));
1277 
1278  setShowScrollbars (config.readEntry( KEY_SHOW_SCROLLBARS, static_cast<int>(AlwaysOn)));
1279 
1280  setIconBar (config.readEntry( KEY_ICON_BAR, false ));
1281 
1282  setFoldingBar (config.readEntry( KEY_FOLDING_BAR, true));
1283 
1284  setLineModification (config.readEntry( KEY_LINE_MODIFICATION, false));
1285 
1286  setBookmarkSort (config.readEntry( KEY_BOOKMARK_SORT, 0 ));
1287 
1288  setAutoCenterLines (config.readEntry( KEY_AUTO_CENTER_LINES, 0 ));
1289 
1290  setSearchFlags(config.readEntry(KEY_SEARCH_REPLACE_FLAGS,
1291  IncFromCursor|PowerMatchCase|PowerModePlainText));
1292 
1293  m_maxHistorySize = config.readEntry(KEY_MAX_HISTORY_SIZE, 100);
1294 
1295  setDefaultMarkType (config.readEntry( KEY_DEFAULT_MARK_TYPE, int(KTextEditor::MarkInterface::markType01) ));
1296  setAllowMarkMenu (config.readEntry( KEY_ALLOW_MARK_MENU, true ));
1297 
1298  setPersistentSelection (config.readEntry( KEY_PERSISTENT_SELECTION, false ));
1299 
1300  setViInputMode (config.readEntry( KEY_VI_INPUT_MODE, false));
1301  setViInputModeStealKeys (config.readEntry( KEY_VI_INPUT_MODE_STEAL_KEYS, false));
1302  setViRelativeLineNumbers(config.readEntry( KEY_VI_RELATIVE_LINE_NUMBERS, false));
1303  setViInputModeEmulateCommandBar (config.readEntry( KEY_VI_INPUT_MODE_EMULATE_COMMAND_BAR, false));
1304 
1305  setAutomaticCompletionInvocation (config.readEntry( KEY_AUTOMATIC_COMPLETION_INVOCATION, true ));
1306  setWordCompletion (config.readEntry( KEY_WORD_COMPLETION, true ));
1307  setKeywordCompletion (config.readEntry( KEY_KEYWORD_COMPLETION, true ));
1308  setWordCompletionMinimalWordLength (config.readEntry( KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3 ));
1309  setWordCompletionRemoveTail (config.readEntry( KEY_WORD_COMPLETION_REMOVE_TAIL, true ));
1310  setSmartCopyCut (config.readEntry( KEY_SMART_COPY_CUT, false ));
1311  setScrollPastEnd (config.readEntry( KEY_SCROLL_PAST_END, false ));
1312  setFoldFirstLine (config.readEntry( KEY_FOLD_FIRST_LINE, false ));
1313 
1314  if (isGlobal()) {
1315  // Read search pattern history
1316  QStringList patternHistory = config.readEntry(KEY_PATTERN_HISTORY, QStringList());
1317  m_patternHistoryModel.setStringList(patternHistory);
1318 
1319  // Read replacement text history
1320  QStringList replacementHistory = config.readEntry(KEY_REPLACEMENT_HISTORY, QStringList());
1321  m_replacementHistoryModel.setStringList(replacementHistory);
1322  }
1323 
1324  configEnd ();
1325 }
1326 
1327 void KateViewConfig::writeConfig (KConfigGroup &config)
1328 {
1329  config.writeEntry( KEY_DYN_WORD_WRAP, dynWordWrap() );
1330  config.writeEntry( KEY_DYN_WORD_WRAP_INDICATORS, dynWordWrapIndicators() );
1331  config.writeEntry( KEY_DYN_WORD_WRAP_ALIGN_INDENT, dynWordWrapAlignIndent() );
1332 
1333  config.writeEntry( KEY_LINE_NUMBERS, lineNumbers() );
1334 
1335  config.writeEntry( KEY_SCROLL_BAR_MARKS, scrollBarMarks() );
1336 
1337  config.writeEntry( KEY_SCROLL_BAR_MINI_MAP, scrollBarMiniMap() );
1338 
1339  config.writeEntry( KEY_SCROLL_BAR_MINI_MAP_ALL, scrollBarMiniMapAll() );
1340 
1341  config.writeEntry( KEY_SCROLL_BAR_MINI_MAP_WIDTH, scrollBarMiniMapWidth() );
1342 
1343  config.writeEntry( KEY_SHOW_SCROLLBARS, showScrollbars() );
1344 
1345  config.writeEntry( KEY_ICON_BAR, iconBar() );
1346 
1347  config.writeEntry( KEY_FOLDING_BAR, foldingBar() );
1348 
1349  config.writeEntry( KEY_LINE_MODIFICATION, lineModification() );
1350 
1351  config.writeEntry( KEY_BOOKMARK_SORT, bookmarkSort() );
1352 
1353  config.writeEntry( KEY_AUTO_CENTER_LINES, autoCenterLines() );
1354 
1355  config.writeEntry(KEY_SEARCH_REPLACE_FLAGS, int(searchFlags()));
1356 
1357  config.writeEntry(KEY_MAX_HISTORY_SIZE, m_maxHistorySize);
1358 
1359  config.writeEntry(KEY_DEFAULT_MARK_TYPE, defaultMarkType());
1360 
1361  config.writeEntry(KEY_ALLOW_MARK_MENU, allowMarkMenu());
1362 
1363  config.writeEntry(KEY_PERSISTENT_SELECTION, persistentSelection());
1364 
1365  config.writeEntry( KEY_AUTOMATIC_COMPLETION_INVOCATION, automaticCompletionInvocation());
1366  config.writeEntry( KEY_WORD_COMPLETION, wordCompletion());
1367  config.writeEntry( KEY_KEYWORD_COMPLETION, keywordCompletion());
1368  config.writeEntry( KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, wordCompletionMinimalWordLength());
1369  config.writeEntry( KEY_WORD_COMPLETION_REMOVE_TAIL, wordCompletionRemoveTail());
1370 
1371  config.writeEntry( KEY_SMART_COPY_CUT, smartCopyCut() );
1372  config.writeEntry( KEY_SCROLL_PAST_END , scrollPastEnd() );
1373  config.writeEntry( KEY_FOLD_FIRST_LINE, foldFirstLine() );
1374 
1375  config.writeEntry( KEY_VI_INPUT_MODE, viInputMode());
1376  config.writeEntry( KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys());
1377  config.writeEntry( KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers());
1378  config.writeEntry( KEY_VI_INPUT_MODE_EMULATE_COMMAND_BAR, viInputModeEmulateCommandBar());
1379 
1380 
1381  if (isGlobal()) {
1382  // Write search pattern history
1383  config.writeEntry(KEY_PATTERN_HISTORY, m_patternHistoryModel.stringList());
1384 
1385  // Write replacement text history
1386  config.writeEntry(KEY_REPLACEMENT_HISTORY, m_replacementHistoryModel.stringList());
1387  }
1388 }
1389 
1390 void KateViewConfig::updateConfig ()
1391 {
1392  if (m_view)
1393  {
1394  m_view->updateConfig ();
1395  return;
1396  }
1397 
1398  if (isGlobal())
1399  {
1400  for (int z=0; z < KateGlobal::self()->views().size(); ++z)
1401  (KateGlobal::self()->views())[z]->updateConfig ();
1402  }
1403 }
1404 
1405 bool KateViewConfig::dynWordWrap () const
1406 {
1407  if (m_dynWordWrapSet || isGlobal())
1408  return m_dynWordWrap;
1409 
1410  return s_global->dynWordWrap();
1411 }
1412 
1413 void KateViewConfig::setDynWordWrap (bool wrap)
1414 {
1415  if (m_dynWordWrapSet && m_dynWordWrap == wrap)
1416  return;
1417 
1418  configStart ();
1419 
1420  m_dynWordWrapSet = true;
1421  m_dynWordWrap = wrap;
1422 
1423  configEnd ();
1424 }
1425 
1426 int KateViewConfig::dynWordWrapIndicators () const
1427 {
1428  if (m_dynWordWrapIndicatorsSet || isGlobal())
1429  return m_dynWordWrapIndicators;
1430 
1431  return s_global->dynWordWrapIndicators();
1432 }
1433 
1434 void KateViewConfig::setDynWordWrapIndicators (int mode)
1435 {
1436  if (m_dynWordWrapIndicatorsSet && m_dynWordWrapIndicators == mode)
1437  return;
1438 
1439  configStart ();
1440 
1441  m_dynWordWrapIndicatorsSet = true;
1442  m_dynWordWrapIndicators = qBound(0, mode, 80);
1443 
1444  configEnd ();
1445 }
1446 
1447 int KateViewConfig::dynWordWrapAlignIndent () const
1448 {
1449  if (m_dynWordWrapAlignIndentSet || isGlobal())
1450  return m_dynWordWrapAlignIndent;
1451 
1452  return s_global->dynWordWrapAlignIndent();
1453 }
1454 
1455 void KateViewConfig::setDynWordWrapAlignIndent (int indent)
1456 {
1457  if (m_dynWordWrapAlignIndentSet && m_dynWordWrapAlignIndent == indent)
1458  return;
1459 
1460  configStart ();
1461 
1462  m_dynWordWrapAlignIndentSet = true;
1463  m_dynWordWrapAlignIndent = indent;
1464 
1465  configEnd ();
1466 }
1467 
1468 bool KateViewConfig::lineNumbers () const
1469 {
1470  if (m_lineNumbersSet || isGlobal())
1471  return m_lineNumbers;
1472 
1473  return s_global->lineNumbers();
1474 }
1475 
1476 void KateViewConfig::setLineNumbers (bool on)
1477 {
1478  if (m_lineNumbersSet && m_lineNumbers == on)
1479  return;
1480 
1481  configStart ();
1482 
1483  m_lineNumbersSet = true;
1484  m_lineNumbers = on;
1485 
1486  configEnd ();
1487 }
1488 
1489 bool KateViewConfig::scrollBarMarks () const
1490 {
1491  if (m_scrollBarMarksSet || isGlobal())
1492  return m_scrollBarMarks;
1493 
1494  return s_global->scrollBarMarks();
1495 }
1496 
1497 void KateViewConfig::setScrollBarMarks (bool on)
1498 {
1499  if (m_scrollBarMarksSet && m_scrollBarMarks == on)
1500  return;
1501 
1502  configStart ();
1503 
1504  m_scrollBarMarksSet = true;
1505  m_scrollBarMarks = on;
1506 
1507  configEnd ();
1508 }
1509 
1510 bool KateViewConfig::scrollBarMiniMap () const
1511 {
1512  if (m_scrollBarMiniMapSet || isGlobal())
1513  return m_scrollBarMiniMap;
1514 
1515  return s_global->scrollBarMiniMap();
1516 }
1517 
1518 void KateViewConfig::setScrollBarMiniMap (bool on)
1519 {
1520  if (m_scrollBarMiniMapSet && m_scrollBarMiniMap == on)
1521  return;
1522 
1523  configStart ();
1524 
1525  m_scrollBarMiniMapSet = true;
1526  m_scrollBarMiniMap = on;
1527 
1528  configEnd ();
1529 }
1530 
1531 bool KateViewConfig::scrollBarMiniMapAll () const
1532 {
1533  if (m_scrollBarMiniMapAllSet || isGlobal())
1534  return m_scrollBarMiniMapAll;
1535 
1536  return s_global->scrollBarMiniMapAll();
1537 }
1538 
1539 void KateViewConfig::setScrollBarMiniMapAll (bool on)
1540 {
1541  if (m_scrollBarMiniMapAllSet && m_scrollBarMiniMapAll == on)
1542  return;
1543 
1544  configStart ();
1545 
1546  m_scrollBarMiniMapAllSet = true;
1547  m_scrollBarMiniMapAll = on;
1548 
1549  configEnd ();
1550 }
1551 
1552 int KateViewConfig::scrollBarMiniMapWidth () const
1553 {
1554  if (m_scrollBarMiniMapWidthSet || isGlobal())
1555  return m_scrollBarMiniMapWidth;
1556 
1557  return s_global->scrollBarMiniMapWidth();
1558 }
1559 
1560 void KateViewConfig::setScrollBarMiniMapWidth (int width)
1561 {
1562  if (m_scrollBarMiniMapWidthSet && m_scrollBarMiniMapWidth == width)
1563  return;
1564 
1565  configStart ();
1566 
1567  m_scrollBarMiniMapWidthSet = true;
1568  m_scrollBarMiniMapWidth = width;
1569 
1570  configEnd ();
1571 }
1572 
1573 int KateViewConfig::showScrollbars() const
1574 {
1575  if (m_showScrollbarsSet || isGlobal())
1576  return m_showScrollbars;
1577 
1578  return s_global->showScrollbars();
1579 }
1580 
1581 void KateViewConfig::setShowScrollbars(int mode)
1582 {
1583  if (m_showScrollbarsSet && m_showScrollbars == mode)
1584  return;
1585 
1586  configStart ();
1587 
1588  m_showScrollbarsSet = true;
1589  m_showScrollbars = qBound(0, mode, 80);
1590 
1591  configEnd ();
1592 }
1593 
1594 bool KateViewConfig::iconBar () const
1595 {
1596  if (m_iconBarSet || isGlobal())
1597  return m_iconBar;
1598 
1599  return s_global->iconBar();
1600 }
1601 
1602 void KateViewConfig::setIconBar (bool on)
1603 {
1604  if (m_iconBarSet && m_iconBar == on)
1605  return;
1606 
1607  configStart ();
1608 
1609  m_iconBarSet = true;
1610  m_iconBar = on;
1611 
1612  configEnd ();
1613 }
1614 
1615 bool KateViewConfig::foldingBar () const
1616 {
1617  if (m_foldingBarSet || isGlobal())
1618  return m_foldingBar;
1619 
1620  return s_global->foldingBar();
1621 }
1622 
1623 void KateViewConfig::setFoldingBar (bool on)
1624 {
1625  if (m_foldingBarSet && m_foldingBar == on)
1626  return;
1627 
1628  configStart ();
1629 
1630  m_foldingBarSet = true;
1631  m_foldingBar = on;
1632 
1633  configEnd ();
1634 }
1635 
1636 bool KateViewConfig::lineModification () const
1637 {
1638  if (m_lineModificationSet || isGlobal())
1639  return m_lineModification;
1640 
1641  return s_global->lineModification();
1642 }
1643 
1644 void KateViewConfig::setLineModification (bool on)
1645 {
1646  if (m_lineModificationSet && m_lineModification == on)
1647  return;
1648 
1649  configStart ();
1650 
1651  m_lineModificationSet = true;
1652  m_lineModification = on;
1653 
1654  configEnd ();
1655 }
1656 
1657 int KateViewConfig::bookmarkSort () const
1658 {
1659  if (m_bookmarkSortSet || isGlobal())
1660  return m_bookmarkSort;
1661 
1662  return s_global->bookmarkSort();
1663 }
1664 
1665 void KateViewConfig::setBookmarkSort (int mode)
1666 {
1667  if (m_bookmarkSortSet && m_bookmarkSort == mode)
1668  return;
1669 
1670  configStart ();
1671 
1672  m_bookmarkSortSet = true;
1673  m_bookmarkSort = mode;
1674 
1675  configEnd ();
1676 }
1677 
1678 int KateViewConfig::autoCenterLines () const
1679 {
1680  if (m_autoCenterLinesSet || isGlobal())
1681  return m_autoCenterLines;
1682 
1683  return s_global->autoCenterLines();
1684 }
1685 
1686 void KateViewConfig::setAutoCenterLines (int lines)
1687 {
1688  if (lines < 0)
1689  return;
1690 
1691  if (m_autoCenterLinesSet && m_autoCenterLines == lines)
1692  return;
1693 
1694  configStart ();
1695 
1696  m_autoCenterLinesSet = true;
1697  m_autoCenterLines = lines;
1698 
1699  configEnd ();
1700 }
1701 
1702 long KateViewConfig::searchFlags () const
1703 {
1704  if (m_searchFlagsSet || isGlobal())
1705  return m_searchFlags;
1706 
1707  return s_global->searchFlags();
1708 }
1709 
1710 void KateViewConfig::setSearchFlags (long flags)
1711 {
1712  if (m_searchFlagsSet && m_searchFlags == flags)
1713  return;
1714 
1715  configStart ();
1716 
1717  m_searchFlagsSet = true;
1718  m_searchFlags = flags;
1719 
1720  configEnd ();
1721 }
1722 
1723 QStringListModel *KateViewConfig::patternHistoryModel()
1724 {
1725  // always return global history
1726  if (isGlobal())
1727  return &m_patternHistoryModel;
1728 
1729  return s_global->patternHistoryModel();
1730 }
1731 
1732 int KateViewConfig::maxHistorySize() const
1733 {
1734  return m_maxHistorySize;
1735 }
1736 
1737 QStringListModel *KateViewConfig::replacementHistoryModel()
1738 {
1739  // always return global history
1740  if (isGlobal())
1741  return &m_replacementHistoryModel;
1742 
1743  return s_global->replacementHistoryModel();
1744 }
1745 
1746 uint KateViewConfig::defaultMarkType () const
1747 {
1748  if (m_defaultMarkTypeSet || isGlobal())
1749  return m_defaultMarkType;
1750 
1751  return s_global->defaultMarkType();
1752 }
1753 
1754 void KateViewConfig::setDefaultMarkType (uint type)
1755 {
1756  if (m_defaultMarkTypeSet && m_defaultMarkType == type)
1757  return;
1758 
1759  configStart ();
1760 
1761  m_defaultMarkTypeSet = true;
1762  m_defaultMarkType = type;
1763 
1764  configEnd ();
1765 }
1766 
1767 bool KateViewConfig::allowMarkMenu() const
1768 {
1769  return m_allowMarkMenu;
1770 }
1771 
1772 void KateViewConfig::setAllowMarkMenu (bool allow)
1773 {
1774  m_allowMarkMenu = allow;
1775 }
1776 
1777 bool KateViewConfig::persistentSelection () const
1778 {
1779  if (m_persistentSelectionSet || isGlobal())
1780  return m_persistentSelection;
1781 
1782  return s_global->persistentSelection();
1783 }
1784 
1785 void KateViewConfig::setPersistentSelection (bool on)
1786 {
1787  if (m_persistentSelectionSet && m_persistentSelection == on)
1788  return;
1789 
1790  configStart ();
1791 
1792  m_persistentSelectionSet = true;
1793  m_persistentSelection = on;
1794 
1795  configEnd ();
1796 }
1797 
1798 bool KateViewConfig::viInputMode () const
1799 {
1800  if (m_viInputModeSet || isGlobal())
1801  return m_viInputMode;
1802 
1803  return s_global->viInputMode();
1804 }
1805 
1806 void KateViewConfig::setViInputMode (bool on)
1807 {
1808  if (m_viInputModeSet && m_viInputMode == on)
1809  return;
1810 
1811  configStart ();
1812 
1813  m_viInputModeSet = true;
1814  m_viInputMode = on;
1815 
1816  // make sure to turn off edits mergin when leaving vi input mode
1817  if (!on && m_view) {
1818  m_view->doc()->setUndoMergeAllEdits(false);
1819  }
1820 
1821  configEnd ();
1822 }
1823 
1824 bool KateViewConfig::viInputModeStealKeys () const
1825 {
1826  if (m_viInputModeStealKeysSet || isGlobal())
1827  return m_viInputModeStealKeys;
1828 
1829  return s_global->viInputModeStealKeys();
1830 }
1831 
1832 void KateViewConfig::setViInputModeStealKeys (bool on)
1833 {
1834  if (m_viInputModeStealKeysSet && m_viInputModeStealKeys == on)
1835  return;
1836 
1837  configStart ();
1838  m_viInputModeStealKeysSet = true;
1839  m_viInputModeStealKeys = on;
1840  configEnd ();
1841 }
1842 
1843 bool KateViewConfig::viRelativeLineNumbers() const
1844 {
1845  if (m_viRelativeLineNumbersSet || isGlobal())
1846  return m_viRelativeLineNumbers;
1847 
1848  return s_global->viRelativeLineNumbers();
1849 }
1850 
1851 void KateViewConfig::setViRelativeLineNumbers(bool on)
1852 {
1853  if (m_viRelativeLineNumbersSet && m_viRelativeLineNumbers == on)
1854  return;
1855 
1856  configStart();
1857  m_viRelativeLineNumbersSet = true;
1858  m_viRelativeLineNumbers = on;
1859  configEnd();
1860 }
1861 
1862 bool KateViewConfig::viInputModeEmulateCommandBar() const
1863 {
1864  if (m_viInputModeEmulateCommandBarSet || isGlobal())
1865  return m_viInputModeEmulateCommandBar;
1866 
1867  return s_global->viInputModeEmulateCommandBar();
1868 }
1869 
1870 void KateViewConfig::setViInputModeEmulateCommandBar(bool on)
1871 {
1872  if (m_viInputModeEmulateCommandBarSet && m_viInputModeEmulateCommandBar == on)
1873  return;
1874 
1875  configStart();
1876  m_viInputModeEmulateCommandBarSet = true;
1877  m_viInputModeEmulateCommandBar = on;
1878  configEnd();
1879 }
1880 
1881 bool KateViewConfig::automaticCompletionInvocation () const
1882 {
1883  if (m_automaticCompletionInvocationSet || isGlobal())
1884  return m_automaticCompletionInvocation;
1885 
1886  return s_global->automaticCompletionInvocation();
1887 }
1888 
1889 void KateViewConfig::setAutomaticCompletionInvocation (bool on)
1890 {
1891  if (m_automaticCompletionInvocationSet && m_automaticCompletionInvocation == on)
1892  return;
1893 
1894  configStart ();
1895  m_automaticCompletionInvocationSet = true;
1896  m_automaticCompletionInvocation = on;
1897  configEnd ();
1898 }
1899 
1900 bool KateViewConfig::wordCompletion () const
1901 {
1902  if (m_wordCompletionSet || isGlobal())
1903  return m_wordCompletion;
1904 
1905  return s_global->wordCompletion();
1906 }
1907 
1908 void KateViewConfig::setWordCompletion (bool on)
1909 {
1910  if (m_wordCompletionSet && m_wordCompletion == on)
1911  return;
1912 
1913  configStart ();
1914  m_wordCompletionSet = true;
1915  m_wordCompletion = on;
1916  configEnd ();
1917 }
1918 
1919 bool KateViewConfig::keywordCompletion() const
1920 {
1921  if (m_keywordCompletionSet || isGlobal())
1922  return m_keywordCompletion;
1923  return s_global->keywordCompletion();
1924 }
1925 
1926 void KateViewConfig::setKeywordCompletion(bool on)
1927 {
1928  if (m_keywordCompletionSet && m_keywordCompletion == on)
1929  return;
1930  configStart();
1931  m_keywordCompletionSet = true;
1932  m_keywordCompletion = on;
1933  configEnd();
1934 }
1935 
1936 int KateViewConfig::wordCompletionMinimalWordLength () const
1937 {
1938  if (m_wordCompletionMinimalWordLengthSet || isGlobal())
1939  return m_wordCompletionMinimalWordLength;
1940 
1941  return s_global->wordCompletionMinimalWordLength();
1942 }
1943 
1944 void KateViewConfig::setWordCompletionMinimalWordLength (int length)
1945 {
1946  if (m_wordCompletionMinimalWordLengthSet && m_wordCompletionMinimalWordLength == length)
1947  return;
1948 
1949  configStart ();
1950 
1951  m_wordCompletionMinimalWordLengthSet = true;
1952  m_wordCompletionMinimalWordLength = length;
1953 
1954  configEnd ();
1955 }
1956 
1957 bool KateViewConfig::wordCompletionRemoveTail () const
1958 {
1959  if (m_wordCompletionRemoveTailSet || isGlobal())
1960  return m_wordCompletionRemoveTail;
1961 
1962  return s_global->wordCompletionRemoveTail();
1963 }
1964 
1965 void KateViewConfig::setWordCompletionRemoveTail (bool on)
1966 {
1967  if (m_wordCompletionRemoveTailSet && m_wordCompletionRemoveTail == on)
1968  return;
1969 
1970  configStart ();
1971  m_wordCompletionRemoveTailSet = true;
1972  m_wordCompletionRemoveTail = on;
1973  configEnd ();
1974 }
1975 
1976 bool KateViewConfig::smartCopyCut () const
1977 {
1978  if (m_smartCopyCutSet || isGlobal())
1979  return m_smartCopyCut;
1980 
1981  return s_global->smartCopyCut();
1982 }
1983 
1984 void KateViewConfig::setSmartCopyCut (bool on)
1985 {
1986  if (m_smartCopyCutSet && m_smartCopyCut == on)
1987  return;
1988 
1989  configStart ();
1990 
1991  m_smartCopyCutSet = true;
1992  m_smartCopyCut = on;
1993 
1994  configEnd ();
1995 }
1996 
1997 bool KateViewConfig::scrollPastEnd () const
1998 {
1999  if (m_scrollPastEndSet || isGlobal())
2000  return m_scrollPastEnd;
2001 
2002  return s_global->scrollPastEnd();
2003 }
2004 
2005 void KateViewConfig::setScrollPastEnd (bool on)
2006 {
2007  if (m_scrollPastEndSet && m_scrollPastEnd == on)
2008  return;
2009 
2010  configStart ();
2011 
2012  m_scrollPastEndSet = true;
2013  m_scrollPastEnd = on;
2014 
2015  configEnd ();
2016 }
2017 
2018 bool KateViewConfig::foldFirstLine() const
2019 {
2020  if (m_foldFirstLineSet || isGlobal())
2021  return m_foldFirstLine;
2022 
2023  return s_global->foldFirstLine();
2024 }
2025 
2026 void KateViewConfig::setFoldFirstLine(bool on)
2027 {
2028  if (m_foldFirstLineSet && m_foldFirstLine == on)
2029  return;
2030 
2031  configStart ();
2032 
2033  m_foldFirstLineSet = true;
2034  m_foldFirstLine = on;
2035 
2036  configEnd ();
2037 }
2038 
2039 //END
2040 
2041 //BEGIN KateRendererConfig
2042 KateRendererConfig::KateRendererConfig ()
2043  : m_fontMetrics(QFont()),
2044  m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
2045  m_wordWrapMarker (false),
2046  m_showIndentationLines (false),
2047  m_showWholeBracketExpression (false),
2048  m_animateBracketMatching (false),
2049  m_schemaSet (false),
2050  m_fontSet (false),
2051  m_wordWrapMarkerSet (false),
2052  m_showIndentationLinesSet (false),
2053  m_showWholeBracketExpressionSet (false),
2054  m_backgroundColorSet (false),
2055  m_selectionColorSet (false),
2056  m_highlightedLineColorSet (false),
2057  m_highlightedBracketColorSet (false),
2058  m_wordWrapMarkerColorSet (false),
2059  m_tabMarkerColorSet (false),
2060  m_indentationLineColorSet (false),
2061  m_iconBarColorSet (false),
2062  m_foldingColorSet (false),
2063  m_lineNumberColorSet (false),
2064  m_separatorColorSet (false),
2065  m_spellingMistakeLineColorSet (false),
2066  m_templateColorsSet (false),
2067  m_modifiedLineColorSet (false),
2068  m_savedLineColorSet (false),
2069  m_searchHighlightColorSet (false),
2070  m_replaceHighlightColorSet (false),
2071  m_lineMarkerColorSet (m_lineMarkerColor.size()),
2072  m_renderer (0)
2073 {
2074  // init bitarray
2075  m_lineMarkerColorSet.fill (true);
2076 
2077  s_global = this;
2078 
2079  // init with defaults from config or really hardcoded ones
2080  KConfigGroup config(KGlobal::config(), "Kate Renderer Defaults");
2081  readConfig (config);
2082 }
2083 
2084 KateRendererConfig::KateRendererConfig (KateRenderer *renderer)
2085  : m_fontMetrics(QFont()),
2086  m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
2087  m_schemaSet (false),
2088  m_fontSet (false),
2089  m_wordWrapMarkerSet (false),
2090  m_showIndentationLinesSet (false),
2091  m_showWholeBracketExpressionSet (false),
2092  m_backgroundColorSet (false),
2093  m_selectionColorSet (false),
2094  m_highlightedLineColorSet (false),
2095  m_highlightedBracketColorSet (false),
2096  m_wordWrapMarkerColorSet (false),
2097  m_tabMarkerColorSet (false),
2098  m_indentationLineColorSet (false),
2099  m_iconBarColorSet (false),
2100  m_foldingColorSet (false),
2101  m_lineNumberColorSet (false),
2102  m_separatorColorSet (false),
2103  m_spellingMistakeLineColorSet (false),
2104  m_templateColorsSet(false),
2105  m_modifiedLineColorSet(false),
2106  m_savedLineColorSet(false),
2107  m_searchHighlightColorSet(false),
2108  m_replaceHighlightColorSet(false),
2109  m_lineMarkerColorSet (m_lineMarkerColor.size()),
2110  m_renderer (renderer)
2111 {
2112  // init bitarray
2113  m_lineMarkerColorSet.fill (false);
2114 }
2115 
2116 KateRendererConfig::~KateRendererConfig ()
2117 {
2118 }
2119 
2120 namespace
2121 {
2122  const char * const KEY_SCHEMA = "Schema";
2123  const char * const KEY_WORD_WRAP_MARKER = "Word Wrap Marker";
2124  const char * const KEY_SHOW_INDENTATION_LINES = "Show Indentation Lines";
2125  const char * const KEY_SHOW_WHOLE_BRACKET_EXPRESSION = "Show Whole Bracket Expression";
2126  const char * const KEY_ANIMATE_BRACKET_MATCHING = "Animate Bracket Matching";
2127 }
2128 
2129 void KateRendererConfig::readConfig (const KConfigGroup &config)
2130 {
2131  configStart ();
2132 
2133  // "Normal" Schema MUST BE THERE, see global kateschemarc
2134  setSchema (config.readEntry(KEY_SCHEMA, "Normal"));
2135 
2136  setWordWrapMarker (config.readEntry(KEY_WORD_WRAP_MARKER, false ));
2137 
2138  setShowIndentationLines (config.readEntry( KEY_SHOW_INDENTATION_LINES, false));
2139 
2140  setShowWholeBracketExpression (config.readEntry( KEY_SHOW_WHOLE_BRACKET_EXPRESSION, false));
2141 
2142  setAnimateBracketMatching(config.readEntry(KEY_ANIMATE_BRACKET_MATCHING, false));
2143 
2144  configEnd ();
2145 }
2146 
2147 void KateRendererConfig::writeConfig (KConfigGroup& config)
2148 {
2149  config.writeEntry (KEY_SCHEMA, schema());
2150 
2151  config.writeEntry(KEY_WORD_WRAP_MARKER, wordWrapMarker() );
2152 
2153  config.writeEntry(KEY_SHOW_INDENTATION_LINES, showIndentationLines());
2154 
2155  config.writeEntry(KEY_SHOW_WHOLE_BRACKET_EXPRESSION, showWholeBracketExpression());
2156 
2157  config.writeEntry(KEY_ANIMATE_BRACKET_MATCHING, animateBracketMatching());
2158 }
2159 
2160 void KateRendererConfig::updateConfig ()
2161 {
2162  if (m_renderer)
2163  {
2164  m_renderer->updateConfig ();
2165  return;
2166  }
2167 
2168  if (isGlobal())
2169  {
2170  for (int z=0; z < KateGlobal::self()->views().size(); ++z)
2171  (KateGlobal::self()->views())[z]->renderer()->updateConfig ();
2172  }
2173 }
2174 
2175 const QString &KateRendererConfig::schema () const
2176 {
2177  if (m_schemaSet || isGlobal())
2178  return m_schema;
2179 
2180  return s_global->schema();
2181 }
2182 
2183 void KateRendererConfig::setSchema (const QString &schema)
2184 {
2185  if (m_schemaSet && m_schema == schema)
2186  return;
2187 
2188  configStart ();
2189  m_schemaSet = true;
2190  m_schema = schema;
2191  setSchemaInternal( schema );
2192  configEnd ();
2193 }
2194 
2195 void KateRendererConfig::reloadSchema()
2196 {
2197  if ( isGlobal() ) {
2198  setSchemaInternal( m_schema );
2199  foreach (KateView* view, KateGlobal::self()->views() )
2200  view->renderer()->config()->reloadSchema();
2201  }
2202 
2203  else if ( m_renderer && m_schemaSet )
2204  setSchemaInternal( m_schema );
2205 }
2206 
2207 void KateRendererConfig::setSchemaInternal( const QString &schema )
2208 {
2209  m_schemaSet = true;
2210  m_schema = schema;
2211 
2212  KConfigGroup config = KateGlobal::self()->schemaManager()->schema(schema);
2213 
2214  KateDefaultColors colors;
2215 
2216  m_backgroundColor = config.readEntry("Color Background", colors.color(Kate::Background));
2217  m_backgroundColorSet = true;
2218  m_selectionColor = config.readEntry("Color Selection", colors.color(Kate::SelectionBackground));
2219  m_selectionColorSet = true;
2220  m_highlightedLineColor = config.readEntry("Color Highlighted Line", colors.color(Kate::HighlightedLineBackground));
2221  m_highlightedLineColorSet = true;
2222  m_highlightedBracketColor = config.readEntry("Color Highlighted Bracket", colors.color(Kate::HighlightedBracket));
2223  m_highlightedBracketColorSet = true;
2224  m_wordWrapMarkerColor = config.readEntry("Color Word Wrap Marker", colors.color(Kate::WordWrapMarker));
2225  m_wordWrapMarkerColorSet = true;
2226  m_tabMarkerColor = config.readEntry("Color Tab Marker", colors.color(Kate::TabMarker));
2227  m_tabMarkerColorSet = true;
2228  m_indentationLineColor = config.readEntry("Color Indentation Line", colors.color(Kate::IndentationLine));
2229  m_indentationLineColorSet = true;
2230  m_iconBarColor = config.readEntry("Color Icon Bar", colors.color(Kate::IconBar));
2231  m_iconBarColorSet = true;
2232  m_foldingColor = config.readEntry("Color Code Folding", colors.color(Kate::CodeFolding));
2233  m_foldingColorSet = true;
2234  m_lineNumberColor = config.readEntry("Color Line Number", colors.color(Kate::LineNumber));
2235  m_lineNumberColorSet = true;
2236  m_separatorColor = config.readEntry("Color Separator", colors.color(Kate::Separator));
2237  m_separatorColorSet = true;
2238  m_spellingMistakeLineColor = config.readEntry("Color Spelling Mistake Line", colors.color(Kate::SpellingMistakeLine));
2239  m_spellingMistakeLineColorSet = true;
2240 
2241  m_modifiedLineColor = config.readEntry("Color Modified Lines", colors.color(Kate::ModifiedLine));
2242  m_modifiedLineColorSet = true;
2243  m_savedLineColor = config.readEntry("Color Saved Lines", colors.color(Kate::SavedLine));
2244  m_savedLineColorSet = true;
2245  m_searchHighlightColor = config.readEntry("Color Search Highlight", colors.color(Kate::SearchHighlight));
2246  m_searchHighlightColorSet = true;
2247  m_replaceHighlightColor = config.readEntry("Color Replace Highlight", colors.color(Kate::ReplaceHighlight));
2248  m_replaceHighlightColorSet = true;
2249 
2250  for (int i = Kate::FIRST_MARK; i <= Kate::LAST_MARK; i++) {
2251  QColor col = config.readEntry(QString("Color MarkType %1").arg(i + 1), colors.mark(i));
2252  m_lineMarkerColorSet[i] = true;
2253  m_lineMarkerColor[i] = col;
2254  }
2255 
2256  QFont f (KGlobalSettings::fixedFont());
2257 
2258  m_font = config.readEntry("Font", f);
2259  m_fontMetrics = QFontMetricsF (m_font);
2260  m_fontSet = true;
2261 
2262  m_templateBackgroundColor = config.readEntry(QString("Color Template Background"), colors.color(Kate::TemplateBackground));
2263 
2264  m_templateFocusedEditablePlaceholderColor = config.readEntry(QString("Color Template Focused Editable Placeholder"),
2265  colors.color(Kate::TemplateFocusedEditablePlaceholder));
2266 
2267  m_templateEditablePlaceholderColor = config.readEntry(QString("Color Template Editable Placeholder"),
2268  colors.color(Kate::TemplateEditablePlaceholder));
2269 
2270  m_templateNotEditablePlaceholderColor = config.readEntry(QString("Color Template Not Editable Placeholder"),
2271  colors.color(Kate::TemplateNotEditablePlaceholder));
2272 
2273  m_templateColorsSet=true;
2274 }
2275 
2276 const QFont& KateRendererConfig::font() const
2277 {
2278  if (m_fontSet || isGlobal())
2279  return m_font;
2280 
2281  return s_global->font();
2282 }
2283 
2284 const QFontMetricsF& KateRendererConfig::fontMetrics() const
2285 {
2286  if (m_fontSet || isGlobal())
2287  return m_fontMetrics;
2288 
2289  return s_global->fontMetrics();
2290 }
2291 
2292 void KateRendererConfig::setFont(const QFont &font)
2293 {
2294  if (m_fontSet && m_font == font)
2295  return;
2296 
2297  configStart ();
2298 
2299  m_fontSet = true;
2300  m_font = font;
2301  m_fontMetrics = QFontMetricsF (m_font);
2302 
2303  configEnd ();
2304 }
2305 
2306 bool KateRendererConfig::wordWrapMarker () const
2307 {
2308  if (m_wordWrapMarkerSet || isGlobal())
2309  return m_wordWrapMarker;
2310 
2311  return s_global->wordWrapMarker();
2312 }
2313 
2314 void KateRendererConfig::setWordWrapMarker (bool on)
2315 {
2316  if (m_wordWrapMarkerSet && m_wordWrapMarker == on)
2317  return;
2318 
2319  configStart ();
2320 
2321  m_wordWrapMarkerSet = true;
2322  m_wordWrapMarker = on;
2323 
2324  configEnd ();
2325 }
2326 
2327 const QColor& KateRendererConfig::backgroundColor() const
2328 {
2329  if (m_backgroundColorSet || isGlobal())
2330  return m_backgroundColor;
2331 
2332  return s_global->backgroundColor();
2333 }
2334 
2335 void KateRendererConfig::setBackgroundColor (const QColor &col)
2336 {
2337  if (m_backgroundColorSet && m_backgroundColor == col)
2338  return;
2339 
2340  configStart ();
2341 
2342  m_backgroundColorSet = true;
2343  m_backgroundColor = col;
2344 
2345  configEnd ();
2346 }
2347 
2348 const QColor& KateRendererConfig::selectionColor() const
2349 {
2350  if (m_selectionColorSet || isGlobal())
2351  return m_selectionColor;
2352 
2353  return s_global->selectionColor();
2354 }
2355 
2356 void KateRendererConfig::setSelectionColor (const QColor &col)
2357 {
2358  if (m_selectionColorSet && m_selectionColor == col)
2359  return;
2360 
2361  configStart ();
2362 
2363  m_selectionColorSet = true;
2364  m_selectionColor = col;
2365 
2366  configEnd ();
2367 }
2368 
2369 const QColor& KateRendererConfig::highlightedLineColor() const
2370 {
2371  if (m_highlightedLineColorSet || isGlobal())
2372  return m_highlightedLineColor;
2373 
2374  return s_global->highlightedLineColor();
2375 }
2376 
2377 void KateRendererConfig::setHighlightedLineColor (const QColor &col)
2378 {
2379  if (m_highlightedLineColorSet && m_highlightedLineColor == col)
2380  return;
2381 
2382  configStart ();
2383 
2384  m_highlightedLineColorSet = true;
2385  m_highlightedLineColor = col;
2386 
2387  configEnd ();
2388 }
2389 
2390 const QColor& KateRendererConfig::lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type) const
2391 {
2392  int index = 0;
2393  if (type > 0) { while((type >> index++) ^ 1) {} }
2394  index -= 1;
2395 
2396  if ( index < 0 || index >= KTextEditor::MarkInterface::reservedMarkersCount() )
2397  {
2398  static QColor dummy;
2399  return dummy;
2400  }
2401 
2402  if (m_lineMarkerColorSet[index] || isGlobal())
2403  return m_lineMarkerColor[index];
2404 
2405  return s_global->lineMarkerColor( type );
2406 }
2407 
2408 void KateRendererConfig::setLineMarkerColor (const QColor &col, KTextEditor::MarkInterface::MarkTypes type)
2409 {
2410  int index = static_cast<int>( log(static_cast<double>(type)) / log(2.0) );
2411  Q_ASSERT( index >= 0 && index < KTextEditor::MarkInterface::reservedMarkersCount() );
2412 
2413  if (m_lineMarkerColorSet[index] && m_lineMarkerColor[index] == col)
2414  return;
2415 
2416  configStart ();
2417 
2418  m_lineMarkerColorSet[index] = true;
2419  m_lineMarkerColor[index] = col;
2420 
2421  configEnd ();
2422 }
2423 
2424 const QColor& KateRendererConfig::highlightedBracketColor() const
2425 {
2426  if (m_highlightedBracketColorSet || isGlobal())
2427  return m_highlightedBracketColor;
2428 
2429  return s_global->highlightedBracketColor();
2430 }
2431 
2432 void KateRendererConfig::setHighlightedBracketColor (const QColor &col)
2433 {
2434  if (m_highlightedBracketColorSet && m_highlightedBracketColor == col)
2435  return;
2436 
2437  configStart ();
2438 
2439  m_highlightedBracketColorSet = true;
2440  m_highlightedBracketColor = col;
2441 
2442  configEnd ();
2443 }
2444 
2445 const QColor& KateRendererConfig::wordWrapMarkerColor() const
2446 {
2447  if (m_wordWrapMarkerColorSet || isGlobal())
2448  return m_wordWrapMarkerColor;
2449 
2450  return s_global->wordWrapMarkerColor();
2451 }
2452 
2453 void KateRendererConfig::setWordWrapMarkerColor (const QColor &col)
2454 {
2455  if (m_wordWrapMarkerColorSet && m_wordWrapMarkerColor == col)
2456  return;
2457 
2458  configStart ();
2459 
2460  m_wordWrapMarkerColorSet = true;
2461  m_wordWrapMarkerColor = col;
2462 
2463  configEnd ();
2464 }
2465 
2466 const QColor& KateRendererConfig::tabMarkerColor() const
2467 {
2468  if (m_tabMarkerColorSet || isGlobal())
2469  return m_tabMarkerColor;
2470 
2471  return s_global->tabMarkerColor();
2472 }
2473 
2474 void KateRendererConfig::setTabMarkerColor (const QColor &col)
2475 {
2476  if (m_tabMarkerColorSet && m_tabMarkerColor == col)
2477  return;
2478 
2479  configStart ();
2480 
2481  m_tabMarkerColorSet = true;
2482  m_tabMarkerColor = col;
2483 
2484  configEnd ();
2485 }
2486 
2487 const QColor& KateRendererConfig::indentationLineColor() const
2488 {
2489  if (m_indentationLineColorSet || isGlobal())
2490  return m_indentationLineColor;
2491 
2492  return s_global->indentationLineColor();
2493 }
2494 
2495 void KateRendererConfig::setIndentationLineColor (const QColor &col)
2496 {
2497  if (m_indentationLineColorSet && m_indentationLineColor == col)
2498  return;
2499 
2500  configStart ();
2501 
2502  m_indentationLineColorSet = true;
2503  m_indentationLineColor = col;
2504 
2505  configEnd ();
2506 }
2507 
2508 const QColor& KateRendererConfig::iconBarColor() const
2509 {
2510  if (m_iconBarColorSet || isGlobal())
2511  return m_iconBarColor;
2512 
2513  return s_global->iconBarColor();
2514 }
2515 
2516 void KateRendererConfig::setIconBarColor (const QColor &col)
2517 {
2518  if (m_iconBarColorSet && m_iconBarColor == col)
2519  return;
2520 
2521  configStart ();
2522 
2523  m_iconBarColorSet = true;
2524  m_iconBarColor = col;
2525 
2526  configEnd ();
2527 }
2528 
2529 const QColor& KateRendererConfig::foldingColor() const
2530 {
2531  if (m_foldingColorSet || isGlobal())
2532  return m_foldingColor;
2533 
2534  return s_global->foldingColor();
2535 }
2536 
2537 void KateRendererConfig::setFoldingColor (const QColor &col)
2538 {
2539  if (m_foldingColorSet && m_foldingColor == col)
2540  return;
2541 
2542  configStart ();
2543 
2544  m_foldingColorSet = true;
2545  m_foldingColor = col;
2546 
2547  configEnd ();
2548 }
2549 
2550 const QColor &KateRendererConfig::templateBackgroundColor() const
2551 {
2552  if (m_templateColorsSet || isGlobal())
2553  return m_templateBackgroundColor;
2554 
2555  return s_global->templateBackgroundColor();
2556 }
2557 
2558 const QColor &KateRendererConfig::templateEditablePlaceholderColor() const
2559 {
2560  if (m_templateColorsSet || isGlobal())
2561  return m_templateEditablePlaceholderColor;
2562 
2563  return s_global->templateEditablePlaceholderColor();
2564 }
2565 
2566 const QColor &KateRendererConfig::templateFocusedEditablePlaceholderColor() const
2567 {
2568  if (m_templateColorsSet || isGlobal())
2569  return m_templateFocusedEditablePlaceholderColor;
2570 
2571  return s_global->templateFocusedEditablePlaceholderColor();
2572 }
2573 
2574 const QColor &KateRendererConfig::templateNotEditablePlaceholderColor() const
2575 {
2576  if (m_templateColorsSet || isGlobal())
2577  return m_templateNotEditablePlaceholderColor;
2578 
2579  return s_global->templateNotEditablePlaceholderColor();
2580 }
2581 
2582 const QColor& KateRendererConfig::lineNumberColor() const
2583 {
2584  if (m_lineNumberColorSet || isGlobal())
2585  return m_lineNumberColor;
2586 
2587  return s_global->lineNumberColor();
2588 }
2589 
2590 void KateRendererConfig::setLineNumberColor (const QColor &col)
2591 {
2592  if (m_lineNumberColorSet && m_lineNumberColor == col)
2593  return;
2594 
2595  configStart ();
2596 
2597  m_lineNumberColorSet = true;
2598  m_lineNumberColor = col;
2599 
2600  configEnd ();
2601 }
2602 
2603 const QColor& KateRendererConfig::separatorColor() const
2604 {
2605  if (m_separatorColorSet || isGlobal())
2606  return m_separatorColor;
2607 
2608  return s_global->separatorColor();
2609 }
2610 
2611 void KateRendererConfig::setSeparatorColor(const QColor& col)
2612 {
2613  if (m_separatorColorSet && m_separatorColor == col)
2614  return;
2615 
2616  configStart ();
2617 
2618  m_separatorColorSet = true;
2619  m_separatorColor = col;
2620 
2621  configEnd ();
2622 }
2623 
2624 const QColor& KateRendererConfig::spellingMistakeLineColor() const
2625 {
2626  if (m_spellingMistakeLineColorSet || isGlobal())
2627  return m_spellingMistakeLineColor;
2628 
2629  return s_global->spellingMistakeLineColor();
2630 }
2631 
2632 void KateRendererConfig::setSpellingMistakeLineColor (const QColor &col)
2633 {
2634  if (m_spellingMistakeLineColorSet && m_spellingMistakeLineColor == col)
2635  return;
2636 
2637  configStart ();
2638 
2639  m_spellingMistakeLineColorSet = true;
2640  m_spellingMistakeLineColor = col;
2641 
2642  configEnd ();
2643 }
2644 
2645 const QColor& KateRendererConfig::modifiedLineColor() const
2646 {
2647  if (m_modifiedLineColorSet || isGlobal())
2648  return m_modifiedLineColor;
2649 
2650  return s_global->modifiedLineColor();
2651 }
2652 
2653 void KateRendererConfig::setModifiedLineColor(const QColor &col)
2654 {
2655  if (m_modifiedLineColorSet && m_modifiedLineColor == col)
2656  return;
2657 
2658  configStart ();
2659 
2660  m_modifiedLineColorSet = true;
2661  m_modifiedLineColor = col;
2662 
2663  configEnd ();
2664 }
2665 
2666 const QColor& KateRendererConfig::savedLineColor() const
2667 {
2668  if (m_savedLineColorSet || isGlobal())
2669  return m_savedLineColor;
2670 
2671  return s_global->savedLineColor();
2672 }
2673 
2674 void KateRendererConfig::setSavedLineColor(const QColor &col)
2675 {
2676  if (m_savedLineColorSet && m_savedLineColor == col)
2677  return;
2678 
2679  configStart ();
2680 
2681  m_savedLineColorSet = true;
2682  m_savedLineColor = col;
2683 
2684  configEnd ();
2685 }
2686 
2687 const QColor& KateRendererConfig::searchHighlightColor() const
2688 {
2689  if (m_searchHighlightColorSet || isGlobal())
2690  return m_searchHighlightColor;
2691 
2692  return s_global->searchHighlightColor();
2693 }
2694 
2695 void KateRendererConfig::setSearchHighlightColor(const QColor &col)
2696 {
2697  if (m_searchHighlightColorSet && m_searchHighlightColor == col)
2698  return;
2699 
2700  configStart ();
2701 
2702  m_searchHighlightColorSet = true;
2703  m_searchHighlightColor = col;
2704 
2705  configEnd ();
2706 }
2707 
2708 const QColor& KateRendererConfig::replaceHighlightColor() const
2709 {
2710  if (m_replaceHighlightColorSet || isGlobal())
2711  return m_replaceHighlightColor;
2712 
2713  return s_global->replaceHighlightColor();
2714 }
2715 
2716 void KateRendererConfig::setReplaceHighlightColor(const QColor &col)
2717 {
2718  if (m_replaceHighlightColorSet && m_replaceHighlightColor == col)
2719  return;
2720 
2721  configStart ();
2722 
2723  m_replaceHighlightColorSet = true;
2724  m_replaceHighlightColor = col;
2725 
2726  configEnd ();
2727 }
2728 
2729 
2730 bool KateRendererConfig::showIndentationLines () const
2731 {
2732  if (m_showIndentationLinesSet || isGlobal())
2733  return m_showIndentationLines;
2734 
2735  return s_global->showIndentationLines();
2736 }
2737 
2738 void KateRendererConfig::setShowIndentationLines (bool on)
2739 {
2740  if (m_showIndentationLinesSet && m_showIndentationLines == on)
2741  return;
2742 
2743  configStart ();
2744 
2745  m_showIndentationLinesSet = true;
2746  m_showIndentationLines = on;
2747 
2748  configEnd ();
2749 }
2750 
2751 bool KateRendererConfig::showWholeBracketExpression () const
2752 {
2753  if (m_showWholeBracketExpressionSet || isGlobal())
2754  return m_showWholeBracketExpression;
2755 
2756  return s_global->showWholeBracketExpression();
2757 }
2758 
2759 void KateRendererConfig::setShowWholeBracketExpression (bool on)
2760 {
2761  if (m_showWholeBracketExpressionSet && m_showWholeBracketExpression == on)
2762  return;
2763 
2764  configStart ();
2765 
2766  m_showWholeBracketExpressionSet = true;
2767  m_showWholeBracketExpression = on;
2768 
2769  configEnd ();
2770 }
2771 
2772 bool KateRendererConfig::animateBracketMatching () const
2773 {
2774  return s_global->m_animateBracketMatching;
2775 }
2776 
2777 void KateRendererConfig::setAnimateBracketMatching (bool on)
2778 {
2779  if (!isGlobal()) {
2780  s_global->setAnimateBracketMatching (on);
2781  } else if (on != m_animateBracketMatching) {
2782  configStart ();
2783  m_animateBracketMatching = on;
2784  configEnd ();
2785  }
2786 }
2787 
2788 //END
2789 
2790 // kate: space-indent on; indent-width 2; replace-tabs on;
KateDocumentConfig::setKeepExtraSpaces
void setKeepExtraSpaces(bool on)
Definition: kateconfig.cpp:598
Kate::SearchHighlight
Definition: katedefaultcolors.h:33
KateRendererConfig::showWholeBracketExpression
bool showWholeBracketExpression() const
Definition: kateconfig.cpp:2751
KateViewConfig::setWordCompletionRemoveTail
void setWordCompletionRemoveTail(bool on)
Definition: kateconfig.cpp:1965
KateRendererConfig::setSchema
void setSchema(const QString &schema)
Definition: kateconfig.cpp:2183
KateRenderer::updateConfig
void updateConfig()
Definition: katerenderer.cpp:877
kateview.h
KateDocumentConfig::backupPrefix
const QString & backupPrefix() const
Definition: kateconfig.cpp:1000
KateDocumentConfig::keepExtraSpaces
bool keepExtraSpaces() const
Definition: kateconfig.cpp:611
KateRendererConfig::selectionColor
const QColor & selectionColor() const
Definition: kateconfig.cpp:2348
KateDocumentConfig::eolString
QString eolString()
Definition: kateconfig.cpp:891
KateDocumentConfig::setIndentationMode
void setIndentationMode(const QString &identationMode)
Definition: kateconfig.cpp:500
KateViewConfig::viInputModeEmulateCommandBar
bool viInputModeEmulateCommandBar() const
Definition: kateconfig.cpp:1862
Kate::TemplateNotEditablePlaceholder
Definition: katedefaultcolors.h:52
KateRendererConfig::wordWrapMarker
bool wordWrapMarker() const
Definition: kateconfig.cpp:2306
KateViewConfig::setViInputModeStealKeys
void setViInputModeStealKeys(bool on)
Definition: kateconfig.cpp:1832
KateRendererConfig::highlightedBracketColor
const QColor & highlightedBracketColor() const
Definition: kateconfig.cpp:2424
dummy
static int dummy
Definition: katedocument.cpp:101
KateViewConfig::setFoldFirstLine
void setFoldFirstLine(bool on)
Definition: kateconfig.cpp:2026
KateGlobal::kateDocuments
QList< KateDocument * > & kateDocuments()
return a list of all registered docs
Definition: kateglobal.h:267
KateRendererConfig::setHighlightedBracketColor
void setHighlightedBracketColor(const QColor &col)
Definition: kateconfig.cpp:2432
KateConfig::updateConfig
virtual void updateConfig()=0
do the real update
QTextCodec::name
virtual QByteArray name() const =0
KateView::renderer
KateRenderer * renderer()
Definition: kateview.cpp:1664
katerenderer.h
KateRendererConfig::lineMarkerColor
const QColor & lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type=KTextEditor::MarkInterface::markType01) const
Definition: kateconfig.cpp:2390
KateDocumentConfig::setTabHandling
void setTabHandling(uint tabHandling)
Definition: kateconfig.cpp:523
KateDocumentConfig::ovr
bool ovr() const
Definition: kateconfig.cpp:800
KateViewConfig::smartCopyCut
bool smartCopyCut() const
Definition: kateconfig.cpp:1976
KateViewConfig::scrollBarMarks
bool scrollBarMarks() const
Definition: kateconfig.cpp:1489
KateDocumentConfig::onTheFlySpellCheck
bool onTheFlySpellCheck() const
Definition: kateconfig.cpp:1084
KateDocumentConfig::setAllowEolDetection
void setAllowEolDetection(bool on)
Definition: kateconfig.cpp:945
KateViewConfig::AlwaysOn
Definition: kateconfig.h:447
KateRendererConfig::replaceHighlightColor
const QColor & replaceHighlightColor() const
Definition: kateconfig.cpp:2708
KateDocumentConfig::setNewLineAtEof
void setNewLineAtEof(bool on)
Definition: kateconfig.cpp:766
KateRendererConfig::setFoldingColor
void setFoldingColor(const QColor &col)
Definition: kateconfig.cpp:2537
KateRendererConfig::setLineMarkerColor
void setLineMarkerColor(const QColor &col, KTextEditor::MarkInterface::MarkTypes type=KTextEditor::MarkInterface::markType01)
Definition: kateconfig.cpp:2408
KateViewConfig::setShowScrollbars
void setShowScrollbars(int mode)
Definition: kateconfig.cpp:1581
KateDocumentConfig::showSpaces
bool showSpaces() const
Definition: kateconfig.cpp:716
KateDefaultColors::color
QColor color(Kate::ColorRole color) const
Definition: katedefaultcolors.cpp:41
KateDocumentConfig::setOvr
void setOvr(bool on)
Definition: kateconfig.cpp:787
Kate::LAST_MARK
Definition: katedefaultcolors.h:65
KateViewConfig::setViInputModeEmulateCommandBar
void setViInputModeEmulateCommandBar(bool on)
Definition: kateconfig.cpp:1870
KateViewConfig::scrollBarMiniMap
bool scrollBarMiniMap() const
Definition: kateconfig.cpp:1510
KateViewConfig::lineModification
bool lineModification() const
Definition: kateconfig.cpp:1636
KateViewConfig::wordCompletionMinimalWordLength
int wordCompletionMinimalWordLength() const
Definition: kateconfig.cpp:1936
KateDocumentConfig::setBackupSuffix
void setBackupSuffix(const QString &suffix)
Definition: kateconfig.cpp:1029
KateDocumentConfig::indentPastedText
bool indentPastedText() const
Definition: kateconfig.cpp:632
KateViewConfig::setIconBar
void setIconBar(bool on)
Definition: kateconfig.cpp:1602
QFont
KateViewConfig::setScrollBarMiniMapAll
void setScrollBarMiniMapAll(bool on)
Definition: kateconfig.cpp:1539
KateViewConfig::setLineModification
void setLineModification(bool on)
Definition: kateconfig.cpp:1644
KateDocumentConfig::setTabIndents
void setTabIndents(bool on)
Definition: kateconfig.cpp:808
Kate::IndentationLine
Definition: katedefaultcolors.h:38
KateConfig::configEnd
void configEnd()
end a config change transaction, update the concerned documents/views/renderers
Definition: kateconfig.cpp:64
Kate::TemplateFocusedEditablePlaceholder
Definition: katedefaultcolors.h:50
KateDocument::updateConfig
void updateConfig()
Definition: katedocument.cpp:3964
KateViewConfig::setWordCompletion
void setWordCompletion(bool on)
Definition: kateconfig.cpp:1908
KateGlobalConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:115
katedocument.h
KateRendererConfig::iconBarColor
const QColor & iconBarColor() const
Definition: kateconfig.cpp:2508
KateDocumentConfig::isGlobal
bool isGlobal() const
Definition: kateconfig.h:167
KateDocumentConfig::wordWrapAt
int wordWrapAt() const
Definition: kateconfig.cpp:553
KateDocumentConfig::readConfig
void readConfig(const KConfigGroup &config)
Read config from object.
Definition: kateconfig.cpp:325
Kate::Background
Definition: katedefaultcolors.h:30
KateRendererConfig::setFont
void setFont(const QFont &font)
Definition: kateconfig.cpp:2292
KateGlobal::self
static KateGlobal * self()
Kate Part Internal stuff ;)
Definition: kateglobal.cpp:465
KateDocumentConfig::setSwapFileNoSync
void setSwapFileNoSync(bool on)
Definition: kateconfig.cpp:1050
KateDocumentConfig::eolMac
Definition: kateconfig.h:260
KateDocumentConfig::eolUnix
Definition: kateconfig.h:258
KateRendererConfig::wordWrapMarkerColor
const QColor & wordWrapMarkerColor() const
Definition: kateconfig.cpp:2445
Kate::FIRST_MARK
Definition: katedefaultcolors.h:64
KateRendererConfig::setSelectionColor
void setSelectionColor(const QColor &col)
Definition: kateconfig.cpp:2356
KateRendererConfig::foldingColor
const QColor & foldingColor() const
Definition: kateconfig.cpp:2529
KateRendererConfig::animateBracketMatching
bool animateBracketMatching() const
Definition: kateconfig.cpp:2772
KateRendererConfig::setSpellingMistakeLineColor
void setSpellingMistakeLineColor(const QColor &col)
Definition: kateconfig.cpp:2632
KateDocumentConfig::removeSpaces
int removeSpaces() const
Definition: kateconfig.cpp:758
KateRendererConfig::setModifiedLineColor
void setModifiedLineColor(const QColor &col)
Definition: kateconfig.cpp:2653
KateDocumentConfig::backupFlags
uint backupFlags() const
Definition: kateconfig.cpp:979
KateDocumentConfig::codec
QTextCodec * codec() const
Definition: kateconfig.cpp:837
KateViewConfig::foldingBar
bool foldingBar() const
Definition: kateconfig.cpp:1615
KateViewConfig::setScrollBarMarks
void setScrollBarMarks(bool on)
Definition: kateconfig.cpp:1497
QList::size
int size() const
Kate::HighlightedLineBackground
Definition: katedefaultcolors.h:32
KateRendererConfig::indentationLineColor
const QColor & indentationLineColor() const
Definition: kateconfig.cpp:2487
KateRendererConfig::lineNumberColor
const QColor & lineNumberColor() const
Definition: kateconfig.cpp:2582
Kate::HighlightedBracket
Definition: katedefaultcolors.h:36
Kate::ModifiedLine
Definition: katedefaultcolors.h:46
KateViewConfig::wordCompletionRemoveTail
bool wordCompletionRemoveTail() const
Definition: kateconfig.cpp:1957
KateViewConfig::setDynWordWrapAlignIndent
void setDynWordWrapAlignIndent(int indent)
Definition: kateconfig.cpp:1455
KateConfig::configStart
void configStart()
start some config changes this method is needed to init some kind of transaction for config changes...
Definition: kateconfig.cpp:54
KateViewConfig::setScrollPastEnd
void setScrollPastEnd(bool on)
Definition: kateconfig.cpp:2005
KateViewConfig::dynWordWrapAlignIndent
int dynWordWrapAlignIndent() const
Definition: kateconfig.cpp:1447
KateRendererConfig::modifiedLineColor
const QColor & modifiedLineColor() const
Definition: kateconfig.cpp:2645
KateViewConfig::scrollBarMiniMapAll
bool scrollBarMiniMapAll() const
Definition: kateconfig.cpp:1531
KateDocumentConfig::setOnTheFlySpellCheck
void setOnTheFlySpellCheck(bool on)
Definition: kateconfig.cpp:1099
KateDocumentConfig::replaceTabsDyn
bool replaceTabsDyn() const
Definition: kateconfig.cpp:737
KateRenderer
Handles all of the work of rendering the text (used for the views and printing)
Definition: katerenderer.h:50
Kate::TemplateBackground
Definition: katedefaultcolors.h:49
KateViewConfig::IncFromCursor
Definition: kateconfig.h:473
KateGlobalConfig::fallbackCodec
QTextCodec * fallbackCodec() const
Definition: kateconfig.cpp:137
KateDocumentConfig::setBackspaceIndents
void setBackspaceIndents(bool on)
Definition: kateconfig.cpp:640
KateRendererConfig::templateBackgroundColor
const QColor & templateBackgroundColor() const
Definition: kateconfig.cpp:2550
QStringListModel::stringList
QStringList stringList() const
KateGlobalConfig
Definition: kateconfig.h:93
KateViewConfig::setViInputMode
void setViInputMode(bool on)
Definition: kateconfig.cpp:1806
KateViewConfig::showScrollbars
int showScrollbars() const
Definition: kateconfig.cpp:1573
KateRendererConfig::setShowWholeBracketExpression
void setShowWholeBracketExpression(bool on)
Definition: kateconfig.cpp:2759
KateDocumentConfig::backupSuffix
const QString & backupSuffix() const
Definition: kateconfig.cpp:1008
KateViewConfig::setAutoCenterLines
void setAutoCenterLines(int lines)
Definition: kateconfig.cpp:1686
kateschema.h
KateRenderer::config
KateRendererConfig * config() const
Configuration.
Definition: katerenderer.h:362
Kate::IconBar
Definition: katedefaultcolors.h:42
KateGlobalConfig::setProberType
void setProberType(KEncodingProber::ProberType proberType)
Definition: kateconfig.cpp:125
KateDocumentConfig::showTabs
bool showTabs() const
Definition: kateconfig.cpp:695
KateRendererConfig::templateEditablePlaceholderColor
const QColor & templateEditablePlaceholderColor() const
Definition: kateconfig.cpp:2558
KateConfig::KateConfig
KateConfig()
Default Constructor.
Definition: kateconfig.cpp:45
KateViewConfig::PowerMatchCase
Definition: kateconfig.h:474
kateglobal.h
KateDocumentConfig::setWordWrapAt
void setWordWrapAt(int col)
Definition: kateconfig.cpp:561
KateViewConfig::viInputModeStealKeys
bool viInputModeStealKeys() const
Definition: kateconfig.cpp:1824
KateViewConfig::setWordCompletionMinimalWordLength
void setWordCompletionMinimalWordLength(int length)
Definition: kateconfig.cpp:1944
QString::isEmpty
bool isEmpty() const
KateDocumentConfig::updateConfig
void updateConfig()
do the real update
Definition: kateconfig.cpp:429
KateDocumentConfig::eol
int eol() const
Definition: kateconfig.cpp:883
KateGlobalConfig::fallbackEncoding
const QString & fallbackEncoding() const
Definition: kateconfig.cpp:132
KateDocumentConfig::~KateDocumentConfig
~KateDocumentConfig()
Cu DocumentConfig.
Definition: kateconfig.cpp:287
KateViewConfig::persistentSelection
bool persistentSelection() const
Definition: kateconfig.cpp:1777
KateRendererConfig::setLineNumberColor
void setLineNumberColor(const QColor &col)
Definition: kateconfig.cpp:2590
KateViewConfig::setPersistentSelection
void setPersistentSelection(bool on)
Definition: kateconfig.cpp:1785
KateViewConfig::replacementHistoryModel
QStringListModel * replacementHistoryModel()
Definition: kateconfig.cpp:1737
KateGlobal::views
QList< KateView * > & views()
return a list of all registered views
Definition: kateglobal.h:273
KateDocumentConfig::setLineLengthLimit
void setLineLengthLimit(int limit)
Definition: kateconfig.cpp:1121
KateViewConfig::lineNumbers
bool lineNumbers() const
Definition: kateconfig.cpp:1468
KateRendererConfig::setTabMarkerColor
void setTabMarkerColor(const QColor &col)
Definition: kateconfig.cpp:2474
KateGlobalConfig::proberType
KEncodingProber::ProberType proberType() const
Definition: kateconfig.h:126
KateRendererConfig::setBackgroundColor
void setBackgroundColor(const QColor &col)
Definition: kateconfig.cpp:2335
KateDocumentConfig::setSmartHome
void setSmartHome(bool on)
Definition: kateconfig.cpp:661
QString
KateViewConfig::updateConfig
void updateConfig()
do the real update
Definition: kateconfig.cpp:1390
KateViewConfig::setDefaultMarkType
void setDefaultMarkType(uint type)
Definition: kateconfig.cpp:1754
QColor
KateRendererConfig::tabMarkerColor
const QColor & tabMarkerColor() const
Definition: kateconfig.cpp:2466
KateDocumentConfig::setRemoveSpaces
void setRemoveSpaces(int triState)
Remove trailing spaces on save.
Definition: kateconfig.cpp:745
Kate::TemplateEditablePlaceholder
Definition: katedefaultcolors.h:51
QTextCodec
KateRendererConfig::reloadSchema
void reloadSchema()
Reload the schema from the schema manager.
Definition: kateconfig.cpp:2195
KateView::updateConfig
void updateConfig()
Definition: kateview.cpp:1669
KateRendererConfig::~KateRendererConfig
~KateRendererConfig()
Cu DocumentConfig.
Definition: kateconfig.cpp:2116
KateDocumentConfig::allowEolDetection
bool allowEolDetection() const
Definition: kateconfig.cpp:937
KateViewConfig::wordCompletion
bool wordCompletion() const
Definition: kateconfig.cpp:1900
KateDocumentConfig::eolDos
Definition: kateconfig.h:259
KateRendererConfig::setIndentationLineColor
void setIndentationLineColor(const QColor &col)
Definition: kateconfig.cpp:2495
Kate::SavedLine
Definition: katedefaultcolors.h:47
KateDocumentConfig::setShowTabs
void setShowTabs(bool on)
Definition: kateconfig.cpp:682
KateRendererConfig::setShowIndentationLines
void setShowIndentationLines(bool on)
Definition: kateconfig.cpp:2738
QStringListModel
KateRendererConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:2147
KateDocumentConfig::encoding
const QString & encoding() const
Definition: kateconfig.cpp:829
Kate::SpellingMistakeLine
Definition: katedefaultcolors.h:39
QStringList
KateGlobalConfig::readConfig
void readConfig(const KConfigGroup &config)
Read config from object.
Definition: kateconfig.cpp:105
KateViewConfig::iconBar
bool iconBar() const
Definition: kateconfig.cpp:1594
KateRendererConfig::setWordWrapMarker
void setWordWrapMarker(bool on)
Definition: kateconfig.cpp:2314
KateDocumentConfig::setBackupPrefix
void setBackupPrefix(const QString &prefix)
Definition: kateconfig.cpp:1016
KateView
Definition: kateview.h:77
Kate::CodeFolding
Definition: katedefaultcolors.h:43
KateViewConfig::setViRelativeLineNumbers
void setViRelativeLineNumbers(bool on)
Definition: kateconfig.cpp:1851
KateGlobalConfig::updateConfig
void updateConfig()
do the real update
Definition: kateconfig.cpp:121
KateDefaultColors
Definition: katedefaultcolors.h:70
KateRendererConfig::highlightedLineColor
const QColor & highlightedLineColor() const
Definition: kateconfig.cpp:2369
KateDocumentConfig::setSearchDirConfigDepth
void setSearchDirConfigDepth(int depth)
Definition: kateconfig.cpp:1071
KateDocument
Definition: katedocument.h:74
KateViewConfig::setAutomaticCompletionInvocation
void setAutomaticCompletionInvocation(bool on)
Definition: kateconfig.cpp:1889
KateViewConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:1327
KateViewConfig::allowMarkMenu
bool allowMarkMenu() const
Definition: kateconfig.cpp:1767
KateGlobal::schemaManager
KateSchemaManager * schemaManager()
manager for the katepart schemas
Definition: kateglobal.h:298
KateDocument::setUndoMergeAllEdits
void setUndoMergeAllEdits(bool merge)
Definition: katedocument.cpp:4722
KateViewConfig::setFoldingBar
void setFoldingBar(bool on)
Definition: kateconfig.cpp:1623
KateDocumentConfig::setAllowSimpleMode
void setAllowSimpleMode(bool on)
Definition: kateconfig.cpp:966
KateSchemaManager::schema
KConfigGroup schema(const QString &name)
return kconfiggroup for the given schema
Definition: kateschema.cpp:43
KateDocumentConfig::indentationMode
const QString & indentationMode() const
Definition: kateconfig.cpp:492
KateRendererConfig::setSearchHighlightColor
void setSearchHighlightColor(const QColor &col)
Definition: kateconfig.cpp:2695
KateDocumentConfig::indentationWidth
int indentationWidth() const
Definition: kateconfig.cpp:468
KateDocumentConfig::setWordWrap
void setWordWrap(bool on)
Definition: kateconfig.cpp:540
KateRendererConfig::schema
const QString & schema() const
Definition: kateconfig.cpp:2175
KateViewConfig::autoCenterLines
int autoCenterLines() const
Definition: kateconfig.cpp:1678
KateViewConfig::~KateViewConfig
~KateViewConfig()
Cu DocumentConfig.
Definition: kateconfig.cpp:1218
KateRendererConfig::separatorColor
const QColor & separatorColor() const
Definition: kateconfig.cpp:2603
KateDefaultColors::mark
QColor mark(Kate::Mark mark) const
Definition: katedefaultcolors.cpp:89
KateRendererConfig::setSavedLineColor
void setSavedLineColor(const QColor &col)
Definition: kateconfig.cpp:2674
KateRendererConfig
Definition: kateconfig.h:618
KateDocumentConfig::setEol
void setEol(int mode)
Definition: kateconfig.cpp:903
KateDocumentConfig::swapFileNoSync
bool swapFileNoSync() const
Definition: kateconfig.cpp:1042
Kate::Separator
Definition: katedefaultcolors.h:45
KateDocumentConfig::wordWrap
bool wordWrap() const
Definition: kateconfig.cpp:532
KateViewConfig::automaticCompletionInvocation
bool automaticCompletionInvocation() const
Definition: kateconfig.cpp:1881
KateRendererConfig::updateConfig
void updateConfig()
do the real update
Definition: kateconfig.cpp:2160
KateViewConfig::keywordCompletion
bool keywordCompletion() const
Definition: kateconfig.cpp:1919
Kate::ReplaceHighlight
Definition: katedefaultcolors.h:34
KateRendererConfig::font
const QFont & font() const
Definition: kateconfig.cpp:2276
KateViewConfig::viInputMode
bool viInputMode() const
Definition: kateconfig.cpp:1798
KateViewConfig::PowerModePlainText
Definition: kateconfig.h:478
KateDocumentConfig::setShowSpaces
void setShowSpaces(bool on)
Definition: kateconfig.cpp:703
Kate::TabMarker
Definition: katedefaultcolors.h:37
KateDocumentConfig::setPageUpDownMovesCursor
void setPageUpDownMovesCursor(bool on)
Definition: kateconfig.cpp:585
KateViewConfig::scrollBarMiniMapWidth
int scrollBarMiniMapWidth() const
Definition: kateconfig.cpp:1552
KateRendererConfig::setAnimateBracketMatching
void setAnimateBracketMatching(bool on)
Definition: kateconfig.cpp:2777
QTextCodec::codecForName
QTextCodec * codecForName(const QByteArray &name)
Kate::WordWrapMarker
Definition: katedefaultcolors.h:41
KateRendererConfig::savedLineColor
const QColor & savedLineColor() const
Definition: kateconfig.cpp:2666
KateViewConfig::bookmarkSort
int bookmarkSort() const
Definition: kateconfig.cpp:1657
KateViewConfig::setBookmarkSort
void setBookmarkSort(int mode)
Definition: kateconfig.cpp:1665
KateViewConfig::setSmartCopyCut
void setSmartCopyCut(bool on)
Definition: kateconfig.cpp:1984
KateViewConfig::readConfig
void readConfig(const KConfigGroup &config)
Read config from object.
Definition: kateconfig.cpp:1259
KateViewConfig::scrollPastEnd
bool scrollPastEnd() const
Definition: kateconfig.cpp:1997
KateGlobalConfig::setFallbackEncoding
bool setFallbackEncoding(const QString &encoding)
Definition: kateconfig.cpp:145
KateRendererConfig::searchHighlightColor
const QColor & searchHighlightColor() const
Definition: kateconfig.cpp:2687
KateDocumentConfig::isSetEncoding
bool isSetEncoding() const
Definition: kateconfig.cpp:878
KateDocumentConfig::setReplaceTabsDyn
void setReplaceTabsDyn(bool on)
Definition: kateconfig.cpp:724
KateViewConfig::viRelativeLineNumbers
bool viRelativeLineNumbers() const
Definition: kateconfig.cpp:1843
KateRendererConfig::backgroundColor
const QColor & backgroundColor() const
Definition: kateconfig.cpp:2327
KateDocumentConfig::pageUpDownMovesCursor
bool pageUpDownMovesCursor() const
Definition: kateconfig.cpp:577
KateRendererConfig::setWordWrapMarkerColor
void setWordWrapMarkerColor(const QColor &col)
Definition: kateconfig.cpp:2453
KateDocumentConfig
Definition: kateconfig.h:145
KateRendererConfig::showIndentationLines
bool showIndentationLines() const
Definition: kateconfig.cpp:2730
KateDocumentConfig::writeConfig
void writeConfig(KConfigGroup &config)
Write config to object.
Definition: kateconfig.cpp:379
KateViewConfig::setLineNumbers
void setLineNumbers(bool on)
Definition: kateconfig.cpp:1476
KateViewConfig::dynWordWrap
bool dynWordWrap() const
Definition: kateconfig.cpp:1405
KateRendererConfig::setIconBarColor
void setIconBarColor(const QColor &col)
Definition: kateconfig.cpp:2516
KateView::doc
KateDocument * doc()
accessor to katedocument pointer
Definition: kateview.h:553
KateDocumentConfig::tabIndentsEnabled
bool tabIndentsEnabled() const
Definition: kateconfig.cpp:821
KateRendererConfig::templateNotEditablePlaceholderColor
const QColor & templateNotEditablePlaceholderColor() const
Definition: kateconfig.cpp:2574
KateViewConfig::defaultMarkType
uint defaultMarkType() const
Definition: kateconfig.cpp:1746
KateViewConfig
Definition: kateconfig.h:381
KateViewConfig::dynWordWrapIndicators
int dynWordWrapIndicators() const
Definition: kateconfig.cpp:1426
KateViewConfig::setScrollBarMiniMapWidth
void setScrollBarMiniMapWidth(int width)
Definition: kateconfig.cpp:1560
KateRendererConfig::fontMetrics
const QFontMetricsF & fontMetrics() const
Definition: kateconfig.cpp:2284
KateDocumentConfig::setIndentPastedText
void setIndentPastedText(bool on)
Definition: kateconfig.cpp:619
KateViewConfig::setKeywordCompletion
void setKeywordCompletion(bool on)
Definition: kateconfig.cpp:1926
QBitArray::fill
bool fill(bool value, int size)
KateDocumentConfig::lineLengthLimit
int lineLengthLimit() const
Definition: kateconfig.cpp:1113
KateRendererConfig::setReplaceHighlightColor
void setReplaceHighlightColor(const QColor &col)
Definition: kateconfig.cpp:2716
KateViewConfig::maxHistorySize
int maxHistorySize() const
Definition: kateconfig.cpp:1732
KateViewConfig::setAllowMarkMenu
void setAllowMarkMenu(bool allow)
Definition: kateconfig.cpp:1772
KateConfig::~KateConfig
virtual ~KateConfig()
Virtual Destructor.
Definition: kateconfig.cpp:50
KateViewConfig::setDynWordWrap
void setDynWordWrap(bool wrap)
Definition: kateconfig.cpp:1413
KateDocumentConfig::backspaceIndents
bool backspaceIndents() const
Definition: kateconfig.cpp:653
KateDocumentConfig::setBom
void setBom(bool bom)
Definition: kateconfig.cpp:916
KateDocumentConfig::setTabWidth
void setTabWidth(int tabWidth)
Definition: kateconfig.cpp:452
KateDocumentConfig::tabWidth
int tabWidth() const
Definition: kateconfig.cpp:444
kateconfig.h
KateViewConfig::isGlobal
bool isGlobal() const
Definition: kateconfig.h:404
KateDocumentConfig::searchDirConfigDepth
int searchDirConfigDepth() const
Should Kate Part search for dir wide config file and if, how depth?
Definition: kateconfig.cpp:1063
QStringListModel::setStringList
void setStringList(const QStringList &strings)
KateRendererConfig::setSeparatorColor
void setSeparatorColor(const QColor &col)
Definition: kateconfig.cpp:2611
KateDocumentConfig::setIndentationWidth
void setIndentationWidth(int indentationWidth)
Definition: kateconfig.cpp:476
KateDocumentConfig::allowSimpleMode
bool allowSimpleMode() const
Definition: kateconfig.cpp:958
KateRendererConfig::setHighlightedLineColor
void setHighlightedLineColor(const QColor &col)
Definition: kateconfig.cpp:2377
KateViewConfig::patternHistoryModel
QStringListModel * patternHistoryModel()
Definition: kateconfig.cpp:1723
KateDocumentConfig::tabHandling
uint tabHandling() const
Definition: kateconfig.cpp:513
Kate::SelectionBackground
Definition: katedefaultcolors.h:31
KateRendererConfig::readConfig
void readConfig(const KConfigGroup &config)
Read config from object.
Definition: kateconfig.cpp:2129
KateViewConfig::setScrollBarMiniMap
void setScrollBarMiniMap(bool on)
Definition: kateconfig.cpp:1518
KateRendererConfig::spellingMistakeLineColor
const QColor & spellingMistakeLineColor() const
Definition: kateconfig.cpp:2624
KateViewConfig::setDynWordWrapIndicators
void setDynWordWrapIndicators(int mode)
Definition: kateconfig.cpp:1434
Kate::LineNumber
Definition: katedefaultcolors.h:44
KateDocumentConfig::smartHome
bool smartHome() const
Definition: kateconfig.cpp:674
KateViewConfig::setSearchFlags
void setSearchFlags(long flags)
Definition: kateconfig.cpp:1710
KateDocumentConfig::setEncoding
bool setEncoding(const QString &encoding)
Definition: kateconfig.cpp:852
KateDocumentConfig::bom
bool bom() const
Definition: kateconfig.cpp:929
KateRendererConfig::templateFocusedEditablePlaceholderColor
const QColor & templateFocusedEditablePlaceholderColor() const
Definition: kateconfig.cpp:2566
KateDocumentConfig::newLineAtEof
bool newLineAtEof() const
Definition: kateconfig.cpp:779
KateViewConfig::foldFirstLine
bool foldFirstLine() const
Definition: kateconfig.cpp:2018
KateDocumentConfig::setBackupFlags
void setBackupFlags(uint flags)
Definition: kateconfig.cpp:987
KateViewConfig::searchFlags
long searchFlags() const
Definition: kateconfig.cpp:1702
KateDocumentConfig::tabSmart
indents in leading space, otherwise inserts tab
Definition: kateconfig.h:197
KateRendererConfig::isGlobal
bool isGlobal() const
Definition: kateconfig.h:642
katedefaultcolors.h
QFontMetricsF
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal