Kate
#include <kateautoindent.h>
Public Slots | |
void | reloadScript () |
Public Member Functions | |
KateAutoIndent (KateDocument *doc) | |
~KateAutoIndent () | |
bool | changeIndent (const KTextEditor::Range &range, int change) |
void | checkRequiredStyle () |
void | indent (KateView *view, const KTextEditor::Range &range) |
const QString & | modeName () const |
void | setMode (const QString &name) |
void | updateConfig () |
void | userTypedChar (KateView *view, const KTextEditor::Cursor &position, QChar typedChar) |
Static Public Member Functions | |
static QStringList | listIdentifiers () |
static QStringList | listModes () |
static int | modeCount () |
static QString | modeDescription (int mode) |
static QString | modeName (int mode) |
static uint | modeNumber (const QString &name) |
static QString | modeRequiredStyle (int mode) |
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 40 of file kateautoindent.h.
Constructor & Destructor Documentation
|
explicit |
Constructor, creates dummy indenter "None".
- Parameters
-
doc parent document
Definition at line 111 of file kateautoindent.cpp.
KateAutoIndent::~KateAutoIndent | ( | ) |
Destructor.
Definition at line 121 of file kateautoindent.cpp.
Member Function Documentation
bool KateAutoIndent::changeIndent | ( | const KTextEditor::Range & | range, |
int | change | ||
) |
Function to provide the common indent/unindent/clean indent functionality to the document This should be generic for all indenters, internally it uses the doIndent function.
This works equal for all indenters, even for "none" or the scripts
- Parameters
-
range range of text to change indent for change level of indents to add or remove, zero will still trigger cleaning of indentation and removal of extra spaces, if option set
- Returns
- true on success, otherwise false
Definition at line 381 of file kateautoindent.cpp.
void KateAutoIndent::checkRequiredStyle | ( | ) |
Check if the current highlighting mode provides the style required by the current indenter.
If not, deactivate the indenter by changing to "normal" mode.
Definition at line 355 of file kateautoindent.cpp.
void KateAutoIndent::indent | ( | KateView * | view, |
const KTextEditor::Range & | range | ||
) |
The document requests the indenter to indent the given range of existing text.
This may happen to indent text pasted or to reindent existing text. For "none" and "normal" this is a nop, for the scripts, the expression will be asked for indent level for each line
- Parameters
-
view the view the user work at range the range of text to indent...
Definition at line 415 of file kateautoindent.cpp.
|
static |
List all possible names, i.e.
"cstyle", "xml", ...
- Returns
- list of indenter identifiers
Definition at line 55 of file kateautoindent.cpp.
|
static |
List all possible modes by name, i.e.
"C Style", "XML Style", ...
- Returns
- list of modes
Definition at line 45 of file kateautoindent.cpp.
|
static |
|
static |
Return the mode description.
- Parameters
-
mode mode index
- Returns
- mode index
Definition at line 83 of file kateautoindent.cpp.
|
static |
Return the mode name given the mode.
- Parameters
-
mode mode index
- Returns
- name for this mode index
Definition at line 72 of file kateautoindent.cpp.
|
inline |
mode name
Definition at line 177 of file kateautoindent.h.
|
static |
Maps name -> index.
- Parameters
-
name mode name
- Returns
- mode index
Definition at line 102 of file kateautoindent.cpp.
|
static |
Return the syntax highlighting style required to use this mode.
- Parameters
-
mode mode index
- Returns
- required style, or empty if the mode doesn't require any style
Definition at line 94 of file kateautoindent.cpp.
|
slot |
Definition at line 253 of file kateautoindent.cpp.
void KateAutoIndent::setMode | ( | const QString & | name | ) |
Switch indenter Nop if already set to given mode Otherwise switch to given indenter or to "None" if no suitable found...
- Parameters
-
name indention mode wanted
Definition at line 304 of file kateautoindent.cpp.
void KateAutoIndent::updateConfig | ( | ) |
Update indenter's configuration (indention width, etc.) Is called in the updateConfig() of the document and after creation of the indenter...
Definition at line 370 of file kateautoindent.cpp.
void KateAutoIndent::userTypedChar | ( | KateView * | view, |
const KTextEditor::Cursor & | position, | ||
QChar | typedChar | ||
) |
The user typed some char, the indenter can react on this '
' will be send as char if the user wraps a line.
- Parameters
-
view the view the user work at position current cursor position, after the inserted char... typedChar the inserted char
Definition at line 436 of file kateautoindent.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.