kdevplatform/language/backgroundparser
#include <documentchangetracker.h>

Public Slots | |
void | aboutToInvalidateMovingInterfaceContent (KTextEditor::Document *document) |
void | documentDestroyed (QObject *) |
void | documentSavedOrUploaded (KTextEditor::Document *, bool) |
void | lineUnwrapped (KTextEditor::Document *document, int line) |
void | lineWrapped (KTextEditor::Document *document, const KTextEditor::Cursor &position) |
void | textInserted (KTextEditor::Document *document, const KTextEditor::Cursor &position, const QString &inserted) |
void | textRemoved (KTextEditor::Document *document, const KTextEditor::Range &range, const QString &oldText) |
Public Member Functions | |
DocumentChangeTracker (KTextEditor::Document *document) | |
~DocumentChangeTracker () override | |
RevisionReference | acquireRevision (qint64 revision) |
virtual QList< QPair< KTextEditor::Range, QString > > | completions () const |
RevisionReference | currentRevision () |
RevisionReference | diskRevision () const |
KTextEditor::Document * | document () const |
KTextEditor::MovingInterface * | documentMovingInterface () const |
bool | holdingRevision (qint64 revision) const |
virtual bool | needUpdate () const |
virtual void | reset () |
RevisionReference | revisionAtLastReset () const |
CursorInRevision | transformBetweenRevisions (CursorInRevision cursor, qint64 fromRevision, qint64 toRevision, KTextEditor::MovingCursor::InsertBehavior behavior=KTextEditor::MovingCursor::StayOnInsert) const |
RangeInRevision | transformBetweenRevisions (RangeInRevision range, qint64 fromRevision, qint64 toRevision) const |
KTextEditor::Cursor | transformToCurrentRevision (CursorInRevision cursor, qint64 fromRevision, KTextEditor::MovingCursor::InsertBehavior behavior=KTextEditor::MovingCursor::StayOnInsert) const |
KTextEditor::Range | transformToCurrentRevision (RangeInRevision range, qint64 fromRevision) const |
CursorInRevision | transformToRevision (KTextEditor::Cursor cursor, qint64 toRevision, KTextEditor::MovingCursor::InsertBehavior behavior=KTextEditor::MovingCursor::StayOnInsert) const |
RangeInRevision | transformToRevision (KTextEditor::Range range, qint64 toRevision) const |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Member Functions | |
int | recommendedDelay (KTextEditor::Document *doc, const KTextEditor::Range &range, const QString &text, bool removal) |
void | updateChangedRange (int delay) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
KTextEditor::MovingRange * | m_changedRange |
QString | m_currentCleanedInsertion |
KTextEditor::Document * | m_document |
KTextEditor::Cursor | m_lastInsertionPosition |
KTextEditor::MovingInterface * | m_moving |
bool | m_needUpdate |
RevisionReference | m_revisionAtLastReset |
KDevelop::IndexedString | m_url |
Additional Inherited Members | |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
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) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
Detailed Description
Definition at line 129 of file documentchangetracker.h.
Constructor & Destructor Documentation
◆ DocumentChangeTracker()
|
explicit |
Definition at line 82 of file documentchangetracker.cpp.
◆ ~DocumentChangeTracker()
|
override |
Definition at line 234 of file documentchangetracker.cpp.
Member Function Documentation
◆ aboutToInvalidateMovingInterfaceContent
|
slot |
Definition at line 250 of file documentchangetracker.cpp.
◆ acquireRevision()
RevisionReference KDevelop::DocumentChangeTracker::acquireRevision | ( | qint64 | revision | ) |
Use this function to acquire a revision.
As long as the returned object is stored somewhere, the revision can be used for transformations in MovingInterface, and especially for DocumentChangeTracker::transformBetweenRevisions.
Returns a zero revision object if the revision could not be acquired (it wasn't held).
Definition at line 333 of file documentchangetracker.cpp.
◆ completions()
|
virtual |
Completions of the users current edits that are supposed to complete not-yet-finished statements, like for example for-loops for parsing.
Definition at line 110 of file documentchangetracker.cpp.
◆ currentRevision()
RevisionReference KDevelop::DocumentChangeTracker::currentRevision | ( | ) |
Returns the current revision (which is not locked by the tracker)
Definition at line 129 of file documentchangetracker.cpp.
◆ diskRevision()
RevisionReference KDevelop::DocumentChangeTracker::diskRevision | ( | ) | const |
Returns the revision object which locks the revision representing the on-disk state.
Returns a zero object if the file is not on disk.
- Todo:
- Track which revision was last saved to disk
Definition at line 494 of file documentchangetracker.cpp.
◆ document()
Document * KDevelop::DocumentChangeTracker::document | ( | ) | const |
Returns the tracked document.
Definition at line 240 of file documentchangetracker.cpp.
◆ documentDestroyed
|
slot |
Definition at line 228 of file documentchangetracker.cpp.
◆ documentMovingInterface()
MovingInterface * KDevelop::DocumentChangeTracker::documentMovingInterface | ( | ) | const |
Definition at line 245 of file documentchangetracker.cpp.
◆ documentSavedOrUploaded
|
slot |
Definition at line 223 of file documentchangetracker.cpp.
◆ holdingRevision()
bool KDevelop::DocumentChangeTracker::holdingRevision | ( | qint64 | revision | ) | const |
Returns whether the given revision is being current held, so that it can be used for transformations in MovingInterface.
Definition at line 345 of file documentchangetracker.cpp.
◆ lineUnwrapped
|
slot |
Definition at line 193 of file documentchangetracker.cpp.
◆ lineWrapped
|
slot |
Definition at line 188 of file documentchangetracker.cpp.
◆ needUpdate()
|
virtual |
Whether the changes that happened since the last reset are significant enough to require an update.
Definition at line 143 of file documentchangetracker.cpp.
◆ recommendedDelay()
|
protected |
Definition at line 174 of file documentchangetracker.cpp.
◆ reset()
|
virtual |
Resets the tracking to the current revision.
Definition at line 118 of file documentchangetracker.cpp.
◆ revisionAtLastReset()
RevisionReference KDevelop::DocumentChangeTracker::revisionAtLastReset | ( | ) | const |
Returns the document revision at which reset() was called last.
The revision is being locked by the tracker in MovingInterface, it will be unlocked as soon as reset() is called, so if you want to use the revision afterwards, you have to lock it before calling reset.
zero is returned if the revisions were invalidated after the last call.
Definition at line 136 of file documentchangetracker.cpp.
◆ textInserted
|
slot |
TODO: get this data from KTextEditor directly, make its signal public
Definition at line 198 of file documentchangetracker.cpp.
◆ textRemoved
|
slot |
Definition at line 213 of file documentchangetracker.cpp.
◆ transformBetweenRevisions() [1/2]
CursorInRevision KDevelop::DocumentChangeTracker::transformBetweenRevisions | ( | CursorInRevision | cursor, |
qint64 | fromRevision, | ||
qint64 | toRevision, | ||
KTextEditor::MovingCursor::InsertBehavior | behavior = KTextEditor::MovingCursor::StayOnInsert |
||
) | const |
◆ transformBetweenRevisions() [2/2]
RangeInRevision KDevelop::DocumentChangeTracker::transformBetweenRevisions | ( | RangeInRevision | range, |
qint64 | fromRevision, | ||
qint64 | toRevision | ||
) | const |
Safely maps the given range between the two given revisions.
The mapping is only done if both the from- and to- revision are held, else the original range is returned.
- Warning
- : Make sure that you actually hold the referenced revisions, else no transformation will be done.
- Note
- It is much less error-prone to use RevisionReference->transformToRevision() and RevisionReference->transformFromRevision() directly.
◆ transformToCurrentRevision() [1/2]
KTextEditor::Cursor KDevelop::DocumentChangeTracker::transformToCurrentRevision | ( | CursorInRevision | cursor, |
qint64 | fromRevision, | ||
KTextEditor::MovingCursor::InsertBehavior | behavior = KTextEditor::MovingCursor::StayOnInsert |
||
) | const |
◆ transformToCurrentRevision() [2/2]
KTextEditor::Range KDevelop::DocumentChangeTracker::transformToCurrentRevision | ( | RangeInRevision | range, |
qint64 | fromRevision | ||
) | const |
Definition at line 299 of file documentchangetracker.cpp.
◆ transformToRevision() [1/2]
CursorInRevision KDevelop::DocumentChangeTracker::transformToRevision | ( | KTextEditor::Cursor | cursor, |
qint64 | toRevision, | ||
KTextEditor::MovingCursor::InsertBehavior | behavior = KTextEditor::MovingCursor::StayOnInsert |
||
) | const |
Transform the cursor from the current revision into the given one.
◆ transformToRevision() [2/2]
RangeInRevision KDevelop::DocumentChangeTracker::transformToRevision | ( | KTextEditor::Range | range, |
qint64 | toRevision | ||
) | const |
Transform the range from the current revision into the given one.
Definition at line 288 of file documentchangetracker.cpp.
◆ updateChangedRange()
|
protected |
Definition at line 150 of file documentchangetracker.cpp.
Member Data Documentation
◆ m_changedRange
|
protected |
Definition at line 228 of file documentchangetracker.h.
◆ m_currentCleanedInsertion
|
protected |
Definition at line 226 of file documentchangetracker.h.
◆ m_document
|
protected |
Definition at line 230 of file documentchangetracker.h.
◆ m_lastInsertionPosition
|
protected |
Definition at line 227 of file documentchangetracker.h.
◆ m_moving
|
protected |
Definition at line 231 of file documentchangetracker.h.
◆ m_needUpdate
|
protected |
Definition at line 225 of file documentchangetracker.h.
◆ m_revisionAtLastReset
|
protected |
Definition at line 224 of file documentchangetracker.h.
◆ m_url
|
protected |
Definition at line 232 of file documentchangetracker.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:38:20 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.