KTextEditor
kateautoindent.cpp
81 return KTextEditor::EditorPrivate::self()->scriptManager()->indentationScriptByIndex(mode - 2)->indentHeader().baseName();
94 const QString &name = KTextEditor::EditorPrivate::self()->scriptManager()->indentationScriptByIndex(mode - 2)->indentHeader().name();
104 return KTextEditor::EditorPrivate::self()->scriptManager()->indentationScriptByIndex(mode - 2)->indentHeader().requiredStyle();
126 connect(KTextEditor::EditorPrivate::self()->scriptManager(), &KateScriptManager::reloaded, this, &KateAutoIndent::reloadScript);
266void KateAutoIndent::scriptIndent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor position, QChar typedChar)
297bool KateAutoIndent::isStyleProvided(const KateIndentScript *script, const KateHighlighting *highlight)
325 KateIndentScript *script = KTextEditor::EditorPrivate::self()->scriptManager()->indentationScript(name);
332 qCWarning(LOG_KTE) << "mode" << name << "requires a different highlight style: highlighting" << doc->highlight()->name() << "with style"
347 qCDebug(LOG_KTE) << "mode" << m_mode << "requires a different highlight style: highlighting" << doc->highlight()->name() << "with style"
417void KateAutoIndent::userTypedChar(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor position, QChar typedChar)
447KateViewIndentationAction::KateViewIndentationAction(KTextEditor::DocumentPrivate *_doc, const QString &text, QObject *parent)
466 QAction *action = menu()->addAction(QLatin1Char('&') + KateAutoIndent::modeDescription(z).replace(QLatin1Char('&'), QLatin1String("&&")));
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
bool editInsertText(int line, int col, const QString &s, bool notify=true)
Add a string in the given line/column.
Definition katedocument.cpp:1257
bool editStart()
Enclose editor actions with editStart() and editEnd() to group them.
Definition katedocument.cpp:971
bool editRemoveText(int line, int col, int len)
Remove a string in the given line/column.
Definition katedocument.cpp:1306
void rememberUserDidSetIndentationMode()
set indentation mode by user this will remember that a user did set it and will avoid reset on save
Definition katedocument.h:1108
int lineLength(int line) const override
Get the length of a given line in characters.
Definition katedocument.cpp:921
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
constexpr int numberOfLines() const noexcept
Returns the number of lines separating the start() and end() positions.
Definition include/ktexteditor/range.h:279
void indent(KTextEditor::ViewPrivate *view, KTextEditor::Range range)
The document requests the indenter to indent the given range of existing text.
Definition kateautoindent.cpp:394
KateAutoIndent(KTextEditor::DocumentPrivate *doc)
Constructor, creates dummy indenter "None".
Definition kateautoindent.cpp:118
bool changeIndent(KTextEditor::Range range, int change)
Function to provide the common indent/unindent/clean indent functionality to the document This should...
Definition kateautoindent.cpp:364
void checkRequiredStyle()
Check if the current highlighting mode provides the style required by the current indenter.
Definition kateautoindent.cpp:343
void updateConfig()
Update indenter's configuration (indention width, etc.) Is called in the updateConfig() of the docume...
Definition kateautoindent.cpp:354
void setMode(const QString &name)
Switch indenter Nop if already set to given mode Otherwise switch to given indenter or to "None" if n...
Definition kateautoindent.cpp:303
static QString modeRequiredStyle(int mode)
Return the syntax highlighting style required to use this mode.
Definition kateautoindent.cpp:98
void 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...
Definition kateautoindent.cpp:417
static QString modeDescription(int mode)
Return the mode description.
Definition kateautoindent.cpp:84
A specialized class for scripts that are of type ScriptType::Indentation.
Definition kateindentscript.h:102
QPair< int, int > indent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor position, QChar typedCharacter, int indentWidth)
Returns a pair where the first value is the indent amount, and the second value is the alignment.
Definition kateindentscript.cpp:43
void reloaded()
this signal is emitted when all scripts are deleted and reloaded again.
int indentDepth(int tabWidth) const
Returns the indentation depth with each tab expanded into tabWidth characters.
Definition katetextline.cpp:59
QString i18nc(const char *context, const char *text, const TYPE &arg...)
const QList< QKeySequence > & replace()
void setCheckable(bool)
void setChecked(bool)
QVariant data() const const
void setEnabled(bool)
void setData(const QVariant &data)
QList< QAction * > actions() const const
QAction * addAction(QAction *action)
void removeAction(QAction *action)
const char * constData() const const
void reserve(qsizetype size)
qsizetype size() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
QString & append(QChar ch)
const QChar at(qsizetype position) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype length() const const
qsizetype size() const const
QByteArray toUtf8() const const
InstantPopup
int toInt(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.