• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • @topname@
  • Sitemap
  • Contact Us
 

kate

KateVarIndent Class Reference

#include <kateautoindent.h>

Inheritance diagram for KateVarIndent:

KateNormalIndent KateAutoIndent QObject

List of all members.


Detailed Description

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

It attempts to get the following variables from the document:

  • var-indent-indent-after: A rerular expression which will cause a line to be indented by one unit, if the first non-whitespace-only line above matches.
  • var-indent-indent: A regular expression, which will cause a matching line to be indented by one unit.
  • var-indent-unindent: A regular expression which will cause the line to be unindented by one unit if matching.
  • var-indent-triggerchars: a list of characters that should cause the indentiou to be recalculated immediately when typed.
  • var-indent-handle-couples: a list of paren sets to handle. Any combination of 'parens' 'braces' and 'brackets'. Each set type is handled the following way: If there are unmatched opening instances on the above line, one indent unit is added, if there are unmatched closing instances on the current line, one indent unit is removed.
  • var-indent-couple-attribute: When looking for unmatched couple openings/closings, only characters with this attribute is considered. The value must be the attribute name from the syntax xml file, for example "Symbol". If it's not specified, attribute 0 is used (usually 'Normal Text').

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 492 of file kateautoindent.h.


Public Types

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

Public Member Functions

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

Member Enumeration Documentation

enum KateVarIndent::pairs

Purely for readability, couples we know and love.

Definition at line 500 of file kateautoindent.h.


Member Function Documentation

void KateVarIndent::processNewline ( KateDocCursor &  cur,
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 2186 of file kateautoindent.cpp.

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 2194 of file kateautoindent.cpp.

void KateVarIndent::processLine ( KateDocCursor &   )  [virtual]

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

Reimplemented from KateNormalIndent.

Definition at line 2210 of file kateautoindent.cpp.

void KateVarIndent::processSection ( const KateDocCursor &  ,
const KateDocCursor &   
) [virtual]

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

Reimplemented from KateNormalIndent.

Definition at line 2347 of file kateautoindent.cpp.

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 516 of file kateautoindent.h.

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

Mode index of this mode.

Returns:
modeNumber

Reimplemented from KateNormalIndent.

Definition at line 518 of file kateautoindent.h.


The documentation for this class was generated from the following files:
  • kateautoindent.h
  • kateautoindent.cpp

kate

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

@topname@

Skip menu "@topname@"
  •     kdnssd-avahi
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for @topname@ by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal