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

kate

Public Slots | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
KateNormalIndent Class Reference

#include <kateautoindent.h>

Inheritance diagram for KateNormalIndent:
KateAutoIndent KateVarIndent

Public Slots

virtual void updateConfig ()
 
- Public Slots inherited from KateAutoIndent
virtual void updateConfig ()
 

Public Member Functions

 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
 

Public Attributes

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

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

uint tabWidth
 
uint indentWidth
 
bool useSpaces
 
bool mixedIndent
 
bool keepProfile
 
- Protected Attributes inherited from KateAutoIndent
KateDocument * doc
 

Additional Inherited Members

- 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)
 

Detailed Description

Provides Auto-Indent functionality for katepart.

Definition at line 217 of file kateautoindent.h.

Constructor & Destructor Documentation

◆ KateNormalIndent()

KateNormalIndent::KateNormalIndent ( KateDocument *  doc)

Constructor.

Parameters
docparent document

Definition at line 186 of file kateautoindent.cpp.

◆ ~KateNormalIndent()

KateNormalIndent::~KateNormalIndent ( )
virtual

Virtual Destructor for the baseclass.

Definition at line 193 of file kateautoindent.cpp.

Member Function Documentation

◆ canProcessLine()

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

Reimplemented in KateVarIndent.

Definition at line 274 of file kateautoindent.h.

◆ canProcessNewLine()

virtual bool KateNormalIndent::canProcessNewLine ( ) const
inlinevirtual

does this indenter support processNewLine

Returns
can you do it?

Reimplemented from KateAutoIndent.

Definition at line 244 of file kateautoindent.h.

◆ isBalanced()

bool KateNormalIndent::isBalanced ( KateDocCursor &  begin,
const KateDocCursor &  end,
TQChar  open,
TQChar  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
beginBeginning cursor position.
endEnding cursor position where the processing will stop.
openThe open character.
closeThe closing character which should be matched against open.
posContains 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.

◆ measureIndent()

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

Measures the indention of the current textline marked by cur.

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

Definition at line 370 of file kateautoindent.cpp.

◆ modeNumber()

virtual uint KateNormalIndent::modeNumber ( ) const
inlinevirtual

Mode index of this mode.

Returns
modeNumber

Reimplemented from KateAutoIndent.

Reimplemented in KateVarIndent.

Definition at line 280 of file kateautoindent.h.

◆ processChar()

virtual void KateNormalIndent::processChar ( TQChar  c)
inlinevirtual

Called every time a character is inserted into the document.

Parameters
ccharacter inserted

Reimplemented from KateAutoIndent.

Reimplemented in KateVarIndent.

Definition at line 258 of file kateautoindent.h.

◆ processLine()

virtual void KateNormalIndent::processLine ( KateDocCursor &  )
inlinevirtual

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

Reimplemented from KateAutoIndent.

Reimplemented in KateVarIndent.

Definition at line 263 of file kateautoindent.h.

◆ processNewline()

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

Reimplemented in KateVarIndent.

Definition at line 399 of file kateautoindent.cpp.

◆ processSection()

virtual void KateNormalIndent::processSection ( const KateDocCursor &  ,
const KateDocCursor &   
)
inlinevirtual

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

Reimplemented from KateAutoIndent.

Reimplemented in KateVarIndent.

Definition at line 268 of file kateautoindent.h.

◆ skipBlanks()

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
curThe current cursor position to start from.
maxThe furthest cursor position that will be used for processing
newlineWhether 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.

◆ tabString()

TQString KateNormalIndent::tabString ( uint  length) const
protected

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

Parameters
lengthThe length of the indention in characters.
Returns
A TQString representing length characters (factoring in tabs and spaces)

Definition at line 378 of file kateautoindent.cpp.

◆ updateConfig

void KateNormalIndent::updateConfig ( )
virtualslot

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

Definition at line 197 of file kateautoindent.cpp.

Member Data Documentation

◆ alertAttrib

uchar KateNormalIndent::alertAttrib

Definition at line 332 of file kateautoindent.h.

◆ charAttrib

uchar KateNormalIndent::charAttrib

Definition at line 340 of file kateautoindent.h.

◆ commentAttrib

uchar KateNormalIndent::commentAttrib

Definition at line 328 of file kateautoindent.h.

◆ doxyCommentAttrib

uchar KateNormalIndent::doxyCommentAttrib

Definition at line 329 of file kateautoindent.h.

◆ extensionAttrib

uchar KateNormalIndent::extensionAttrib

Definition at line 337 of file kateautoindent.h.

◆ indentWidth

uint KateNormalIndent::indentWidth
protected

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

Definition at line 324 of file kateautoindent.h.

◆ keepProfile

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.

◆ keywordAttrib

uchar KateNormalIndent::keywordAttrib

Definition at line 335 of file kateautoindent.h.

◆ mixedIndent

bool KateNormalIndent::mixedIndent
protected

Optimize indent by mixing spaces and tabs, ala emacs.

Definition at line 344 of file kateautoindent.h.

◆ normalAttrib

uchar KateNormalIndent::normalAttrib

Definition at line 336 of file kateautoindent.h.

◆ preprocessorAttrib

uchar KateNormalIndent::preprocessorAttrib

Definition at line 338 of file kateautoindent.h.

◆ regionAttrib

uchar KateNormalIndent::regionAttrib

Definition at line 330 of file kateautoindent.h.

◆ stringAttrib

uchar KateNormalIndent::stringAttrib

Definition at line 339 of file kateautoindent.h.

◆ symbolAttrib

uchar KateNormalIndent::symbolAttrib

Definition at line 331 of file kateautoindent.h.

◆ tabWidth

uint KateNormalIndent::tabWidth
protected

The number of characters simulated for a tab.

Definition at line 323 of file kateautoindent.h.

◆ tagAttrib

uchar KateNormalIndent::tagAttrib

Definition at line 333 of file kateautoindent.h.

◆ useSpaces

bool KateNormalIndent::useSpaces
protected

Should we use spaces or tabs to indent.

Definition at line 343 of file kateautoindent.h.

◆ wordAttrib

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

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.