Kate
katetextbuffer.cpp
Go to the documentation of this file.
94 // kill all invalid cursors, do this after block deletion, to uncover if they might be still linked in blocks
119 // clean out all cursors and lines, either move them to newBlock or invalidate them, if belonging to a range
206 Q_ASSERT (!editingChangedBuffer() || (m_editingMinimalLineChanged != -1 && m_editingMaximalLineChanged != -1));
207 Q_ASSERT (!editingChangedBuffer() || (m_editingMinimalLineChanged <= m_editingMaximalLineChanged));
208 Q_ASSERT (!editingChangedBuffer() || (m_editingMinimalLineChanged >= 0 && m_editingMinimalLineChanged < m_lines));
209 Q_ASSERT (!editingChangedBuffer() || (m_editingMaximalLineChanged >= 0 && m_editingMaximalLineChanged < m_lines));
280 m_blocks.at(blockIndex)->unwrapLine (line, (blockIndex > 0) ? m_blocks.at(blockIndex-1) : 0, firstLineInBlock ? (blockIndex - 1) : blockIndex);
513 bool TextBuffer::load (const QString &filename, bool &encodingErrors, bool &tooLongLinesWrapped, bool enforceTextCodec)
606 for (int testPosition = m_lineLengthLimit-1; (testPosition >= 0) && (testPosition >= (m_lineLengthLimit - (m_lineLengthLimit/10))); --testPosition) {
640 m_blocks.append (new TextBlock (this, m_blocks.last()->startLine() + m_blocks.last()->lines()));
843 void TextBuffer::notifyAboutRangeChange (KTextEditor::View *view, int startLine, int endLine, bool rangeWithAttribute)
862 static_cast<KateView *> (curView)->notifyAboutRangeChange (startLine, endLine, rangeWithAttribute);
872 QList<TextRange *> TextBuffer::rangesForLine (int line, KTextEditor::View *view, bool rangesWithAttributeOnly) const
902 if (range->startInternal().lineInternal() <= line && line <= range->endInternal().lineInternal())
void setCodec(QTextCodec *codec)
void setGenerateByteOrderMark(bool generateByteOrderMark)
Generate byte order mark on save.
Definition: katetextbuffer.h:130
bool editingChangedBuffer() const
Query information from the last editing transaction: was the content of the buffer changed...
Definition: katetextbuffer.h:250
Definition: katetextbuffer.h:63
const TextCursor & startInternal() const
Non-virtual version of start(), which is faster.
Definition: katetextrange.h:125
void setGenerateByteOrderMark(bool generate)
TextBuffer::EndOfLineMode eol() const
Detected end of line mode for this file.
Definition: katetextloader.h:125
virtual QByteArray name() const =0
Definition: katetextbuffer.h:62
void debugPrint(const QString &title) const
Debug output, print whole buffer content with line numbers and line length.
Definition: katetextbuffer.cpp:503
const QByteArray & digest() const
md5 digest of the document on disk, set either through file loading in openFile() or in KateDocument:...
Definition: katetextbuffer.cpp:692
Status status() const
void lineWrapped(const KTextEditor::Cursor &position)
A line got wrapped.
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
int lineInternal() const
Non-virtual version of line(), which is faster.
Definition: katetextcursor.h:127
virtual void close()
virtual void wrapLine(const KTextEditor::Cursor &position)
Wrap line at given cursor position.
Definition: katetextbuffer.cpp:218
void textInserted(const KTextEditor::Cursor &position, const QString &text)
Text got inserted.
virtual bool load(const QString &filename, bool &encodingErrors, bool &tooLongLinesWrapped, bool enforceTextCodec)
Load the given file.
Definition: katetextbuffer.cpp:513
void deleteBlockContent()
Delete the block content, delete all lines and delete all cursors not bound to ranges.
Definition: katetextblock.cpp:544
const TextCursor & endInternal() const
Nonvirtual version of end(), which is faster.
Definition: katetextrange.h:137
virtual bool startEditing()
Start an editing transaction, the wrapLine/unwrapLine/insertText and removeText functions are only to...
Definition: katetextbuffer.cpp:171
virtual void insertText(const KTextEditor::Cursor &position, const QString &text)
Insert text at given cursor position.
Definition: katetextbuffer.cpp:306
virtual ~TextBuffer()
Destruct the text buffer Virtual, we allow inheritance.
Definition: katetextbuffer.cpp:72
void clearBlockContent(TextBlock *targetBlock)
Clear the block content, delete all lines, move all cursors not bound to range to given block at 0...
Definition: katetextblock.cpp:556
void append(const T &value)
void setTextCodec(QTextCodec *codec)
Set codec for this buffer to use for load/save.
Definition: katetextbuffer.cpp:702
void setDigest(const QByteArray &md5sum)
Set the md5sum of this buffer.
Definition: katetextbuffer.cpp:697
bool isPunct() const
Definition: kateview.h:77
void appendLine(const QString &textOfLine)
Append a new line with given text.
Definition: katetextblock.cpp:67
void textRemoved(const KTextEditor::Range &range, const QString &text)
Text got removed.
Definition: katedocument.h:74
virtual void removeText(const KTextEditor::Range &range)
Remove text at given range.
Definition: katetextbuffer.cpp:338
virtual int mibEnum() const =0
virtual bool save(const QString &filename)
Save the current buffer content to the given file.
Definition: katetextbuffer.cpp:714
QList< TextRange * > rangesForLine(int line, KTextEditor::View *view, bool rangesWithAttributeOnly) const
Return the ranges which affect the given line.
Definition: katetextbuffer.cpp:872
void setEndOfLineMode(EndOfLineMode endOfLineMode)
Set end of line mode for this buffer, not allowed to be set to unknown.
Definition: katetextbuffer.h:143
Definition: katetextbuffer.h:60
void flush()
TextBuffer(KateDocument *parent, int blockSize=64)
Construct an empty text buffer.
Definition: katetextbuffer.cpp:44
bool readLine(int &offset, int &length)
read a line, return length + offset in unicode data
Definition: katetextloader.h:157
bool attributeOnlyForViews() const
Is this range's attribute only visible in views, not for example prints? Default is false...
Definition: katetextrange.h:211
const QString & mimeTypeForFilterDev() const
mime type used to create filter dev
Definition: katetextloader.h:137
QTextCodec * codecForName(const QByteArray &name)
void setRange(const KTextEditor::Range &range)
Set the range of this range.
Definition: katetextrange.cpp:122
bool generateByteOrderMark() const
Generate byte order mark on save?
Definition: katetextbuffer.h:136
virtual const QList< KTextEditor::View * > & views() const
Definition: katedocument.cpp:309
File Loader, will handle reading of files + detecting encoding.
Definition: katetextloader.h:44
KTextEditor::View * view() const
Gets the active view for this range.
Definition: katetextrange.h:156
void loaded(const QString &filename, bool encodingErrors)
Buffer loaded successfully a file.
virtual void clear()
Clears the buffer, reverts to initial empty state.
Definition: katetextbuffer.cpp:108
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.