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

Kate

KateNormalIndent Class Reference

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

#include <kateautoindent.h>

Inheritance diagram for KateNormalIndent:

Inheritance graph
[legend]

List of all members.


Public Slots

virtual void updateConfig ()

Public Member Functions

virtual bool canProcessLine () const
virtual bool canProcessNewLine () const
 KateNormalIndent (KateDocument *doc)
virtual uint modeNumber () const
virtual void processChar (QChar c)
virtual void processLine (KateDocCursor &)
virtual void processNewline (KateDocCursor &cur, bool needContinue)
virtual void processSection (const KateDocCursor &, const KateDocCursor &)
virtual ~KateNormalIndent ()

Public Attributes

uchar alertAttrib
uchar charAttrib
uchar commentAttrib
uchar doxyCommentAttrib
uchar extensionAttrib
uchar keywordAttrib
uchar normalAttrib
uchar preprocessorAttrib
uchar regionAttrib
uchar stringAttrib
uchar symbolAttrib
uchar tagAttrib
uchar wordAttrib

Protected Member Functions

bool isBalanced (KateDocCursor &begin, const KateDocCursor &end, QChar open, QChar close, uint &pos) const
uint measureIndent (KateDocCursor &cur) const
bool skipBlanks (KateDocCursor &cur, KateDocCursor &max, bool newline) const
QString tabString (uint length) const

Protected Attributes

uint indentWidth
bool keepProfile
bool mixedIndent
uint tabWidth
bool useSpaces

Detailed Description

Provides Auto-Indent functionality for katepart.

Definition at line 217 of file kateautoindent.h.


Constructor & Destructor Documentation

KateNormalIndent::KateNormalIndent ( KateDocument *  doc  ) 

Constructor.

Parameters:
doc parent document

Definition at line 186 of file kateautoindent.cpp.

KateNormalIndent::~KateNormalIndent (  )  [virtual]

Virtual Destructor for the baseclass.

Definition at line 193 of file kateautoindent.cpp.


Member Function Documentation

virtual bool KateNormalIndent::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 KateAutoIndent.

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

Definition at line 274 of file kateautoindent.h.

virtual bool KateNormalIndent::canProcessNewLine (  )  const [inline, virtual]

does this indenter support processNewLine

Returns:
can you do it?

Reimplemented from KateAutoIndent.

Definition at line 244 of file kateautoindent.h.

bool KateNormalIndent::isBalanced ( KateDocCursor &  begin,
const KateDocCursor &  end,
QChar  open,
QChar  close,
uint &  pos 
) const [protected]

Determines if the characters open and close are balanced between begin and end Fills in pos with the column position of first opened character if found.

Parameters:
begin Beginning cursor position.
end Ending cursor position where the processing will stop.
open The open character.
close The closing character which should be matched against open.
pos Contains the position of the first open character in the line.
Returns:
True if open and close have an equal number of occurances between begin and end. False otherwise.

Definition at line 282 of file kateautoindent.cpp.

uint KateNormalIndent::measureIndent ( KateDocCursor &  cur  )  const [protected]

Measures the indention of the current textline marked by cur.

Parameters:
cur The cursor position to measure the indent to.
Returns:
The length of the indention in characters.

Definition at line 370 of file kateautoindent.cpp.

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

Mode index of this mode.

Returns:
modeNumber

Reimplemented from KateAutoIndent.

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

Definition at line 280 of file kateautoindent.h.

virtual void KateNormalIndent::processChar ( QChar  c  )  [inline, virtual]

Called every time a character is inserted into the document.

Parameters:
c character inserted

Reimplemented from KateAutoIndent.

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

Definition at line 258 of file kateautoindent.h.

virtual void KateNormalIndent::processLine ( KateDocCursor &   )  [inline, virtual]

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

Reimplemented from KateAutoIndent.

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

Definition at line 263 of file kateautoindent.h.

void KateNormalIndent::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 KateAutoIndent.

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

Definition at line 399 of file kateautoindent.cpp.

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

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

Reimplemented from KateAutoIndent.

Reimplemented in KateCSmartIndent, KateXmlIndent, KateCSAndSIndent, and KateVarIndent.

Definition at line 268 of file kateautoindent.h.

bool KateNormalIndent::skipBlanks ( KateDocCursor &  cur,
KateDocCursor &  max,
bool  newline 
) const [protected]

Skip all whitespace starting at cur and ending at max.

Spans lines if newline is set. cur is set to the current position afterwards.

Parameters:
cur The current cursor position to start from.
max The furthest cursor position that will be used for processing
newline Whether we are allowed to span multiple lines when skipping blanks
Returns:
True if cur < max after processing. False otherwise.

Definition at line 328 of file kateautoindent.cpp.

QString KateNormalIndent::tabString ( uint  length  )  const [protected]

Produces a string with the proper indentation characters for its length.

Parameters:
length The length of the indention in characters.
Returns:
A QString representing length characters (factoring in tabs and spaces)

Definition at line 378 of file kateautoindent.cpp.

void KateNormalIndent::updateConfig (  )  [virtual, slot]

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

)

Reimplemented from KateAutoIndent.

Definition at line 197 of file kateautoindent.cpp.


Member Data Documentation

uchar KateNormalIndent::alertAttrib

Definition at line 332 of file kateautoindent.h.

uchar KateNormalIndent::charAttrib

Definition at line 340 of file kateautoindent.h.

uchar KateNormalIndent::commentAttrib

Definition at line 328 of file kateautoindent.h.

uchar KateNormalIndent::doxyCommentAttrib

Definition at line 329 of file kateautoindent.h.

uchar KateNormalIndent::extensionAttrib

Definition at line 337 of file kateautoindent.h.

uint KateNormalIndent::indentWidth [protected]

The number of characters used when tabs are replaced by spaces.

Definition at line 324 of file kateautoindent.h.

bool KateNormalIndent::keepProfile [protected]

Always try to honor the leading whitespace of lines already in the file.

Definition at line 345 of file kateautoindent.h.

uchar KateNormalIndent::keywordAttrib

Definition at line 335 of file kateautoindent.h.

bool KateNormalIndent::mixedIndent [protected]

Optimize indent by mixing spaces and tabs, ala emacs.

Definition at line 344 of file kateautoindent.h.

uchar KateNormalIndent::normalAttrib

Definition at line 336 of file kateautoindent.h.

uchar KateNormalIndent::preprocessorAttrib

Definition at line 338 of file kateautoindent.h.

uchar KateNormalIndent::regionAttrib

Definition at line 330 of file kateautoindent.h.

uchar KateNormalIndent::stringAttrib

Definition at line 339 of file kateautoindent.h.

uchar KateNormalIndent::symbolAttrib

Definition at line 331 of file kateautoindent.h.

uint KateNormalIndent::tabWidth [protected]

The number of characters simulated for a tab.

Definition at line 323 of file kateautoindent.h.

uchar KateNormalIndent::tagAttrib

Definition at line 333 of file kateautoindent.h.

bool KateNormalIndent::useSpaces [protected]

Should we use spaces or tabs to indent.

Definition at line 343 of file kateautoindent.h.

uchar KateNormalIndent::wordAttrib

Definition at line 334 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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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