KateAutoIndent Class Reference

`#include <kateautoindent.h>`

Inheritance diagram for KateAutoIndent:

## Public Slots

virtual void | updateConfig ()

## Public Member Functions

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

## Static Public Member Functions

static KateAutoIndent * | createIndenter (KateDocument *doc, uint mode)
static QStringList | listModes ()
static QString | modeName (uint mode)
static QString | modeDescription (uint mode)
static uint | modeNumber (const QString &name)
static bool | hasConfigPage (uint mode)
static IndenterConfigPage * | configPage (QWidget *parent, uint mode)

## Protected Attributes

KateDocument * | doc

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

## Constructor & Destructor Documentation

KateAutoIndent::KateAutoIndent | ( | KateDocument * | doc | ) |

Constructor.

Parameters

  doc | parent document

Definition at line 150 of file kateautoindent.cpp.

KateAutoIndent::~KateAutoIndent | ( |  | ) |

virtual

Virtual Destructor for the baseclass.

Definition at line 154 of file kateautoindent.cpp.

## Member Function Documentation

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 KateVarIndent, and KateNormalIndent.

Definition at line 179 of file kateautoindent.h.

virtual bool KateAutoIndent::canProcessNewLine | ( |  | ) | const

inline virtual

does this indenter support processNewLine

Returns
  can you do it?

Reimplemented in KateNormalIndent.

Definition at line 149 of file kateautoindent.h.

IndenterConfigPage * KateAutoIndent::configPage | ( | QWidget * | parent,
|  | uint | mode
| ) |  |

static

Support for a config page.

Returns
  config page or 0 if not available.

Definition at line 142 of file kateautoindent.cpp.

KateAutoIndent * KateAutoIndent::createIndenter | ( | KateDocument * | doc,
|  | uint | mode
| ) |  |

static

Static methods to create and list indention modes.

Create an indenter

Parameters

  doc | document for the indenter
  mode | indention mode wanted

Returns
  created autoindention object

Definition at line 38 of file kateautoindent.cpp.

bool KateAutoIndent::hasConfigPage | ( | uint | mode | ) |

static

Config page support.

Parameters

  mode | mode index

Returns
  true, if the indenter `mode` has a configuration page

Definition at line 134 of file kateautoindent.cpp.

QStringList KateAutoIndent::listModes | ( |  | ) |

static

List all possible modes by name.

Returns
  list of modes

Definition at line 58 of file kateautoindent.cpp.

QString KateAutoIndent::modeDescription | ( | uint | mode | ) |

static

Return the mode description.

Parameters

  mode | mode index

Returns
  mode index

Definition at line 94 of file kateautoindent.cpp.

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

uint KateAutoIndent::modeNumber | ( | const QString & | name | ) |

static

Maps name -> index.

Parameters

  name | mode name

Returns
  mode index

Definition at line 114 of file kateautoindent.cpp.

virtual uint KateAutoIndent::modeNumber | ( |  | ) | const

inline virtual

Mode index of this mode.

Returns
  modeNumber

Reimplemented in KateVarIndent, and KateNormalIndent.

Definition at line 185 of file kateautoindent.h.

virtual void KateAutoIndent::processChar | ( | QChar | c | ) |

inline virtual

Called every time a character is inserted into the document.

Parameters

  c | character inserted

Reimplemented in KateVarIndent, and KateNormalIndent.

Definition at line 163 of file kateautoindent.h.

virtual void KateAutoIndent::processLine | ( | KateDocCursor & |  | ) |

inline virtual

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

Reimplemented in KateVarIndent, and KateNormalIndent.

Definition at line 168 of file kateautoindent.h.

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

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 KateVarIndent, and KateNormalIndent.

Definition at line 157 of file kateautoindent.h.

virtual void KateAutoIndent::processSection | ( | const KateDocCursor & | ,
|  | const KateDocCursor & |
| ) |  |

inline virtual

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

Reimplemented in KateVarIndent, and KateNormalIndent.

Definition at line 173 of file kateautoindent.h.

virtual void KateAutoIndent::updateConfig | ( |  | ) |

inline virtual slot

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

Definition at line 142 of file kateautoindent.h.

The documentation for this class was generated from the following files:

- kateautoindent.h
- kateautoindent.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys