Kate
KateAutoIndent Class Reference
Provides Auto-Indent functionality for katepart. More...
#include <kateautoindent.h>
Public Member Functions | |
bool | changeIndent (const KTextEditor::Range &range, int change) |
void | checkRequiredStyle () |
void | indent (KateView *view, const KTextEditor::Range &range) |
KateAutoIndent (KateDocument *doc) | |
const QString & | modeName () const |
void | setMode (const QString &name) |
void | updateConfig () |
void | userTypedChar (KateView *view, const KTextEditor::Cursor &position, QChar typedChar) |
~KateAutoIndent () | |
Static Public Member Functions | |
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 37 of file kateautoindent.h.
Constructor & Destructor Documentation
KateAutoIndent::KateAutoIndent | ( | KateDocument * | doc | ) | [explicit] |
Constructor, creates dummy indenter "None".
- Parameters:
-
doc parent document
Definition at line 100 of file kateautoindent.cpp.
KateAutoIndent::~KateAutoIndent | ( | ) |
Destructor.
Definition at line 106 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 335 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 312 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 369 of file kateautoindent.cpp.
QStringList KateAutoIndent::listModes | ( | ) | [static] |
List all possible modes by name.
- Returns:
- list of modes
Definition at line 44 of file kateautoindent.cpp.
int KateAutoIndent::modeCount | ( | ) | [static] |
QString KateAutoIndent::modeDescription | ( | int | mode | ) | [static] |
Return the mode description.
- Parameters:
-
mode mode index
- Returns:
- mode index
Definition at line 72 of file kateautoindent.cpp.
const QString& KateAutoIndent::modeName | ( | ) | const [inline] |
mode name
Definition at line 168 of file kateautoindent.h.
QString KateAutoIndent::modeName | ( | int | mode | ) | [static] |
Return the mode name given the mode.
- Parameters:
-
mode mode index
- Returns:
- name for this mode index
Definition at line 61 of file kateautoindent.cpp.
uint KateAutoIndent::modeNumber | ( | const QString & | name | ) | [static] |
Maps name -> index.
- Parameters:
-
name mode name
- Returns:
- mode index
Definition at line 91 of file kateautoindent.cpp.
QString KateAutoIndent::modeRequiredStyle | ( | int | mode | ) | [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 83 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 261 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 324 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 388 of file kateautoindent.cpp.
The documentation for this class was generated from the following files: