KateAutoIndent

Search for usage in LXR

#include <kateautoindent.h>

Inheritance diagram for KateAutoIndent:

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 QStringmodeName () 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< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
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 QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () 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
 
qobject_cast (const QObject *object)
 
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)
 
QThreadthread () 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
 
QObjectsender () 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()

KateAutoIndent::KateAutoIndent ( KTextEditor::DocumentPrivate * doc)
explicit

Constructor, creates dummy indenter "None".

Parameters
docparent document

Definition at line 118 of file kateautoindent.cpp.

◆ ~KateAutoIndent()

KateAutoIndent::~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
rangerange of text to change indent for
changelevel 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
viewthe view the user work at
rangethe range of text to indent...

Definition at line 394 of file kateautoindent.cpp.

◆ listIdentifiers()

QStringList KateAutoIndent::listIdentifiers ( )
static

List all possible names, i.e.

"cstyle", "xml", ...

Returns
list of indenter identifiers

Definition at line 54 of file kateautoindent.cpp.

◆ listModes()

QStringList KateAutoIndent::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()

int KateAutoIndent::modeCount ( )
static

count of modes

Returns
number of existing modes

Definition at line 65 of file kateautoindent.cpp.

◆ modeDescription()

QString KateAutoIndent::modeDescription ( int mode)
static

Return the mode description.

Parameters
modemode index
Returns
mode index

Definition at line 84 of file kateautoindent.cpp.

◆ modeName() [1/2]

const QString & KateAutoIndent::modeName ( ) const
inline

mode name

Definition at line 172 of file kateautoindent.h.

◆ modeName() [2/2]

QString KateAutoIndent::modeName ( int mode)
static

Return the mode name given the mode.

Parameters
modemode index
Returns
name for this mode index

Definition at line 71 of file kateautoindent.cpp.

◆ modeNumber()

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

Maps name -> index.

Parameters
namemode name
Returns
mode index

Definition at line 107 of file kateautoindent.cpp.

◆ modeRequiredStyle()

QString KateAutoIndent::modeRequiredStyle ( int mode)
static

Return the syntax highlighting style required to use this mode.

Parameters
modemode index
Returns
required style, or empty if the mode doesn't require any style

Definition at line 98 of file kateautoindent.cpp.

◆ reloadScript

void KateAutoIndent::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
nameindention 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
viewthe view the user work at
positioncurrent cursor position, after the inserted char...
typedCharthe inserted char

Definition at line 417 of file kateautoindent.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.