• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

Public Types | Public Member Functions | List of all members
KateVarIndent Class Reference

#include <kateautoindent.h>

Inheritance diagram for KateVarIndent:
KateNormalIndent KateAutoIndent

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 (TQChar c)
 
virtual void processLine (KateDocCursor &line)
 
virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end)
 
virtual bool canProcessLine () const
 
virtual uint modeNumber () const
 
- Public Member Functions inherited from KateNormalIndent
 KateNormalIndent (KateDocument *doc)
 
virtual ~KateNormalIndent ()
 
virtual bool canProcessNewLine () const
 
virtual void processNewline (KateDocCursor &cur, bool needContinue)
 
virtual void processChar (TQChar c)
 
virtual void processLine (KateDocCursor &)
 
virtual void processSection (const KateDocCursor &, const KateDocCursor &)
 
virtual bool canProcessLine () const
 
virtual uint modeNumber () const
 
- Public Member Functions inherited from KateAutoIndent
 KateAutoIndent (KateDocument *doc)
 
virtual ~KateAutoIndent ()
 
virtual bool canProcessNewLine () const
 
virtual void processNewline (KateDocCursor &cur, bool needContinue)
 
virtual void processChar (TQChar c)
 
virtual void processLine (KateDocCursor &)
 
virtual void processSection (const KateDocCursor &, const KateDocCursor &)
 
virtual bool canProcessLine () const
 
virtual uint modeNumber () const
 

Additional Inherited Members

- Public Slots inherited from KateNormalIndent
virtual void updateConfig ()
 
- Public Slots inherited from KateAutoIndent
virtual void updateConfig ()
 
- Static Public Member Functions inherited from KateAutoIndent
static KateAutoIndent * createIndenter (KateDocument *doc, uint mode)
 
static TQStringList listModes ()
 
static TQString modeName (uint mode)
 
static TQString modeDescription (uint mode)
 
static uint modeNumber (const TQString &name)
 
static bool hasConfigPage (uint mode)
 
static IndenterConfigPage * configPage (TQWidget *parent, uint mode)
 
- Public Attributes inherited from KateNormalIndent
uchar commentAttrib
 
uchar doxyCommentAttrib
 
uchar regionAttrib
 
uchar symbolAttrib
 
uchar alertAttrib
 
uchar tagAttrib
 
uchar wordAttrib
 
uchar keywordAttrib
 
uchar normalAttrib
 
uchar extensionAttrib
 
uchar preprocessorAttrib
 
uchar stringAttrib
 
uchar charAttrib
 
- Protected Member Functions inherited from KateNormalIndent
bool isBalanced (KateDocCursor &begin, const KateDocCursor &end, TQChar open, TQChar close, uint &pos) const
 
bool skipBlanks (KateDocCursor &cur, KateDocCursor &max, bool newline) const
 
uint measureIndent (KateDocCursor &cur) const
 
TQString tabString (uint length) const
 
- Protected Attributes inherited from KateNormalIndent
uint tabWidth
 
uint indentWidth
 
bool useSpaces
 
bool mixedIndent
 
bool keepProfile
 
- Protected Attributes inherited from KateAutoIndent
KateDocument * doc
 

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.

Member Enumeration Documentation

◆ pairs

enum KateVarIndent::pairs

Purely for readability, couples we know and love.

Definition at line 500 of file kateautoindent.h.

Constructor & Destructor Documentation

◆ KateVarIndent()

KateVarIndent::KateVarIndent ( KateDocument *  doc)

Definition at line 2157 of file kateautoindent.cpp.

◆ ~KateVarIndent()

KateVarIndent::~KateVarIndent ( )
virtual

Definition at line 2175 of file kateautoindent.cpp.

Member Function Documentation

◆ canProcessLine()

virtual bool KateVarIndent::canProcessLine ( ) const
inlinevirtual

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.

◆ modeNumber()

virtual uint KateVarIndent::modeNumber ( ) const
inlinevirtual

Mode index of this mode.

Returns
modeNumber

Reimplemented from KateNormalIndent.

Definition at line 518 of file kateautoindent.h.

◆ processChar()

void KateVarIndent::processChar ( TQChar  c)
virtual

Called every time a character is inserted into the document.

Parameters
ccharacter inserted

Reimplemented from KateNormalIndent.

Definition at line 2188 of file kateautoindent.cpp.

◆ processLine()

void KateVarIndent::processLine ( KateDocCursor &  )
virtual

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

Reimplemented from KateNormalIndent.

Definition at line 2204 of file kateautoindent.cpp.

◆ processNewline()

void KateVarIndent::processNewline ( KateDocCursor &  cur,
bool  needContinue 
)
virtual

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

Parameters
curThe position to start processing. Contains the new cursor position after the indention.
needContinueUsed to determine whether to calculate a continue indent or not.

Reimplemented from KateNormalIndent.

Definition at line 2180 of file kateautoindent.cpp.

◆ processSection()

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

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

Reimplemented from KateNormalIndent.

Definition at line 2341 of file kateautoindent.cpp.


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

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.9.4
This website is maintained by Timothy Pearson.