KateUndoManager
#include <kateundomanager.h>
Signals | |
void | isActiveChanged (bool enabled) |
void | redoEnd (KTextEditor::Document *) |
void | redoStart (KTextEditor::Document *) |
void | undoChanged () |
void | undoEnd (KTextEditor::Document *) |
void | undoStart (KTextEditor::Document *) |
Public Slots | |
KTEXTEDITOR_EXPORT void | clearRedo () |
KTEXTEDITOR_EXPORT void | clearUndo () |
void | editEnd () |
void | editStart () |
void | endUndo () |
void | inputMethodEnd () |
void | inputMethodStart () |
void | redo () |
void | slotLineInserted (int line, const QString &s) |
void | slotLineRemoved (int line, const QString &s, const Kate::TextLine &tl) |
void | slotLineUnWrapped (int line, int col, int length, bool lineRemoved, const Kate::TextLine &tl, const Kate::TextLine &nextLine) |
void | slotLineWrapped (int line, int col, int length, bool newLine, const Kate::TextLine &tl) |
void | slotMarkLineAutoWrapped (int line, bool autowrapped) |
void | slotTextInserted (int line, int col, const QString &s, const Kate::TextLine &tl) |
void | slotTextRemoved (int line, int col, const QString &s, const Kate::TextLine &tl) |
void | startUndo () |
void | undo () |
Public Member Functions | |
KateUndoManager (KTextEditor::DocumentPrivate *doc) | |
KTextEditor::DocumentPrivate * | document () |
bool | isActive () const |
KTextEditor::Cursor | lastRedoCursor () const |
uint | redoCount () const |
void | setAllowComplexMerge (bool allow) |
void | setModified (bool modified) |
void | setUndoRedoCursorsOfLastGroup (const KTextEditor::Cursor undoCursor, const KTextEditor::Cursor redoCursor) |
uint | undoCount () const |
KTEXTEDITOR_EXPORT void | undoSafePoint () |
void | updateConfig () |
KTEXTEDITOR_EXPORT void | updateLineModifications () |
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 |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
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) |
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
KateUndoManager implements a document's history.
It is in either of the two states:
- the default state, which allows rolling back and forth the history of a document, and
- a state in which a new element is being added to the history.
The state of the KateUndomanager can be switched using editStart() and editEnd().
Definition at line 41 of file kateundomanager.h.
Constructor & Destructor Documentation
◆ KateUndoManager()
|
explicit |
Creates a clean undo history.
- Parameters
-
doc the document the KateUndoManager will belong to
Definition at line 17 of file kateundomanager.cpp.
Member Function Documentation
◆ clearRedo
|
slot |
Definition at line 496 of file kateundomanager.cpp.
◆ clearUndo
|
slot |
Definition at line 486 of file kateundomanager.cpp.
◆ document()
|
inline |
Definition at line 55 of file kateundomanager.h.
◆ editEnd
|
slot |
Notify KateUndoManager about the end of an edit.
Definition at line 75 of file kateundomanager.cpp.
◆ editStart
|
slot |
Notify KateUndoManager about the beginning of an edit.
Definition at line 53 of file kateundomanager.cpp.
◆ endUndo
|
slot |
Definition at line 132 of file kateundomanager.cpp.
◆ inputMethodEnd
|
slot |
Definition at line 120 of file kateundomanager.cpp.
◆ inputMethodStart
|
slot |
Definition at line 114 of file kateundomanager.cpp.
◆ isActive()
|
inline |
Definition at line 89 of file kateundomanager.h.
◆ lastRedoCursor()
KTextEditor::Cursor KateUndoManager::lastRedoCursor | ( | ) | const |
Returns the redo cursor of the last undo group.
Needed for the swap file recovery.
Definition at line 555 of file kateundomanager.cpp.
◆ redo
|
slot |
Redo the latest undo group.
Make sure isDefaultState() is true when calling this method.
Definition at line 391 of file kateundomanager.cpp.
◆ redoCount()
uint KateUndoManager::redoCount | ( | ) | const |
Returns how many redo() actions can be performed.
- Returns
- the number of undo groups which can be redone
Definition at line 370 of file kateundomanager.cpp.
◆ setAllowComplexMerge()
void KateUndoManager::setAllowComplexMerge | ( | bool | allow | ) |
Allows or disallows merging of "complex" undo groups.
When an undo group contains different types of undo items, it is considered a "complex" group.
- Parameters
-
allow whether complex merging is allowed
Definition at line 569 of file kateundomanager.cpp.
◆ setModified()
void KateUndoManager::setModified | ( | bool | modified | ) |
Definition at line 506 of file kateundomanager.cpp.
◆ setUndoRedoCursorsOfLastGroup()
void KateUndoManager::setUndoRedoCursorsOfLastGroup | ( | const KTextEditor::Cursor | undoCursor, |
const KTextEditor::Cursor | redoCursor ) |
Used by the swap file recovery, this function afterwards manipulates the undo/redo cursors of the last KateUndoGroup.
This function should not be used other than by Kate::SwapFile.
- Parameters
-
undoCursor the undo cursor redoCursor the redo cursor
Definition at line 545 of file kateundomanager.cpp.
◆ slotLineInserted
|
slot |
Notify KateUndoManager that a line was inserted.
Definition at line 296 of file kateundomanager.cpp.
◆ slotLineRemoved
|
slot |
Notify KateUndoManager that a line was removed.
Definition at line 308 of file kateundomanager.cpp.
◆ slotLineUnWrapped
|
slot |
Notify KateUndoManager that a line was un-wrapped.
Definition at line 225 of file kateundomanager.cpp.
◆ slotLineWrapped
|
slot |
Notify KateUndoManager that a line was wrapped.
Definition at line 191 of file kateundomanager.cpp.
◆ slotMarkLineAutoWrapped
|
slot |
Notify KateUndoManager that a line was marked as autowrapped.
Definition at line 180 of file kateundomanager.cpp.
◆ slotTextInserted
|
slot |
Notify KateUndoManager that text was inserted.
Definition at line 138 of file kateundomanager.cpp.
◆ slotTextRemoved
|
slot |
Notify KateUndoManager that text was removed.
Definition at line 159 of file kateundomanager.cpp.
◆ startUndo
|
slot |
Definition at line 126 of file kateundomanager.cpp.
◆ undo
|
slot |
Undo the latest undo group.
Make sure isDefaultState() is true when calling this method.
Definition at line 375 of file kateundomanager.cpp.
◆ undoCount()
uint KateUndoManager::undoCount | ( | ) | const |
Returns how many undo() actions can be performed.
- Returns
- the number of undo groups which can be undone
Definition at line 365 of file kateundomanager.cpp.
◆ undoSafePoint()
void KateUndoManager::undoSafePoint | ( | ) |
Prevent latest KateUndoGroup from being merged with the next one.
Definition at line 336 of file kateundomanager.cpp.
◆ updateConfig()
void KateUndoManager::updateConfig | ( | ) |
Definition at line 564 of file kateundomanager.cpp.
◆ updateLineModifications()
void KateUndoManager::updateLineModifications | ( | ) |
Definition at line 522 of file kateundomanager.cpp.
The documentation for this class was generated from the following files:
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.