kate Library API Documentation

KateAutoIndent Class Reference

Provides Auto-Indent functionality for katepart. More...

#include <kateautoindent.h>

Inheritance diagram for KateAutoIndent:

Inheritance graph
[legend]
Collaboration diagram for KateAutoIndent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KateAutoIndent (KateDocument *doc)
virtual ~KateAutoIndent ()
virtual void updateConfig ()
virtual bool canProcessNewLine () const
virtual void processNewline (KateDocCursor &, bool)
virtual void processChar (QChar)
virtual void processLine (KateDocCursor &)
virtual void processSection (KateDocCursor &, KateDocCursor &)
virtual bool canProcessLine () const
virtual uint modeNumber () const

Static Public Member Functions

static KateAutoIndentcreateIndenter (KateDocument *doc, uint mode)
static QStringList listModes ()
static QString modeName (uint mode)
static QString modeDescription (uint mode)
static uint modeNumber (const QString &name)

Protected Attributes

KateDocumentdoc

Detailed Description

Provides Auto-Indent functionality for katepart.

This baseclass is a real dummy, does nothing beside remembering the document it belongs too, only to have the object around

Definition at line 35 of file kateautoindent.h.


Constructor & Destructor Documentation

KateAutoIndent::KateAutoIndent KateDocument doc  ) 
 

Constructor.

Parameters:
doc parent document

Definition at line 120 of file kateautoindent.cpp.

Referenced by createIndenter().

KateAutoIndent::~KateAutoIndent  )  [virtual]
 

Virtual Destructor for the baseclass.

Definition at line 124 of file kateautoindent.cpp.


Member Function Documentation

KateAutoIndent * KateAutoIndent::createIndenter KateDocument doc,
uint  mode
[static]
 

Create an indenter.

Parameters:
doc document for the indenter
mode indention mode wanted
Returns:
created autoindention object

Definition at line 33 of file kateautoindent.cpp.

References KateAutoIndent().

Referenced by KateDocument::KateDocument(), and KateDocument::updateConfig().

QStringList KateAutoIndent::listModes  )  [static]
 

List all possible modes by name.

Returns:
list of modes

Definition at line 51 of file kateautoindent.cpp.

References modeDescription().

Referenced by KateIndentConfigTab::KateIndentConfigTab(), and KateViewIndentationAction::slotAboutToShow().

QString KateAutoIndent::modeName uint  mode  )  [static]
 

Return the mode name given the mode.

Parameters:
mode mode index
Returns:
name for this mode index

Definition at line 66 of file kateautoindent.cpp.

Referenced by modeNumber().

QString KateAutoIndent::modeDescription uint  mode  )  [static]
 

Return the mode description.

Parameters:
mode mode index
Returns:
mode index

Definition at line 84 of file kateautoindent.cpp.

Referenced by listModes(), and KateViewIndentationAction::slotAboutToShow().

uint KateAutoIndent::modeNumber const QString name  )  [static]
 

Maps name -> index.

Parameters:
name mode name
Returns:
mode index

Definition at line 102 of file kateautoindent.cpp.

References modeName().

Referenced by KateDocument::updateConfig().

virtual void KateAutoIndent::updateConfig  )  [inline, virtual]
 

Update indenter's configuration (indention width, attributes etc.

)

Reimplemented in KateNormalIndent.

Definition at line 91 of file kateautoindent.h.

Referenced by KateDocument::KateDocument(), and KateDocument::updateConfig().

virtual bool KateAutoIndent::canProcessNewLine  )  const [inline, virtual]
 

does this indenter support processNewLine

Returns:
can you do it?

Reimplemented in KateNormalIndent.

Definition at line 97 of file kateautoindent.h.

Referenced by KateDocument::newLine().

virtual void KateAutoIndent::processNewline KateDocCursor ,
bool 
[inline, 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 in KateNormalIndent, KateCSmartIndent, KatePythonIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 105 of file kateautoindent.h.

Referenced by KateDocument::newLine().

virtual void KateAutoIndent::processChar QChar   )  [inline, virtual]
 

Called every time a character is inserted into the document.

Parameters:
c character inserted

Reimplemented in KateNormalIndent, KateCSmartIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 111 of file kateautoindent.h.

Referenced by KateDocument::typeChars().

virtual void KateAutoIndent::processLine KateDocCursor  )  [inline, virtual]
 

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

Reimplemented in KateNormalIndent, KateCSmartIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 116 of file kateautoindent.h.

Referenced by KateDocument::align().

virtual void KateAutoIndent::processSection KateDocCursor ,
KateDocCursor
[inline, virtual]
 

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

Reimplemented in KateNormalIndent, KateCSmartIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 121 of file kateautoindent.h.

Referenced by KateDocument::align(), and KateDocument::paste().

virtual bool KateAutoIndent::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 in KateNormalIndent, KateCSmartIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 127 of file kateautoindent.h.

Referenced by KateDocument::align(), and KateDocument::paste().

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

Mode index of this mode.

Returns:
modeNumber

Reimplemented in KateNormalIndent, KateCSmartIndent, KatePythonIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 133 of file kateautoindent.h.

Referenced by KateCommands::CoreCommands::exec(), and KateBuffer::setHighlight().


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:16:27 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003