kate Library API Documentation

KateVarIndent Class Reference

This indenter uses document variables to determine when to add/remove indents. More...

#include <kateautoindent.h>

Inheritance diagram for KateVarIndent:

Inheritance graph
[legend]
Collaboration diagram for KateVarIndent:

Collaboration graph
[legend]
List of all members.

Public Types

enum  pairs { Parens = 1, Braces = 2, Brackets = 4, AngleBrackets = 8 }

Public Member Functions

 KateVarIndent (KateDocument *doc)
virtual ~KateVarIndent ()
virtual void processNewline (KateDocCursor &begin, bool needContinue)
virtual void processChar (QChar c)
virtual void processLine (KateDocCursor &line)
virtual void processSection (KateDocCursor &begin, KateDocCursor &end)
virtual bool canProcessLine () const
virtual uint modeNumber () const

Detailed Description

This indenter uses document variables to determine when to add/remove indents.

It attempts to get the following variables from the document:

The idea is to provide a somewhat intelligent indentation for perl, php, bash, scheme and in general formats with humble indentation needs.

Definition at line 418 of file kateautoindent.h.


Member Enumeration Documentation

enum KateVarIndent::pairs
 

Purely for readability, couples we know and love.

Definition at line 425 of file kateautoindent.h.


Member Function Documentation

void KateVarIndent::processNewline KateDocCursor begin,
bool  needContinue
[virtual]
 

Called every time a newline character is inserted in the document.

Parameters:
cur The position to start processing. Contains the new cursor position after the indention.
needContinue Used to determine whether to calculate a continue indent or not.

Reimplemented from KateNormalIndent.

Definition at line 1970 of file kateautoindent.cpp.

References KateAutoIndent::doc, KateTextCursor::line(), and processLine().

void KateVarIndent::processChar QChar  c  )  [virtual]
 

Called every time a character is inserted into the document.

Parameters:
c character inserted

Reimplemented from KateNormalIndent.

Definition at line 1978 of file kateautoindent.cpp.

References KateDocument::activeView(), KateNormalIndent::commentAttrib, KateView::cursorColumn(), KateView::cursorLine(), KateAutoIndent::doc, endl(), kdDebug(), KateTextCursor::line(), KateDocument::plainKateTextLine(), and processLine().

void KateVarIndent::processLine KateDocCursor line  )  [virtual]
 

Aligns/indents the given line to the proper indent position.

Reimplemented from KateNormalIndent.

Definition at line 1994 of file kateautoindent.cpp.

References KateDocument::activeView(), KateNormalIndent::commentAttrib, KateView::cursorLine(), KateAutoIndent::doc, endl(), KateDocument::insertText(), kdDebug(), KateTextCursor::line(), KateDocument::plainKateTextLine(), KateDocument::removeText(), KateTextCursor::setCol(), KateNormalIndent::tabString(), KateNormalIndent::tabWidth, KateDocument::textLine(), and KateNormalIndent::updateConfig().

Referenced by processChar(), processNewline(), and processSection().

void KateVarIndent::processSection KateDocCursor begin,
KateDocCursor end
[virtual]
 

Processes a section of text, indenting each line in between.

Reimplemented from KateNormalIndent.

Definition at line 2133 of file kateautoindent.cpp.

References KateDocCursor::gotoNextLine(), KateTextCursor::line(), and processLine().

virtual bool KateVarIndent::canProcessLine  )  const [inline, virtual]
 

Set to true if an actual implementation of 'processLine' is present.

This is used to prevent a needless Undo action from being created.

Reimplemented from KateNormalIndent.

Definition at line 441 of file kateautoindent.h.

virtual uint KateVarIndent::modeNumber  )  const [inline, virtual]
 

Mode index of this mode.

Returns:
modeNumber

Reimplemented from KateNormalIndent.

Definition at line 443 of file kateautoindent.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kate Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 16 07:18:33 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003