KateAutoIndent
#include <kateautoindent.h>
Public Slots | |
void | reloadScript () |
Public Member Functions | |
KateAutoIndent (KTextEditor::DocumentPrivate *doc) | |
~KateAutoIndent () override | |
bool | changeIndent (KTextEditor::Range range, int change) |
void | checkRequiredStyle () |
void | indent (KTextEditor::ViewPrivate *view, KTextEditor::Range range) |
const QString & | modeName () const |
void | setMode (const QString &name) |
void | updateConfig () |
void | userTypedChar (KTextEditor::ViewPrivate *view, const KTextEditor::Cursor position, QChar typedChar) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
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) |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
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 35 of file kateautoindent.h.
Constructor & Destructor Documentation
◆ KateAutoIndent()
|
explicit |
Constructor, creates dummy indenter "None".
- Parameters
-
doc parent document
Definition at line 118 of file kateautoindent.cpp.
◆ ~KateAutoIndent()
|
overridedefault |
Destructor.
Member Function Documentation
◆ changeIndent()
bool KateAutoIndent::changeIndent | ( | 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 364 of file kateautoindent.cpp.
◆ checkRequiredStyle()
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 343 of file kateautoindent.cpp.
◆ indent()
void KateAutoIndent::indent | ( | KTextEditor::ViewPrivate * | view, |
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 394 of file kateautoindent.cpp.
◆ listIdentifiers()
|
static |
List all possible names, i.e.
"cstyle", "xml", ...
- Returns
- list of indenter identifiers
Definition at line 54 of file kateautoindent.cpp.
◆ listModes()
|
static |
List all possible modes by name, i.e.
"C Style", "XML Style", ...
- Returns
- list of modes
Definition at line 43 of file kateautoindent.cpp.
◆ modeCount()
|
static |
◆ modeDescription()
|
static |
Return the mode description.
- Parameters
-
mode mode index
- Returns
- mode index
Definition at line 84 of file kateautoindent.cpp.
◆ modeName() [1/2]
|
inline |
mode name
Definition at line 172 of file kateautoindent.h.
◆ modeName() [2/2]
|
static |
Return the mode name given the mode.
- Parameters
-
mode mode index
- Returns
- name for this mode index
Definition at line 71 of file kateautoindent.cpp.
◆ modeNumber()
|
static |
Maps name -> index.
- Parameters
-
name mode name
- Returns
- mode index
Definition at line 107 of file kateautoindent.cpp.
◆ modeRequiredStyle()
|
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 98 of file kateautoindent.cpp.
◆ reloadScript
|
slot |
Definition at line 257 of file kateautoindent.cpp.
◆ setMode()
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 303 of file kateautoindent.cpp.
◆ updateConfig()
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 354 of file kateautoindent.cpp.
◆ userTypedChar()
void KateAutoIndent::userTypedChar | ( | KTextEditor::ViewPrivate * | 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 417 of file kateautoindent.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.