19 #ifndef __KATE_CONFIG_H__
20 #define __KATE_CONFIG_H__
22 #include <tdetexteditor/markinterface.h>
24 #include <tqbitarray.h>
27 #include <tqvaluevector.h>
33 class KateFontMetrics;
81 uint configSessionNumber;
92 friend class KateFactory;
97 KateDocumentConfig ();
103 KateDocumentConfig (KateDocument *doc);
108 ~KateDocumentConfig ();
110 inline static KateDocumentConfig *global () {
return s_global; }
112 inline bool isGlobal ()
const {
return (
this == global()); }
129 int tabWidth ()
const;
130 void setTabWidth (
int tabWidth);
132 int indentationWidth ()
const;
133 void setIndentationWidth (
int indentationWidth);
147 uint indentationMode ()
const;
148 void setIndentationMode (uint identationMode);
150 bool wordWrap ()
const;
151 void setWordWrap (
bool on);
153 unsigned int wordWrapAt ()
const;
154 void setWordWrapAt (
unsigned int col);
156 uint undoSteps ()
const;
157 void setUndoSteps ( uint undoSteps );
159 bool pageUpDownMovesCursor ()
const;
160 void setPageUpDownMovesCursor (
bool on);
164 cfBackspaceIndents= 0x2,
166 cfRemoveSpaces = 0x10,
168 cfAutoBrackets= 0x40,
169 cfTabIndentsMode = 0x200,
171 cfKeepIndentProfile= 0x8000,
172 cfKeepExtraSpaces= 0x10000,
173 cfTabIndents= 0x80000,
174 cfShowTabs= 0x200000,
175 cfSpaceIndent= 0x400000,
176 cfSmartHome = 0x800000,
177 cfTabInsertsTab = 0x1000000,
178 cfReplaceTabsDyn= 0x2000000,
179 cfRemoveTrailingDyn=0x4000000,
180 cfDoxygenAutoTyping=0x8000000 ,
181 cfMixedIndent = 0x10000000,
182 cfIndentPastedText = 0x20000000
185 uint configFlags ()
const;
186 void setConfigFlags (KateDocumentConfig::ConfigFlags flag,
bool enable);
187 void setConfigFlags (uint fullFlags);
189 const TQString &encoding ()
const;
190 TQTextCodec *codec ();
192 void setEncoding (
const TQString &encoding);
194 bool isSetEncoding ()
const;
204 TQString eolString ();
206 void setEol (
int mode);
208 bool allowEolDetection ()
const;
209 void setAllowEolDetection (
bool on);
217 uint backupFlags ()
const;
218 void setBackupFlags (uint flags);
220 const TQString &backupPrefix ()
const;
221 void setBackupPrefix (
const TQString &prefix);
223 const TQString &backupSuffix ()
const;
224 void setBackupSuffix (
const TQString &suffix);
226 bool plugin (uint index)
const;
227 void setPlugin (uint index,
bool load);
234 int searchDirConfigDepth ()
const;
236 void setSearchDirConfigDepth (
int depth);
240 int m_indentationWidth;
241 uint m_indentationMode;
245 bool m_pageUpDownMovesCursor;
249 bool m_allowEolDetection;
251 int m_searchDirConfigDepth;
252 TQString m_backupPrefix;
253 TQString m_backupSuffix;
254 TQBitArray m_plugins;
256 bool m_tabWidthSet : 1;
257 bool m_indentationWidthSet : 1;
258 bool m_indentationModeSet : 1;
259 bool m_wordWrapSet : 1;
260 bool m_wordWrapAtSet : 1;
261 bool m_pageUpDownMovesCursorSet : 1;
262 bool m_undoStepsSet : 1;
263 uint m_configFlagsSet;
264 bool m_encodingSet : 1;
266 bool m_allowEolDetectionSet : 1;
267 bool m_backupFlagsSet : 1;
268 bool m_searchDirConfigDepthSet : 1;
269 bool m_backupPrefixSet : 1;
270 bool m_backupSuffixSet : 1;
271 TQBitArray m_pluginsSet;
274 static KateDocumentConfig *s_global;
281 friend class KateFactory;
292 KateViewConfig (KateView *view);
299 inline static KateViewConfig *global () {
return s_global; }
301 inline bool isGlobal ()
const {
return (
this == global()); }
318 bool dynWordWrap ()
const;
319 void setDynWordWrap (
bool wrap);
321 int dynWordWrapIndicators ()
const;
322 void setDynWordWrapIndicators (
int mode);
324 int dynWordWrapAlignIndent ()
const;
325 void setDynWordWrapAlignIndent (
int indent);
327 bool lineNumbers ()
const;
328 void setLineNumbers (
bool on);
330 bool scrollBarMarks ()
const;
331 void setScrollBarMarks (
bool on);
333 bool iconBar ()
const;
334 void setIconBar (
bool on);
336 bool foldingBar ()
const;
337 void setFoldingBar (
bool on);
339 int bookmarkSort ()
const;
340 void setBookmarkSort (
int mode);
342 int autoCenterLines()
const;
343 void setAutoCenterLines (
int lines);
345 long searchFlags ()
const;
346 void setSearchFlags (
long flags);
348 bool cmdLine ()
const;
349 void setCmdLine (
bool on);
351 uint defaultMarkType ()
const;
352 void setDefaultMarkType (uint type);
354 bool persistentSelection ()
const;
355 void setPersistentSelection (
bool on);
366 int textToSearchMode ()
const;
367 void setTextToSearchMode (
int mode);
371 int m_dynWordWrapIndicators;
372 int m_dynWordWrapAlignIndent;
374 bool m_scrollBarMarks;
378 int m_autoCenterLines;
381 uint m_defaultMarkType;
382 bool m_persistentSelection;
383 int m_textToSearchMode;
385 bool m_dynWordWrapSet : 1;
386 bool m_dynWordWrapIndicatorsSet : 1;
387 bool m_dynWordWrapAlignIndentSet : 1;
388 bool m_lineNumbersSet : 1;
389 bool m_scrollBarMarksSet : 1;
390 bool m_iconBarSet : 1;
391 bool m_foldingBarSet : 1;
392 bool m_bookmarkSortSet : 1;
393 bool m_autoCenterLinesSet : 1;
394 bool m_searchFlagsSet : 1;
395 bool m_cmdLineSet : 1;
396 bool m_defaultMarkTypeSet : 1;
397 bool m_persistentSelectionSet : 1;
398 bool m_textToSearchModeSet : 1;
401 static KateViewConfig *s_global;
408 friend class KateFactory;
413 KateRendererConfig ();
425 ~KateRendererConfig ();
427 inline static KateRendererConfig *global () {
return s_global; }
429 inline bool isGlobal ()
const {
return (
this == global()); }
446 uint schema ()
const;
447 void setSchema (uint schema);
455 KateFontStruct *fontStruct ();
457 KateFontMetrics *fontMetrics();
459 void setFont(
const TQFont &font);
461 bool wordWrapMarker ()
const;
462 void setWordWrapMarker (
bool on);
464 const TQColor& backgroundColor()
const;
465 void setBackgroundColor (
const TQColor &col);
467 const TQColor& selectionColor()
const;
468 void setSelectionColor (
const TQColor &col);
470 const TQColor& highlightedLineColor()
const;
471 void setHighlightedLineColor (
const TQColor &col);
473 const TQColor& lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01)
const;
474 void setLineMarkerColor (
const TQColor &col, KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01);
476 const TQColor& highlightedBracketColor()
const;
477 void setHighlightedBracketColor (
const TQColor &col);
479 const TQColor& wordWrapMarkerColor()
const;
480 void setWordWrapMarkerColor (
const TQColor &col);
482 const TQColor& tabMarkerColor()
const;
483 void setTabMarkerColor (
const TQColor &col);
485 const TQColor& iconBarColor()
const;
486 void setIconBarColor (
const TQColor &col);
490 const TQColor& lineNumberColor()
const;
491 void setLineNumberColor (
const TQColor &col);
493 bool showIndentationLines ()
const;
494 void setShowIndentationLines (
bool on);
500 void setSchemaInternal(
int schema);
503 KateFontStruct *m_font;
504 bool m_wordWrapMarker;
505 bool m_showIndentationLines;
506 TQColor m_backgroundColor;
507 TQColor m_selectionColor;
508 TQColor m_highlightedLineColor;
509 TQColor m_highlightedBracketColor;
510 TQColor m_wordWrapMarkerColor;
511 TQColor m_tabMarkerColor;
512 TQColor m_iconBarColor;
513 TQColor m_lineNumberColor;
514 TQValueVector<TQColor> m_lineMarkerColor;
516 bool m_schemaSet : 1;
518 bool m_wordWrapMarkerSet : 1;
519 bool m_showIndentationLinesSet : 1;
520 bool m_backgroundColorSet : 1;
521 bool m_selectionColorSet : 1;
522 bool m_highlightedLineColorSet : 1;
523 bool m_highlightedBracketColorSet : 1;
524 bool m_wordWrapMarkerColorSet : 1;
525 bool m_tabMarkerColorSet : 1;
526 bool m_iconBarColorSet : 1;
527 bool m_lineNumberColorSet : 1;
528 TQBitArray m_lineMarkerColorSet;
531 static KateRendererConfig *s_global;
Base Class for the Kate Config Classes.
KateConfig()
Default Constructor.
virtual ~KateConfig()
Virtual Destructor.
void configEnd()
end a config change transaction, update the concerned documents/views/renderers
void configStart()
start some config changes this method is needed to init some kind of transaction for config changes,...
virtual void updateConfig()=0
do the real update
Handles all of the work of rendering the text (used for the views and printing)