• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/backgroundparser

  • KDevelop
  • DocumentChangeTracker
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDevelop::DocumentChangeTracker Class Reference

#include <documentchangetracker.h>

Inheritance diagram for KDevelop::DocumentChangeTracker:
Inheritance graph
[legend]

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
 
- Public Member Functions inherited from QObject
 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 &regExp) 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)
 
- Protected Member Functions inherited from QObject
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

- Static Public Member Functions inherited from QObject
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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 129 of file documentchangetracker.h.

Constructor & Destructor Documentation

◆ DocumentChangeTracker()

KDevelop::DocumentChangeTracker::DocumentChangeTracker ( KTextEditor::Document *  document)
explicit

Definition at line 82 of file documentchangetracker.cpp.

◆ ~DocumentChangeTracker()

KDevelop::DocumentChangeTracker::~DocumentChangeTracker ( )
override

Definition at line 234 of file documentchangetracker.cpp.

Member Function Documentation

◆ aboutToInvalidateMovingInterfaceContent

void KDevelop::DocumentChangeTracker::aboutToInvalidateMovingInterfaceContent ( KTextEditor::Document *  document)
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()

QList< QPair< KTextEditor::Range, QString > > KDevelop::DocumentChangeTracker::completions ( ) const
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

void KDevelop::DocumentChangeTracker::documentDestroyed ( QObject *  )
slot

Definition at line 228 of file documentchangetracker.cpp.

◆ documentMovingInterface()

MovingInterface * KDevelop::DocumentChangeTracker::documentMovingInterface ( ) const

Definition at line 245 of file documentchangetracker.cpp.

◆ documentSavedOrUploaded

void KDevelop::DocumentChangeTracker::documentSavedOrUploaded ( KTextEditor::Document *  doc,
bool   
)
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

void KDevelop::DocumentChangeTracker::lineUnwrapped ( KTextEditor::Document *  document,
int  line 
)
slot

Definition at line 193 of file documentchangetracker.cpp.

◆ lineWrapped

void KDevelop::DocumentChangeTracker::lineWrapped ( KTextEditor::Document *  document,
const KTextEditor::Cursor &  position 
)
slot

Definition at line 188 of file documentchangetracker.cpp.

◆ needUpdate()

bool KDevelop::DocumentChangeTracker::needUpdate ( ) const
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()

int KDevelop::DocumentChangeTracker::recommendedDelay ( KTextEditor::Document *  doc,
const KTextEditor::Range &  range,
const QString &  text,
bool  removal 
)
protected

Definition at line 174 of file documentchangetracker.cpp.

◆ reset()

void KDevelop::DocumentChangeTracker::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

void KDevelop::DocumentChangeTracker::textInserted ( KTextEditor::Document *  document,
const KTextEditor::Cursor &  position,
const QString &  inserted 
)
slot

TODO: get this data from KTextEditor directly, make its signal public

Definition at line 198 of file documentchangetracker.cpp.

◆ textRemoved

void KDevelop::DocumentChangeTracker::textRemoved ( KTextEditor::Document *  document,
const KTextEditor::Range &  range,
const QString &  oldText 
)
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()

void KDevelop::DocumentChangeTracker::updateChangedRange ( int  delay)
protected

Definition at line 150 of file documentchangetracker.cpp.

Member Data Documentation

◆ m_changedRange

KTextEditor::MovingRange* KDevelop::DocumentChangeTracker::m_changedRange
protected

Definition at line 228 of file documentchangetracker.h.

◆ m_currentCleanedInsertion

QString KDevelop::DocumentChangeTracker::m_currentCleanedInsertion
protected

Definition at line 226 of file documentchangetracker.h.

◆ m_document

KTextEditor::Document* KDevelop::DocumentChangeTracker::m_document
protected

Definition at line 230 of file documentchangetracker.h.

◆ m_lastInsertionPosition

KTextEditor::Cursor KDevelop::DocumentChangeTracker::m_lastInsertionPosition
protected

Definition at line 227 of file documentchangetracker.h.

◆ m_moving

KTextEditor::MovingInterface* KDevelop::DocumentChangeTracker::m_moving
protected

Definition at line 231 of file documentchangetracker.h.

◆ m_needUpdate

bool KDevelop::DocumentChangeTracker::m_needUpdate
protected

Definition at line 225 of file documentchangetracker.h.

◆ m_revisionAtLastReset

RevisionReference KDevelop::DocumentChangeTracker::m_revisionAtLastReset
protected

Definition at line 224 of file documentchangetracker.h.

◆ m_url

KDevelop::IndexedString KDevelop::DocumentChangeTracker::m_url
protected

Definition at line 232 of file documentchangetracker.h.


The documentation for this class was generated from the following files:
  • documentchangetracker.h
  • documentchangetracker.cpp
This file is part of the KDE documentation.
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.

kdevplatform/language/backgroundparser

Skip menu "kdevplatform/language/backgroundparser"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal