KateBuffer

Search for usage in LXR

KateBuffer Class Referencefinal

#include <katebuffer.h>

Inheritance diagram for KateBuffer:

Signals

void respellCheckBlock (int start, int end)
 
void tagLines (KTextEditor::LineRange lineRange)
 
- Signals inherited from Kate::TextBuffer
void cleared ()
 
void loaded (const QString &filename, bool encodingErrors)
 
void saved (const QString &filename)
 

Public Member Functions

 KateBuffer (KTextEditor::DocumentPrivate *doc)
 
 ~KateBuffer () override
 
bool brokenEncoding () const
 
bool canEncode ()
 
void clear () override
 
KTextEditor::Range computeFoldingRangeForStartLine (int startLine)
 
KateHighlighting::Foldings computeFoldings (int line)
 
bool editChanged () const
 
void editEnd ()
 
void editStart ()
 
int editTagEnd () const
 
bool editTagFrom () const
 
int editTagStart () const
 
void ensureHighlighted (int line, int lookAhead=64)
 
KateHighlighting * highlight ()
 
void invalidateHighlighting ()
 
std::pair< bool, bool > isFoldingStartingOnLine (int startLine)
 
int lineLength (int lineno) const
 
int longestLineLoaded () const
 
bool openFile (const QString &m_file, bool enforceTextCodec)
 
Kate::TextLine plainLine (int lineno)
 
bool saveFile (const QString &m_file)
 
void setHighlight (int hlMode)
 
void setTabWidth (int w)
 
int tabWidth () const
 
bool tooLongLinesWrapped () const
 
void unwrapLine (int line) override
 
void updateHighlighting ()
 
void wrapLine (const KTextEditor::Cursor position) override
 
- Public Member Functions inherited from Kate::TextBuffer
 TextBuffer (KTextEditor::DocumentPrivate *parent, bool alwaysUseKAuth=false)
 
 ~TextBuffer () override
 
int cursorToOffset (KTextEditor::Cursor c) const
 
void debugPrint (const QString &title) const
 
const QByteArraydigest () const
 
KTextEditor::DocumentPrivate * document () const
 
bool editingChangedBuffer () const
 
bool editingChangedNumberOfLines () const
 
int editingLastLines () const
 
qint64 editingLastRevision () const
 
int editingMaximalLineChanged () const
 
int editingMinimalLineChanged () const
 
int editingTransactions () const
 
KEncodingProber::ProberType encodingProberType () const
 
EndOfLineMode endOfLineMode () const
 
QString fallbackTextCodec () const
 
virtual bool finishEditing ()
 
bool generateByteOrderMark () const
 
TextHistoryhistory ()
 
virtual void insertText (const KTextEditor::Cursor position, const QString &text)
 
void invalidateRanges ()
 
TextLine line (int line) const
 
int lineLength (int line) const
 
int lines () const
 
virtual bool load (const QString &filename, bool &encodingErrors, bool &tooLongLinesWrapped, int &longestLineLoaded, bool enforceTextCodec)
 
KTextEditor::Cursor offsetToCursor (int offset) const
 
bool rangePointerValid (TextRange *range) const
 
QList< TextRange * > rangesForLine (int line, KTextEditor::View *view, bool rangesWithAttributeOnly) const
 
void rangesForLine (int line, KTextEditor::View *view, bool rangesWithAttributeOnly, QList< TextRange * > &outRanges) const
 
virtual void removeText (KTextEditor::Range range)
 
qint64 revision () const
 
virtual bool save (const QString &filename)
 
void setDigest (const QByteArray &checksum)
 
void setEncodingProberType (KEncodingProber::ProberType proberType)
 
void setEndOfLineMode (EndOfLineMode endOfLineMode)
 
void setFallbackTextCodec (const QString &codec)
 
void setGenerateByteOrderMark (bool generateByteOrderMark)
 
void setLineLengthLimit (int lineLengthLimit)
 
void setLineMetaData (int line, const TextLine &textLine)
 
void setTextCodec (const QString &codec)
 
virtual bool startEditing ()
 
QString text () const
 
QString textCodec () const
 
- 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
 

Additional Inherited Members

- Public Types inherited from Kate::TextBuffer
enum  EndOfLineMode { eolUnknown = -1 , eolUnix = 0 , eolDos = 1 , eolMac = 2 }
 
- 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)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- 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

The KateBuffer class maintains a collections of lines.

Author
Waldo Bastian basti.nosp@m.an@k.nosp@m.de.or.nosp@m.g
Christoph Cullmann cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg

Definition at line 30 of file katebuffer.h.

Constructor & Destructor Documentation

◆ KateBuffer()

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

Create an empty buffer.

Parameters
docparent document

(with one block with one empty line)

Definition at line 31 of file katebuffer.cpp.

◆ ~KateBuffer()

KateBuffer::~KateBuffer ( )
overridedefault

Goodbye buffer.

Cleanup on destruction.

Member Function Documentation

◆ brokenEncoding()

bool KateBuffer::brokenEncoding ( ) const
inline

Did encoding errors occur on load?

Returns
encoding errors occurred on load?

Definition at line 118 of file katebuffer.h.

◆ canEncode()

bool KateBuffer::canEncode ( )

Can the current codec handle all chars.

Returns
chars can be encoded

Definition at line 175 of file katebuffer.cpp.

◆ clear()

void KateBuffer::clear ( )
overridevirtual

Clear the buffer.

Reimplemented from Kate::TextBuffer.

Definition at line 92 of file katebuffer.cpp.

◆ computeFoldingRangeForStartLine()

KTextEditor::Range KateBuffer::computeFoldingRangeForStartLine ( int startLine)

For a given line, compute the folding range that starts there to be used to fold e.g.

from the icon border

Parameters
startLinestart line
Returns
folding range starting at the given line or invalid range when there is no folding start or startLine is not valid

Definition at line 474 of file katebuffer.cpp.

◆ computeFoldings()

KateHighlighting::Foldings KateBuffer::computeFoldings ( int line)

Compute folding vector for the given line, will internally do a re-highlighting.

Parameters
lineline to get folding vector for

Definition at line 407 of file katebuffer.cpp.

◆ editChanged()

bool KateBuffer::editChanged ( ) const
inline

were there changes in the current running editing session?

Returns
changes done?

Definition at line 68 of file katebuffer.h.

◆ editEnd()

void KateBuffer::editEnd ( )

finish some editing action

Definition at line 55 of file katebuffer.cpp.

◆ editStart()

void KateBuffer::editStart ( )

start some editing action

Definition at line 48 of file katebuffer.cpp.

◆ editTagEnd()

int KateBuffer::editTagEnd ( ) const
inline

dirty lines end

Returns
end line

Definition at line 86 of file katebuffer.h.

◆ editTagFrom()

bool KateBuffer::editTagFrom ( ) const
inline

line inserted/removed?

Returns
line inserted/removed?

Definition at line 95 of file katebuffer.h.

◆ editTagStart()

int KateBuffer::editTagStart ( ) const
inline

dirty lines start

Returns
start line

Definition at line 77 of file katebuffer.h.

◆ ensureHighlighted()

void KateBuffer::ensureHighlighted ( int line,
int lookAhead = 64 )

Update highlighting of given line line, if needed.

If line is already highlighted, this function does nothing. If line is not highlighted, all lines up to line + lookAhead are highlighted.

Parameters
lookAheadalso highlight these following lines

Definition at line 240 of file katebuffer.cpp.

◆ highlight()

KateHighlighting * KateBuffer::highlight ( )
inline

Definition at line 214 of file katebuffer.h.

◆ invalidateHighlighting()

void KateBuffer::invalidateHighlighting ( )

Invalidate highlighting of whole buffer.

Definition at line 319 of file katebuffer.cpp.

◆ isFoldingStartingOnLine()

std::pair< bool, bool > KateBuffer::isFoldingStartingOnLine ( int startLine)

For a given line, compute if folding starts here.

Parameters
startLinestart line
Returns
does folding start here and is it indentation based?

Definition at line 428 of file katebuffer.cpp.

◆ lineLength()

int KateBuffer::lineLength ( int lineno) const
inline

Definition at line 167 of file katebuffer.h.

◆ longestLineLoaded()

int KateBuffer::longestLineLoaded ( ) const
inline

Definition at line 132 of file katebuffer.h.

◆ openFile()

bool KateBuffer::openFile ( const QString & m_file,
bool enforceTextCodec )

Open a file, use the given filename.

Parameters
m_filefilename to open
enforceTextCodecenforce to use only the set text codec
Returns
success

Definition at line 106 of file katebuffer.cpp.

◆ plainLine()

Kate::TextLine KateBuffer::plainLine ( int lineno)
inline

Return line lineno.

Highlighting of returned line might be out-dated, which may be sufficient for pure text manipulation functions, like search/replace. If you require highlighting to be up to date, call ensureHighlighted prior to this method.

Definition at line 158 of file katebuffer.h.

◆ saveFile()

bool KateBuffer::saveFile ( const QString & m_file)

Save the buffer to a file, use the given filename + codec + end of line chars (internal use of qtextstream)

Parameters
m_filefilename to save to
Returns
success

Definition at line 212 of file katebuffer.cpp.

◆ setHighlight()

void KateBuffer::setHighlight ( int hlMode)

Use highlight for highlighting.

highlight may be 0 in which case highlighting will be disabled.

Definition at line 290 of file katebuffer.cpp.

◆ setTabWidth()

void KateBuffer::setTabWidth ( int w)

Definition at line 279 of file katebuffer.cpp.

◆ tabWidth()

int KateBuffer::tabWidth ( ) const
inline

Definition at line 198 of file katebuffer.h.

◆ tagLines

void KateBuffer::tagLines ( KTextEditor::LineRange lineRange)
signal

Emitted when the highlighting of a certain range has changed.

◆ tooLongLinesWrapped()

bool KateBuffer::tooLongLinesWrapped ( ) const
inline

Too long lines wrapped on load?

Returns
too long lines wrapped on load?

Definition at line 127 of file katebuffer.h.

◆ unwrapLine()

void KateBuffer::unwrapLine ( int line)
overridevirtual

Unwrap given line.

Parameters
lineline to unwrap

Reimplemented from Kate::TextBuffer.

Definition at line 269 of file katebuffer.cpp.

◆ updateHighlighting()

void KateBuffer::updateHighlighting ( )

Update highlighting of the lines in last edit transaction.

Definition at line 75 of file katebuffer.cpp.

◆ wrapLine()

void KateBuffer::wrapLine ( const KTextEditor::Cursor position)
overridevirtual

Wrap line at given cursor position.

Parameters
positionline/column as cursor where to wrap

Reimplemented from Kate::TextBuffer.

Definition at line 259 of file katebuffer.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 Tue Mar 26 2024 11:15:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.